[llvm-commits] [llvm] r131274 - in /llvm/trunk: lib/CodeGen/SelectionDAG/LegalizeDAG.cpp test/CodeGen/Thumb2/thumb2-cbnz.ll
Stuart Hastings
stuart at apple.com
Thu May 12 17:51:54 PDT 2011
Author: stuart
Date: Thu May 12 19:51:54 2011
New Revision: 131274
URL: http://llvm.org/viewvc/llvm-project?rev=131274&view=rev
Log:
Since I can't reproduce the failures from 131261, re-trying with a
simplified version. <rdar://problem/9298790>
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
llvm/trunk/test/CodeGen/Thumb2/thumb2-cbnz.ll
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=131274&r1=131273&r2=131274&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Thu May 12 19:51:54 2011
@@ -3535,9 +3535,13 @@
Tmp2.getOperand(0), Tmp2.getOperand(1),
Node->getOperand(2));
} else {
+ // We test only the i1 bit. Skip the AND if UNDEF.
+ Tmp3 = (Tmp2.getOpcode() == ISD::UNDEF) ? Tmp2 :
+ DAG.getNode(ISD::AND, dl, Tmp2.getValueType(), Tmp2,
+ DAG.getConstant(1, Tmp2.getValueType()));
Tmp1 = DAG.getNode(ISD::BR_CC, dl, MVT::Other, Tmp1,
- DAG.getCondCode(ISD::SETNE), Tmp2,
- DAG.getConstant(0, Tmp2.getValueType()),
+ DAG.getCondCode(ISD::SETNE), Tmp3,
+ DAG.getConstant(0, Tmp3.getValueType()),
Node->getOperand(2));
}
Results.push_back(Tmp1);
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-cbnz.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-cbnz.ll?rev=131274&r1=131273&r2=131274&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-cbnz.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-cbnz.ll Thu May 12 19:51:54 2011
@@ -3,26 +3,29 @@
declare double @floor(double) nounwind readnone
-define void @t(i1 %a, double %b) {
+define void @t(i32 %c, double %b) {
entry:
- br i1 %a, label %bb3, label %bb1
+ %cmp1 = icmp ne i32 %c, 0
+ br i1 %cmp1, label %bb3, label %bb1
bb1: ; preds = %entry
unreachable
bb3: ; preds = %entry
- br i1 %a, label %bb7, label %bb5
+ %cmp2 = icmp ne i32 %c, 0
+ br i1 %cmp2, label %bb7, label %bb5
bb5: ; preds = %bb3
unreachable
bb7: ; preds = %bb3
- br i1 %a, label %bb11, label %bb9
+ %cmp3 = icmp ne i32 %c, 0
+ br i1 %cmp3, label %bb11, label %bb9
bb9: ; preds = %bb7
-; CHECK: cmp r0, #0
-; CHECK: cmp r0, #0
-; CHECK-NEXT: cbnz
+; CHECK: cmp r0, #0
+; CHECK: cmp r0, #0
+; CHECK-NEXT: cbnz
%0 = tail call double @floor(double %b) nounwind readnone ; <double> [#uses=0]
br label %bb11
More information about the llvm-commits
mailing list