summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2016-08-08 04:10:22 +0000
committerEli Friedman <eli.friedman@gmail.com>2016-08-08 04:10:22 +0000
commit02419a98499704e98236cda2e9b1b3c996ad4908 (patch)
treef9c507ee5717bd9a24076682962c5fac36b7c944 /llvm/lib/Transforms/InstCombine
parentd931b9f20060ce3751614e889fa4629db13e9e66 (diff)
downloadbcm5719-llvm-02419a98499704e98236cda2e9b1b3c996ad4908.tar.gz
bcm5719-llvm-02419a98499704e98236cda2e9b1b3c996ad4908.zip
[JumpThreading] Fix handling of aliasing metadata.
Summary: The correctness fix here is that when we CSE a load with another load, we need to combine the metadata on the two loads. This matches the behavior of other passes, like instcombine and GVN. There's also a minor optimization improvement here: for load PRE, the aliasing metadata on the inserted load should be the same as the metadata on the original load. Not sure why the old code was throwing it away. Issue found by inspection. Differential Revision: http://reviews.llvm.org/D21460 llvm-svn: 277977
Diffstat (limited to 'llvm/lib/Transforms/InstCombine')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
index 8dcc6351ac7..19145768e5e 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
@@ -819,11 +819,10 @@ Instruction *InstCombiner::visitLoadInst(LoadInst &LI) {
// where there are several consecutive memory accesses to the same location,
// separated by a few arithmetic operations.
BasicBlock::iterator BBI(LI);
- AAMDNodes AATags;
bool IsLoadCSE = false;
if (Value *AvailableVal =
FindAvailableLoadedValue(&LI, LI.getParent(), BBI,
- DefMaxInstsToScan, AA, &AATags, &IsLoadCSE)) {
+ DefMaxInstsToScan, AA, &IsLoadCSE)) {
if (IsLoadCSE) {
LoadInst *NLI = cast<LoadInst>(AvailableVal);
unsigned KnownIDs[] = {
OpenPOWER on IntegriCloud