From: Philip Reames Date: Thu, 14 Feb 2019 20:48:36 +0000 (+0000) Subject: [InstCombine] Add todos for possible atomicrmw transforms X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=db57ef62382cfe50d7bd4d038aa54e3a98abae1d;p=platform%2Fupstream%2Fllvm.git [InstCombine] Add todos for possible atomicrmw transforms llvm-svn: 354059 --- diff --git a/llvm/lib/Transforms/InstCombine/InstCombineAtomicRMW.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAtomicRMW.cpp index b607c6d..37c4397 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineAtomicRMW.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineAtomicRMW.cpp @@ -51,6 +51,12 @@ bool isIdempotentRMW(AtomicRMWInst& RMWI) { Instruction *InstCombiner::visitAtomicRMWInst(AtomicRMWInst &RMWI) { + // TODO: Any atomicrmw op which produces a known result in memory can be + // replaced w/an atomicrmw xchg. (see getBinOpAbsorber) + + // TODO: Any atomicrmw xchg with no uses can be converted to a atomic store + // if the ordering is compatible. + if (!isIdempotentRMW(RMWI)) return nullptr;