Open Quuxplusone opened 6 years ago
Attached fail.ll
(275 bytes, text/plain): small ll reproducer
This looks exactly like the problem I described here:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20180312/533912.html
It was introduced in r325892 and can be reproduced with
llc -o - fail.ll -disable-cgp-branch-opts
Copy/pasting my short analysis from the email above:
I just took a quick look in the debugger and saw that in
DAGCombiner::rebuildSetCC() we end up at
// Avoid missing important xor optimizations.
while (SDValue Tmp = visitXOR(TheXor)) {
// We don't have a XOR anymore, bail.
if (Tmp.getOpcode() != ISD::XOR)
return Tmp;
And when we do the above
return Tmp;
Tmp is:
(gdb) p Tmp->dump()
t10: i1 = <<Deleted Node!>>
and this "Deleted Node" is then used to create a new brcond in
DAGCombiner::visitBRCOND:
if (SDValue NewN1 = rebuildSetCC(N1))
return DAG.getNode(ISD::BRCOND, SDLoc(N), MVT::Other, Chain,
NewN1, N2);
Was this fixed by r331985?
(In reply to Vedant Kumar from comment #3)
> Was this fixed by r331985?
It fixed the instance of the problem that I saw. I don't know about the variant
that Zhendong Su originally reported in this PR but it seems likely to me that
it does.
fail.ll
(275 bytes, text/plain)