[llvm-branch-commits] [llvm-branch] r90556 - in /llvm/branches/Apple/Zoidberg: lib/Analysis/ConstantFolding.cpp test/Transforms/ConstProp/loads.ll
Bill Wendling
isanbard at gmail.com
Thu Dec 3 23:53:05 PST 2009
Author: void
Date: Fri Dec 4 01:53:05 2009
New Revision: 90556
URL: http://llvm.org/viewvc/llvm-project?rev=90556&view=rev
Log:
$ svn merge -c 90545 https://llvm.org/svn/llvm-project/llvm/trunk
--- Merging r90545 into '.':
U test/Transforms/ConstProp/loads.ll
U lib/Analysis/ConstantFolding.cpp
Modified:
llvm/branches/Apple/Zoidberg/lib/Analysis/ConstantFolding.cpp
llvm/branches/Apple/Zoidberg/test/Transforms/ConstProp/loads.ll
Modified: llvm/branches/Apple/Zoidberg/lib/Analysis/ConstantFolding.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Zoidberg/lib/Analysis/ConstantFolding.cpp?rev=90556&r1=90555&r2=90556&view=diff
==============================================================================
--- llvm/branches/Apple/Zoidberg/lib/Analysis/ConstantFolding.cpp (original)
+++ llvm/branches/Apple/Zoidberg/lib/Analysis/ConstantFolding.cpp Fri Dec 4 01:53:05 2009
@@ -432,7 +432,7 @@
// Instead of loading constant c string, use corresponding integer value
// directly if string length is small enough.
std::string Str;
- if (TD && GetConstantStringInfo(CE->getOperand(0), Str) && !Str.empty()) {
+ if (TD && GetConstantStringInfo(CE, Str) && !Str.empty()) {
unsigned StrLen = Str.length();
const Type *Ty = cast<PointerType>(CE->getType())->getElementType();
unsigned NumBits = Ty->getPrimitiveSizeInBits();
Modified: llvm/branches/Apple/Zoidberg/test/Transforms/ConstProp/loads.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Zoidberg/test/Transforms/ConstProp/loads.ll?rev=90556&r1=90555&r2=90556&view=diff
==============================================================================
--- llvm/branches/Apple/Zoidberg/test/Transforms/ConstProp/loads.ll (original)
+++ llvm/branches/Apple/Zoidberg/test/Transforms/ConstProp/loads.ll Fri Dec 4 01:53:05 2009
@@ -101,3 +101,12 @@
}
+; PR5551
+ at test12g = private constant [6 x i8] c"a\00b\00\00\00"
+
+define i16 @test12() {
+ %a = load i16* getelementptr inbounds ([3 x i16]* bitcast ([6 x i8]* @test12g to [3 x i16]*), i32 0, i64 1)
+ ret i16 %a
+; CHECK: @test12
+; CHECK: ret i16 98
+}
More information about the llvm-branch-commits
mailing list