From 2ecdf36fb1456dd69354966c2ce86e6f6d6294c6 Mon Sep 17 00:00:00 2001 From: Philip Reames Date: Thu, 14 Feb 2019 20:48:36 +0000 Subject: [PATCH] [InstCombine] Add todos for possible atomicrmw transforms git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354059 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/InstCombine/InstCombineAtomicRMW.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/Transforms/InstCombine/InstCombineAtomicRMW.cpp b/lib/Transforms/InstCombine/InstCombineAtomicRMW.cpp index b607c6dd608..37c43977d90 100644 --- a/lib/Transforms/InstCombine/InstCombineAtomicRMW.cpp +++ b/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; -- 2.50.1