[llvm] [Attributor] Add support for atomic operations in `AAAddressSpace` (PR #106927)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 3 21:38:02 PDT 2024
================
@@ -12583,10 +12583,14 @@ struct AAAddressSpaceImpl : public AAAddressSpace {
return true;
if (isa<LoadInst>(Inst))
MakeChange(Inst, const_cast<Use &>(U));
- if (isa<StoreInst>(Inst)) {
+ else if (isa<StoreInst>(Inst)) {
// We only make changes if the use is the pointer operand.
if (U.getOperandNo() == 1)
MakeChange(Inst, const_cast<Use &>(U));
+ } else if (isa<AtomicRMWInst>(Inst) || isa<AtomicCmpXchgInst>(Inst)) {
+ // We only make changes if the use is the pointer operand.
+ if (U.getOperandNo() == 0)
----------------
arsenm wrote:
Hardcoding the pointer operand index, use the AtoimcRMWInst::getPointerOperandIndex
https://github.com/llvm/llvm-project/pull/106927
More information about the llvm-commits
mailing list