From 96f54de8ff5d357fadcf474823f70288561923bf Mon Sep 17 00:00:00 2001 From: Quentin Colombet Date: Thu, 7 Feb 2019 21:27:23 +0000 Subject: [InstCombine] Optimize `atomicrmw , 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 `, 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. does not modify the value being stored Differential Revision: https://reviews.llvm.org/D57854 llvm-svn: 353471 --- llvm/lib/Transforms/InstCombine/InstCombineInternal.h | 1 + 1 file changed, 1 insertion(+) (limited to 'llvm/lib/Transforms/InstCombine/InstCombineInternal.h') 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); -- cgit v1.2.3