[llvm-branch-commits] [llvm-branch] r82267 - in /llvm/branches/Apple/Fry: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/vec_extract_elt2.ll

Bill Wendling isanbard at gmail.com
Fri Sep 18 13:15:50 PDT 2009


Author: void
Date: Fri Sep 18 15:15:50 2009
New Revision: 82267

URL: http://llvm.org/viewvc/llvm-project?rev=82267&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/Fry/test/Transforms/InstCombine/vec_extract_elt2.ll
      - copied unchanged from r78891, llvm/trunk/test/Transforms/InstCombine/vec_extract_elt2.ll
Modified:
    llvm/branches/Apple/Fry/lib/Transforms/Scalar/InstructionCombining.cpp

Modified: llvm/branches/Apple/Fry/lib/Transforms/Scalar/InstructionCombining.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Fry/lib/Transforms/Scalar/InstructionCombining.cpp?rev=82267&r1=82266&r2=82267&view=diff

==============================================================================
--- llvm/branches/Apple/Fry/lib/Transforms/Scalar/InstructionCombining.cpp (original)
+++ llvm/branches/Apple/Fry/lib/Transforms/Scalar/InstructionCombining.cpp Fri Sep 18 15:15:50 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