summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2022-01-27 11:15:31 +0100
committerNikita Popov <npopov@redhat.com>2022-01-31 09:28:39 +0100
commit0801940c17b7b5bb69a76cd713ad76a6d2ba0788 (patch)
tree1c3114bfce3e18094b48a383a27fc0f611ff71b4
parent438f0e1f00ada4827d8138dd236e850b26c4141f (diff)
[RISCV] Avoid pointer element type access for masked atomicrmw intrinsics
masked.atomicrmw.*.i32 intrinsics access an i32 (and then possibly mask it), so hardcode MVT::i32 as the access type here, rather than determining it from the pointer element type. Differential Revision: https://reviews.llvm.org/D118336
-rw-r--r--llvm/lib/Target/RISCV/RISCVISelLowering.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
index aefccd0ae9ff..4225ae42ed39 100644
--- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
@@ -1121,17 +1121,15 @@ bool RISCVTargetLowering::getTgtMemIntrinsic(IntrinsicInfo &Info,
case Intrinsic::riscv_masked_atomicrmw_min_i32:
case Intrinsic::riscv_masked_atomicrmw_umax_i32:
case Intrinsic::riscv_masked_atomicrmw_umin_i32:
- case Intrinsic::riscv_masked_cmpxchg_i32: {
- PointerType *PtrTy = cast<PointerType>(I.getArgOperand(0)->getType());
+ case Intrinsic::riscv_masked_cmpxchg_i32:
Info.opc = ISD::INTRINSIC_W_CHAIN;
- Info.memVT = MVT::getVT(PtrTy->getPointerElementType());
+ Info.memVT = MVT::i32;
Info.ptrVal = I.getArgOperand(0);
Info.offset = 0;
Info.align = Align(4);
Info.flags = MachineMemOperand::MOLoad | MachineMemOperand::MOStore |
MachineMemOperand::MOVolatile;
return true;
- }
case Intrinsic::riscv_masked_strided_load:
Info.opc = ISD::INTRINSIC_W_CHAIN;
Info.ptrVal = I.getArgOperand(1);