diff options
author | Dan Gohman <gohman@apple.com> | 2010-10-25 16:16:27 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-10-25 16:16:27 +0000 |
commit | 2e20dfb0f27f7d213c2c99683d21b3783a3f8424 (patch) | |
tree | 440b3c68d72377e2db2885ce9c268729f4abffdc /llvm/lib/Transforms | |
parent | 22fe18625de76e06edbd0c329949cb064dddf1ff (diff) | |
download | bcm5719-llvm-2e20dfb0f27f7d213c2c99683d21b3783a3f8424.tar.gz bcm5719-llvm-2e20dfb0f27f7d213c2c99683d21b3783a3f8424.zip |
Fix a case where instcombine was stripping metadata (and alignment)
from stores when folding in bitcasts.
llvm-svn: 117265
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp index b68fbc2db5c..992a5d9f6b4 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp @@ -330,7 +330,9 @@ static Instruction *InstCombineStoreToCast(InstCombiner &IC, StoreInst &SI) { NewCast = IC.Builder->CreateCast(opcode, SIOp0, CastDstTy, SIOp0->getName()+".c"); - return new StoreInst(NewCast, CastOp); + SI.setOperand(0, NewCast); + SI.setOperand(1, CastOp); + return &SI; } /// equivalentAddressValues - Test if A and B will obviously have the same |