[llvm-branch-commits] [llvm-branch] r79083 - in /llvm/branches/Apple/Bender-SWB: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/vec_extract_elt2.ll
Bill Wendling
isanbard at gmail.com
Sat Aug 15 00:02:12 PDT 2009
Author: void
Date: Sat Aug 15 02:02:12 2009
New Revision: 79083
URL: http://llvm.org/viewvc/llvm-project?rev=79083&view=rev
Log:
$ svn merge -c 78891 https://llvm.org/svn/llvm-project/llvm/trunk
--- Merging r78891 into '.':
A test/Transforms/InstCombine/vec_extract_elt2.ll
U lib/Transforms/Scalar/InstructionCombining.cpp
Added:
llvm/branches/Apple/Bender-SWB/test/Transforms/InstCombine/vec_extract_elt2.ll
- copied unchanged from r78891, llvm/trunk/test/Transforms/InstCombine/vec_extract_elt2.ll
Modified:
llvm/branches/Apple/Bender-SWB/lib/Transforms/Scalar/InstructionCombining.cpp
Modified: llvm/branches/Apple/Bender-SWB/lib/Transforms/Scalar/InstructionCombining.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Bender-SWB/lib/Transforms/Scalar/InstructionCombining.cpp?rev=79083&r1=79082&r2=79083&view=diff
==============================================================================
--- llvm/branches/Apple/Bender-SWB/lib/Transforms/Scalar/InstructionCombining.cpp (original)
+++ llvm/branches/Apple/Bender-SWB/lib/Transforms/Scalar/InstructionCombining.cpp Sat Aug 15 02:02:12 2009
@@ -12231,11 +12231,13 @@
unsigned AS =
cast<PointerType>(I->getOperand(0)->getType())->getAddressSpace();
Value *Ptr = InsertBitCastBefore(I->getOperand(0),
- PointerType::get(EI.getType(), AS),EI);
+ PointerType::get(EI.getType(), AS),*I);
GetElementPtrInst *GEP =
GetElementPtrInst::Create(Ptr, EI.getOperand(1), I->getName()+".gep");
- InsertNewInstBefore(GEP, EI);
- return new LoadInst(GEP);
+ InsertNewInstBefore(GEP, *I);
+ LoadInst* Load = new LoadInst(GEP, "tmp");
+ InsertNewInstBefore(Load, *I);
+ return ReplaceInstUsesWith(EI, Load);
}
}
if (InsertElementInst *IE = dyn_cast<InsertElementInst>(I)) {
More information about the llvm-branch-commits
mailing list