summaryrefslogtreecommitdiff
path: root/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-10-25 16:16:27 +0000
committerDan Gohman <gohman@apple.com>2010-10-25 16:16:27 +0000
commit17a0bf996fb61cdd43cec2cfc7db53145bbc767a (patch)
tree6deb2f1f4f5db868cee7f727e07af111a5cd3b99 /lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
parent970bfcc7d8b9991430caa7ab33975617f3f4c40d (diff)
downloadllvm-17a0bf996fb61cdd43cec2cfc7db53145bbc767a.tar.gz
llvm-17a0bf996fb61cdd43cec2cfc7db53145bbc767a.tar.bz2
llvm-17a0bf996fb61cdd43cec2cfc7db53145bbc767a.tar.xz
Fix a case where instcombine was stripping metadata (and alignment)
from stores when folding in bitcasts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117265 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp')
-rw-r--r--lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
index b68fbc2db5..992a5d9f6b 100644
--- a/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
+++ b/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