[llvm] [PowerPC] Add special handling for arguments that are smaller than pointer size. (PR #119003)

via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 10 12:16:51 PST 2024


================
@@ -7291,7 +7294,23 @@ SDValue PPCTargetLowering::LowerFormalArguments_AIX(
       SDValue FIN = DAG.getFrameIndex(FI, PtrVT);
       SDValue ArgValue =
           DAG.getLoad(ValVT, dl, Chain, FIN, MachinePointerInfo());
-      InVals.push_back(ArgValue);
+
+      // While the ABI specifies the the higher bits of the load should be
+      // zeroed out this is not always the case. For safety this code will zero
+      // extend the loaded value if the size of the argument type is smaller
+      // then the load.
----------------
RolandF77 wrote:

Comment should be updated to include sign extension

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


More information about the llvm-commits mailing list