[llvm-branch-commits] [llvm-branch] r99289 - in /llvm/branches/release_27: ./ lib/Analysis/ValueTracking.cpp test/Transforms/InstCombine/shift-sra.ll
Tanya Lattner
tonic at nondot.org
Tue Mar 23 09:58:02 PDT 2010
Author: tbrethou
Date: Tue Mar 23 11:58:02 2010
New Revision: 99289
URL: http://llvm.org/viewvc/llvm-project?rev=99289&view=rev
Log:
Merge r98416 from mainline.
Fix a typo in ValueTracking that's causing instcombine to delete needed shift instructions.
Modified:
llvm/branches/release_27/ (props changed)
llvm/branches/release_27/lib/Analysis/ValueTracking.cpp
llvm/branches/release_27/test/Transforms/InstCombine/shift-sra.ll
Propchange: llvm/branches/release_27/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar 23 11:58:02 2010
@@ -1 +1 @@
-/llvm/trunk:97965,97974,97980,98171,98193,98203,98205,98212
+/llvm/trunk:97965,97974,97980,98171,98193,98203,98205,98212,98416
Modified: llvm/branches/release_27/lib/Analysis/ValueTracking.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_27/lib/Analysis/ValueTracking.cpp?rev=99289&r1=99288&r2=99289&view=diff
==============================================================================
--- llvm/branches/release_27/lib/Analysis/ValueTracking.cpp (original)
+++ llvm/branches/release_27/lib/Analysis/ValueTracking.cpp Tue Mar 23 11:58:02 2010
@@ -779,7 +779,7 @@
for (unsigned i = 1, e = PN->getNumIncomingValues(); i != e; ++i) {
if (Tmp == 1) return Tmp;
Tmp = std::min(Tmp,
- ComputeNumSignBits(PN->getIncomingValue(1), TD, Depth+1));
+ ComputeNumSignBits(PN->getIncomingValue(i), TD, Depth+1));
}
return Tmp;
}
Modified: llvm/branches/release_27/test/Transforms/InstCombine/shift-sra.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_27/test/Transforms/InstCombine/shift-sra.ll?rev=99289&r1=99288&r2=99289&view=diff
==============================================================================
--- llvm/branches/release_27/test/Transforms/InstCombine/shift-sra.ll (original)
+++ llvm/branches/release_27/test/Transforms/InstCombine/shift-sra.ll Tue Mar 23 11:58:02 2010
@@ -56,3 +56,23 @@
; CHECK: %P = phi i64
; CHECK-NEXT: ret i64 %P
}
+
+; rdar://7732987
+define i32 @test5(i32 %Y) {
+ br i1 undef, label %A, label %C
+A:
+ br i1 undef, label %B, label %D
+B:
+ br label %D
+C:
+ br i1 undef, label %D, label %E
+D:
+ %P = phi i32 [0, %A], [0, %B], [%Y, %C]
+ %S = ashr i32 %P, 16
+ ret i32 %S
+; CHECK: @test5
+; CHECK: %P = phi i32
+; CHECK-NEXT: ashr i32 %P, 16
+E:
+ ret i32 0
+}
More information about the llvm-branch-commits
mailing list