[llvm] r266551 - Fix a typo in rL265762
Sanjoy Das via llvm-commits
llvm-commits at lists.llvm.org
Sat Apr 16 21:30:43 PDT 2016
Author: sanjoy
Date: Sat Apr 16 23:30:43 2016
New Revision: 266551
URL: http://llvm.org/viewvc/llvm-project?rev=266551&view=rev
Log:
Fix a typo in rL265762
I accidentally replaced `mayBeOverridden` with `!isInterposable`.
Remove the negation and add a test case that would've caught this.
Many thanks to HÃ¥kan Hjort for spotting this!
Modified:
llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
llvm/trunk/test/Transforms/InstCombine/mem-gep-zidx.ll
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp?rev=266551&r1=266550&r2=266551&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp Sat Apr 16 23:30:43 2016
@@ -640,7 +640,7 @@ static bool isObjectSizeLessThanOrEq(Val
}
if (GlobalAlias *GA = dyn_cast<GlobalAlias>(P)) {
- if (!GA->isInterposable())
+ if (GA->isInterposable())
return false;
Worklist.push_back(GA->getAliasee());
continue;
Modified: llvm/trunk/test/Transforms/InstCombine/mem-gep-zidx.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/mem-gep-zidx.ll?rev=266551&r1=266550&r2=266551&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/mem-gep-zidx.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/mem-gep-zidx.ll Sat Apr 16 23:30:43 2016
@@ -4,6 +4,7 @@ target triple = "powerpc64-unknown-linux
@f.a = private unnamed_addr constant [1 x i32] [i32 12], align 4
@f.b = private unnamed_addr constant [1 x i32] [i32 55], align 4
+ at f.c = linkonce unnamed_addr alias [1 x i32], [1 x i32]* @f.b
define signext i32 @test1(i32 signext %x) #0 {
entry:
@@ -44,5 +45,16 @@ entry:
; CHECK: getelementptr inbounds [1 x i32], [1 x i32]* %p, i64 0, i64 0
}
+define signext i32 @test4(i32 signext %x, i1 %y) #0 {
+entry:
+ %idxprom = sext i32 %x to i64
+ %arrayidx = getelementptr inbounds [1 x i32], [1 x i32]* @f.c, i64 0, i64 %idxprom
+ %0 = load i32, i32* %arrayidx, align 4
+ ret i32 %0
+
+; CHECK-LABEL: @test4
+; CHECK: getelementptr inbounds [1 x i32], [1 x i32]* @f.c, i64 0, i64 %idxprom
+}
+
attributes #0 = { nounwind readnone }
More information about the llvm-commits
mailing list