diff options
author | Quentin Colombet <quentin.colombet@gmail.com> | 2019-02-07 21:27:23 +0000 |
---|---|---|
committer | Quentin Colombet <quentin.colombet@gmail.com> | 2019-02-07 21:27:23 +0000 |
commit | 96f54de8ff5d357fadcf474823f70288561923bf (patch) | |
tree | 5f458880c0e8823862215080eafd91f82ce0447e /llvm/lib/Transforms/InstCombine/InstCombineInternal.h | |
parent | 82bf8e82c96b79fcafea5d0026feab24a270e9af (diff) | |
download | bcm5719-llvm-96f54de8ff5d357fadcf474823f70288561923bf.tar.gz bcm5719-llvm-96f54de8ff5d357fadcf474823f70288561923bf.zip |
[InstCombine] Optimize `atomicrmw <op>, 0` into `load atomic` when possible
This commit teaches InstCombine how to replace an atomicrmw operation
into a simple load atomic.
For a given `atomicrmw <op>`, this is possible when:
1. The ordering of that operation is compatible with a load (i.e.,
anything that doesn't have a release semantic).
2. <op> does not modify the value being stored
Differential Revision: https://reviews.llvm.org/D57854
llvm-svn: 353471
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineInternal.h')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineInternal.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineInternal.h b/llvm/lib/Transforms/InstCombine/InstCombineInternal.h index 11993a46323..951e0e72e9e 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineInternal.h +++ b/llvm/lib/Transforms/InstCombine/InstCombineInternal.h @@ -401,6 +401,7 @@ public: Instruction *visitFree(CallInst &FI); Instruction *visitLoadInst(LoadInst &LI); Instruction *visitStoreInst(StoreInst &SI); + Instruction *visitAtomicRMWInst(AtomicRMWInst &SI); Instruction *visitBranchInst(BranchInst &BI); Instruction *visitFenceInst(FenceInst &FI); Instruction *visitSwitchInst(SwitchInst &SI); |