aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-10-17 23:51:13 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-10-17 23:51:13 +0000
commitafa222c8950a79a6e38a68c095ce1c547773501b (patch)
tree9f2d2fc471791a88f793b5ffba9d387da0852da3 /lib
parentd9417188f3d61e17c2fa7ee789ac04a3226aafa1 (diff)
downloadexternal_llvm-afa222c8950a79a6e38a68c095ce1c547773501b.zip
external_llvm-afa222c8950a79a6e38a68c095ce1c547773501b.tar.gz
external_llvm-afa222c8950a79a6e38a68c095ce1c547773501b.tar.bz2
Reverting r43070 for now. It's causing llc test failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43103 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp25
1 files changed, 0 insertions, 25 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 649dd46..29223da 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -7686,8 +7686,6 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) {
Value *Dest = InsertCastBefore(Instruction::BitCast, CI.getOperand(1), NewPtrTy, CI);
Value *L = new LoadInst(Src, "tmp", false, Align, &CI);
Value *NS = new StoreInst(L, Dest, false, Align, &CI);
- AddToWorkList(cast<Instruction>(L));
- AddToWorkList(cast<Instruction>(NS));
CI.replaceAllUsesWith(NS);
Changed = true;
return EraseInstFromFunction(CI);
@@ -9116,29 +9114,6 @@ Instruction *InstCombiner::visitLoadInst(LoadInst &LI) {
}
} else if (CE->isCast()) {
- // Instead of loading constant c string, use corresponding integer value
- // directly if string length is small enough.
- const std::string &Str = CE->getOperand(0)->getStringValue();
- if (!Str.empty()) {
- unsigned len = Str.length();
- const Type *Ty = cast<PointerType>(CE->getType())->getElementType();
- unsigned numBits = Ty->getPrimitiveSizeInBits();
- if ((numBits >> 3) == len + 1) {
- // Replace LI with immediate integer store.
- APInt StrVal(numBits, 0);
- APInt SingleChar(numBits, 0);
- for (unsigned i = 0; i < len; i++) {
- SingleChar = (uint64_t) Str[i];
- StrVal = (StrVal << 8) | SingleChar;
- }
- // Append NULL at the end.
- SingleChar = 0;
- StrVal = (StrVal << 8) | SingleChar;
- Value *NL = ConstantInt::get(StrVal);
- return ReplaceInstUsesWith(LI, NL);
- }
- }
-
if (Instruction *Res = InstCombineLoadCast(*this, LI))
return Res;
}