[llvm-commits] [llvm] r68083 - in /llvm/trunk: lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp test/CodeGen/X86/live-out-reg-info.ll
Dan Gohman
gohman at apple.com
Mon Mar 30 18:38:29 PDT 2009
Author: djg
Date: Mon Mar 30 20:38:29 2009
New Revision: 68083
URL: http://llvm.org/viewvc/llvm-project?rev=68083&view=rev
Log:
Fix live-out reg logic to not insert over-aggressive AssertZExt
instructions. This fixes lua.
Added:
llvm/trunk/test/CodeGen/X86/live-out-reg-info.ll
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=68083&r1=68082&r2=68083&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Mon Mar 30 20:38:29 2009
@@ -4587,15 +4587,15 @@
isSExt = false, FromVT = MVT::i1; // ASSERT ZEXT 1
else if (NumSignBits > RegSize-8)
isSExt = true, FromVT = MVT::i8; // ASSERT SEXT 8
- else if (NumZeroBits >= RegSize-9)
+ else if (NumZeroBits >= RegSize-8)
isSExt = false, FromVT = MVT::i8; // ASSERT ZEXT 8
else if (NumSignBits > RegSize-16)
isSExt = true, FromVT = MVT::i16; // ASSERT SEXT 16
- else if (NumZeroBits >= RegSize-17)
+ else if (NumZeroBits >= RegSize-16)
isSExt = false, FromVT = MVT::i16; // ASSERT ZEXT 16
else if (NumSignBits > RegSize-32)
isSExt = true, FromVT = MVT::i32; // ASSERT SEXT 32
- else if (NumZeroBits >= RegSize-33)
+ else if (NumZeroBits >= RegSize-32)
isSExt = false, FromVT = MVT::i32; // ASSERT ZEXT 32
if (FromVT != MVT::Other) {
Added: llvm/trunk/test/CodeGen/X86/live-out-reg-info.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/live-out-reg-info.ll?rev=68083&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/live-out-reg-info.ll (added)
+++ llvm/trunk/test/CodeGen/X86/live-out-reg-info.ll Mon Mar 30 20:38:29 2009
@@ -0,0 +1,20 @@
+; RUN: llvm-as < %s | llc -march=x86-64 | grep testl
+
+; Make sure dagcombine doesn't eliminate the comparison due
+; to an off-by-one bug with ComputeMaskedBits information.
+
+declare void @qux()
+
+define void @foo(i32 %a) {
+ %t0 = lshr i32 %a, 23
+ br label %next
+next:
+ %t1 = and i32 %t0, 256
+ %t2 = icmp eq i32 %t1, 0
+ br i1 %t2, label %true, label %false
+true:
+ call void @qux()
+ ret void
+false:
+ ret void
+}
More information about the llvm-commits
mailing list