[llvm-branch-commits] [llvm-branch] r98306 - in /llvm/branches/release_27: ./ lib/CodeGen/SelectionDAG/DAGCombiner.cpp test/CodeGen/X86/crash.ll
Tanya Lattner
tonic at nondot.org
Thu Mar 11 15:57:44 PST 2010
Author: tbrethou
Date: Thu Mar 11 17:57:44 2010
New Revision: 98306
URL: http://llvm.org/viewvc/llvm-project?rev=98306&view=rev
Log:
Merge 98203 from mainline.
fix PR6533 by updating the br(xor) code to remember the case
when it looked past a trunc.
Modified:
llvm/branches/release_27/ (props changed)
llvm/branches/release_27/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/branches/release_27/test/CodeGen/X86/crash.ll
Propchange: llvm/branches/release_27/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Mar 11 17:57:44 2010
@@ -1 +1 @@
-/llvm/trunk:98193
+/llvm/trunk:98193,98203
Modified: llvm/branches/release_27/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_27/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=98306&r1=98305&r2=98306&view=diff
==============================================================================
--- llvm/branches/release_27/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/branches/release_27/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Thu Mar 11 17:57:44 2010
@@ -4605,7 +4605,7 @@
SDNode *Trunc = 0;
if (N1.getOpcode() == ISD::TRUNCATE && N1.hasOneUse()) {
- // Look pass truncate.
+ // Look past truncate.
Trunc = N1.getNode();
N1 = N1.getOperand(0);
}
@@ -4700,7 +4700,9 @@
Equal = true;
}
- EVT SetCCVT = N1.getValueType();
+ SDValue NodeToReplace = Trunc ? SDValue(Trunc, 0) : N1;
+
+ EVT SetCCVT = NodeToReplace.getValueType();
if (LegalTypes)
SetCCVT = TLI.getSetCCResultType(SetCCVT);
SDValue SetCC = DAG.getSetCC(TheXor->getDebugLoc(),
@@ -4709,9 +4711,9 @@
Equal ? ISD::SETEQ : ISD::SETNE);
// Replace the uses of XOR with SETCC
WorkListRemover DeadNodes(*this);
- DAG.ReplaceAllUsesOfValueWith(N1, SetCC, &DeadNodes);
- removeFromWorkList(N1.getNode());
- DAG.DeleteNode(N1.getNode());
+ DAG.ReplaceAllUsesOfValueWith(NodeToReplace, SetCC, &DeadNodes);
+ removeFromWorkList(NodeToReplace.getNode());
+ DAG.DeleteNode(NodeToReplace.getNode());
return DAG.getNode(ISD::BRCOND, N->getDebugLoc(),
MVT::Other, Chain, SetCC, N2);
}
Modified: llvm/branches/release_27/test/CodeGen/X86/crash.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_27/test/CodeGen/X86/crash.ll?rev=98306&r1=98305&r2=98306&view=diff
==============================================================================
--- llvm/branches/release_27/test/CodeGen/X86/crash.ll (original)
+++ llvm/branches/release_27/test/CodeGen/X86/crash.ll Thu Mar 11 17:57:44 2010
@@ -18,3 +18,18 @@
volatile store i32 %conv19.i, i32* undef
ret i32 undef
}
+
+; PR6533
+define void @test2(i1 %x, i32 %y) nounwind {
+ %land.ext = zext i1 %x to i32 ; <i32> [#uses=1]
+ %and = and i32 %y, 1 ; <i32> [#uses=1]
+ %xor = xor i32 %and, %land.ext ; <i32> [#uses=1]
+ %cmp = icmp eq i32 %xor, 1 ; <i1> [#uses=1]
+ br i1 %cmp, label %if.end, label %if.then
+
+if.then: ; preds = %land.end
+ ret void
+
+if.end: ; preds = %land.end
+ ret void
+}
More information about the llvm-branch-commits
mailing list