[llvm] [NFC][AMDGPU] Construct MMO inside getTgtMemIntrinsic. (PR #83554)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 1 03:01:57 PST 2024


================
@@ -2643,8 +2643,12 @@ bool IRTranslator::translateCall(const User &U, MachineIRBuilder &MIRBuilder) {
       MPI = MachinePointerInfo(Info.ptrVal, Info.offset);
     else if (Info.fallbackAddressSpace)
       MPI = MachinePointerInfo(*Info.fallbackAddressSpace);
-    MIB.addMemOperand(
-        MF->getMachineMemOperand(MPI, Info.flags, MemTy, Alignment, CI.getAAMetadata()));
+
+    if (Info.MMO)
+      MIB.addMemOperand(Info.MMO);
+    else
+      MIB.addMemOperand(MF->getMachineMemOperand(
+          MPI, Info.flags, MemTy, Alignment, CI.getAAMetadata()));
----------------
arsenm wrote:

I think this is an awkward API; either the IntrinsicInfo struct should contain all of the fields necessary to construct the MMO, or every instance of getTgtMemIntrinsic should be required to create the MMO.

https://github.com/llvm/llvm-project/pull/83554


More information about the llvm-commits mailing list