[llvm] [NVPTX][NFC] Use same logic to get alignment in param declarations and function prototypes (PR #98220)

Kevin McAfee via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 10 16:19:45 PDT 2024


================
@@ -1438,10 +1438,8 @@ std::string NVPTXTargetLowering::getPrototype(
 
     if (!Outs[OIdx].Flags.isByVal()) {
       if (IsTypePassedAsArray(Ty)) {
-        const CallInst *CallI = cast<CallInst>(&CB);
         Align ParamAlign =
-            getAlign(*CallI, i + AttributeList::FirstArgIndex)
-                .value_or(getFunctionParamOptimizedAlign(F, Ty, DL));
+            getArgumentAlignment(&CB, Ty, i + AttributeList::FirstArgIndex, DL);
----------------
kalxr wrote:

All tests pass! By being unable to test with the increased alignment, I was referring to case where we have a `.callprototype` with e.g. `.param .align 16` being impossible both before and after this patch due to indirect calls causing `getFunctionParamOptimizedAlign` to default to ABI alignment. So the cases this patch would affect already could not use the increased alignment.

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


More information about the llvm-commits mailing list