[PATCH] D93337: AMDGPU/GlobalISel: Start cleaning up calling convention lowering

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 6 13:24:43 PST 2021


arsenm added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp:261
     const LLT RegTy = MRI.getType(ValVReg);
-    if (RegTy.getSizeInBytes() > Size)
-      Size = RegTy.getSizeInBytes();
-
-    assignValueToAddress(ValVReg, Addr, Size, MPO, VA);
+    MemSize = std::min(MemSize, (uint64_t)RegTy.getSizeInBytes());
+    assignValueToAddress(ValVReg, Addr, MemSize, MPO, VA);
----------------
cdevadas wrote:
> Why did you change the condition here?
Because the opposite case can happen. The legalized memory size can exceed the register type, which would form an illegal load


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93337/new/

https://reviews.llvm.org/D93337



More information about the llvm-commits mailing list