OSDN Git Service

[InstCombine] Extend "idempotent" atomicrmw optimizations to floating point
authorPhilip Reames <listmail@philipreames.com>
Fri, 1 Mar 2019 18:00:07 +0000 (18:00 +0000)
committerPhilip Reames <listmail@philipreames.com>
Fri, 1 Mar 2019 18:00:07 +0000 (18:00 +0000)
commite7dd324dafa0d585e975141c2502649ca411c870
tree2ac1e4e9b13d57ed9cadddaf82616c05b1fb3a6a
parenteb716ca2564092f3c9bd3b8a394b45da414370a7
[InstCombine] Extend "idempotent" atomicrmw optimizations to floating point

An idempotent atomicrmw is one that does not change memory in the process of execution.  We have already added handling for the various integer operations; this patch extends the same handling to floating point operations which were recently added to IR.

Note: At the moment, we canonicalize idempotent fsub to fadd when ordering requirements prevent us from using a load.  As discussed in the review, I will be replacing this with canonicalizing both floating point ops to integer ops in the near future.

Differential Revision: https://reviews.llvm.org/D58251

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355210 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineAtomicRMW.cpp
test/Transforms/InstCombine/atomicrmw.ll