[llvm] [NFC][TargetLowering] Make shouldExpandAtomicRMWInIR and shouldExpandAtomicCmpXchgInIR take a const Instruction pointer (PR #176073)
Alex MacLean via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 15 08:36:38 PST 2026
================
@@ -32282,7 +32211,7 @@ void X86TargetLowering::emitBitTestAtomicRMWIntrinsic(AtomicRMWInst *AI) const {
} else {
assert(BitTested.second == ShiftBit || BitTested.second == NotShiftBit);
- Value *SI = BitTested.first;
+ Value *SI = const_cast<Value *>(BitTested.first);
----------------
AlexMaclean wrote:
The addition of this `const_cast` makes me a bit skeptical about whether it is a good idea to make this parameter const. Is X86 doing something unexpected here? If this is kosher, I don't think it makes sense to mark the API as const. Is there some mitigating factor I'm missing that makes this acceptable?
https://github.com/llvm/llvm-project/pull/176073
More information about the llvm-commits
mailing list