Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(349)

Unified Diff: lib/Transforms/NaCl/ExpandInsertExtractElement.cpp

Issue 1151093004: Changes from 3.7 merge to files not in upstream (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-llvm.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: lib/Transforms/NaCl/ExpandInsertExtractElement.cpp
diff --git a/lib/Transforms/NaCl/ExpandInsertExtractElement.cpp b/lib/Transforms/NaCl/ExpandInsertExtractElement.cpp
index 6734f6f84278450f50e05a754216371f08bc2876..5d974fc3ccd1c701b20a5e7546ca79d25d39a346 100644
--- a/lib/Transforms/NaCl/ExpandInsertExtractElement.cpp
+++ b/lib/Transforms/NaCl/ExpandInsertExtractElement.cpp
@@ -68,11 +68,13 @@ bool ExpandInsertExtractElement::runOnFunction(Function &F) {
if (isa<ConstantInt>(III->getOperand(2)))
continue;
- Instruction *A = new AllocaInst(III->getType(), 0, "", Entry);
+ Type *AllocaTy = III->getType();
+ Instruction *A = new AllocaInst(AllocaTy, 0, "", Entry);
CopyDebug(new StoreInst(III->getOperand(0), A, III), III);
Value *Idxs[] = { Zero, III->getOperand(2) };
- Instruction *B = CopyDebug(GetElementPtrInst::Create(A, Idxs, "", III), III);
+ Instruction *B = CopyDebug(
+ GetElementPtrInst::Create(AllocaTy, A, Idxs, "", III), III);
CopyDebug(new StoreInst(III->getOperand(1), B, III), III);
Instruction *L = CopyDebug(new LoadInst(A, "", III), III);
@@ -82,11 +84,13 @@ bool ExpandInsertExtractElement::runOnFunction(Function &F) {
if (isa<ConstantInt>(EII->getOperand(1)))
continue;
- Instruction *A = new AllocaInst(EII->getOperand(0)->getType(), 0, "", Entry);
+ Type *AllocaTy = EII->getOperand(0)->getType();
+ Instruction *A = new AllocaInst(AllocaTy, 0, "", Entry);
CopyDebug(new StoreInst(EII->getOperand(0), A, EII), EII);
Value *Idxs[] = { Zero, EII->getOperand(1) };
- Instruction *B = CopyDebug(GetElementPtrInst::Create(A, Idxs, "", EII), EII);
+ Instruction *B = CopyDebug(
+ GetElementPtrInst::Create(AllocaTy, A, Idxs, "", EII), EII);
Instruction *L = CopyDebug(new LoadInst(B, "", EII), EII);
EII->replaceAllUsesWith(L);
EII->eraseFromParent();

Powered by Google App Engine
This is Rietveld 408576698