diff options
author | Philip Reames <listmail@philipreames.com> | 2016-04-21 17:03:33 +0000 |
---|---|---|
committer | Philip Reames <listmail@philipreames.com> | 2016-04-21 17:03:33 +0000 |
commit | ac55090e96787a31bfdb9ffa1fb8d0760f666db7 (patch) | |
tree | 1a92985aba069433d5ae36a2fa73e33cb057a043 /llvm/lib/Transforms | |
parent | 34b335bdf7bdcd4e7dec8d3915a704fed6adcd62 (diff) | |
download | bcm5719-llvm-ac55090e96787a31bfdb9ffa1fb8d0760f666db7.tar.gz bcm5719-llvm-ac55090e96787a31bfdb9ffa1fb8d0760f666db7.zip |
[instcombine][unordered] Implement *-load forwarding for unordered atomics
This builds on 266999 which made FindAvailableValue do the right thing. Tests included show the newly enabled transforms and those which disabled either due to conservatism or correctness requirements.
llvm-svn: 267006
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp index c8556638cec..fc3de6b49f3 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp @@ -809,10 +809,6 @@ Instruction *InstCombiner::visitLoadInst(LoadInst &LI) { return &LI; } - // None of the following transforms are legal for volatile/atomic loads. - // FIXME: Some of it is okay for atomic loads; needs refactoring. - if (!LI.isSimple()) return nullptr; - if (Instruction *Res = unpackLoadToAggregate(*this, LI)) return Res; @@ -840,6 +836,10 @@ Instruction *InstCombiner::visitLoadInst(LoadInst &LI) { LI.getName() + ".cast")); } + // None of the following transforms are legal for volatile/atomic loads. + // FIXME: Some of it is okay for atomic loads; needs refactoring. + if (!LI.isSimple()) return nullptr; + // load(gep null, ...) -> unreachable if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(Op)) { const Value *GEPI0 = GEPI->getOperand(0); |