[llvm] [AIX] Handle arbitrary sized integers when lowering formal arguments passed on the stack (PR #149351)
David Tenty via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 22 07:23:31 PDT 2025
================
@@ -7296,9 +7296,19 @@ SDValue PPCTargetLowering::LowerFormalArguments_AIX(
if (!ArgVT.isVector() && !ValVT.isVector() && ArgVT.isInteger() &&
ValVT.isInteger() &&
ArgVT.getScalarSizeInBits() < ValVT.getScalarSizeInBits()) {
- SDValue ArgValueTrunc = DAG.getNode(
- ISD::TRUNCATE, dl, ArgVT.getSimpleVT() == MVT::i1 ? MVT::i8 : ArgVT,
- ArgValue);
+ // It is possible to have either real integer values that aren't
+ // the power of two sizes, or integers that were not originally
+ // integers. In the latter case, these could have came from structs,
+ // and these integers would not have an extend on the parameter.
+ // Since these types of integers do not have an extend specified
+ // in the first place, the type of extend that we do should not matter.
----------------
daltenty wrote:
nit: I wonder about the placement of this comment, seems to me it belongs at the line where we choose the sigext, not here.
Also, as we are just doing what we do for everything else now (i.e. there's nothing special about non-power of 2 types), it seems to me the comment could be generalized (you can do the same struct trick with an i64, it's not unique to a simple type).
```suggestion
// It is possible to have either real integer values
// or integers that were not originally integers.
// In the latter case, these could have came from structs,
// and these integers would not have an extend on the parameter.
// Since these types of integers do not have an extend specified
// in the first place, the type of extend that we do should not matter.
```
https://github.com/llvm/llvm-project/pull/149351
More information about the llvm-commits
mailing list