Currently for atomic load, store, and rmw instructions, as long as the
operand is floating-point value, they are casted to integer. Nowadays many
targets can actually support part of atomic operations with floating-point
operands. For example, NVPTX supports atomic load and store of floating-point
values. This patch adds a series interface functions shouldCastAtomicXXXInIR,
and the default implementations are same as what we currently do. Later for
targets can have their specialization.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
llvm/include/llvm/CodeGen/TargetLowering.h | ||
---|---|---|
2052 | Sounds like a good idea. I'll do it in another patch. |
As somewhat coincidentally just discussed in the thread on https://reviews.llvm.org/D124728 the target hooks don't really make sense as implemented here.
Whether a cast to an integer is required is due in part to what code AtomicExpandPass itself generates (configured based upon existing target hooks), and whether _that_ expansion requires the value to be an integer (almost all of them currently do). Requiring targets to deduce those requirements and encode it into a brand new target hook seems error-prone, and should be avoided.
just cast. It's an irregular verb.