[all-commits] [llvm/llvm-project] f48a8d: [AIX] Handle arbitrary sized integers when lowerin...

Amy Kwan via All-commits all-commits at lists.llvm.org
Fri Aug 1 05:01:49 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f48a8da34292b367ba8a5e7b25065172df966848
      https://github.com/llvm/llvm-project/commit/f48a8da34292b367ba8a5e7b25065172df966848
  Author: Amy Kwan <amy.kwan1 at ibm.com>
  Date:   2025-08-01 (Fri, 01 Aug 2025)

  Changed paths:
    M llvm/lib/Target/PowerPC/PPCISelLowering.cpp
    A llvm/test/CodeGen/PowerPC/aix-lower-arbitrary-sized-ints.ll

  Log Message:
  -----------
  [AIX] Handle arbitrary sized integers when lowering formal arguments passed on the stack (#149351)

When arbitrary sized (non-simple type, or non-power of two types)
integers are passed on the stack, these integers are not handled when
lowering formal arguments on AIX as we always assume we will encounter
simple type integers.

However, it is possible for frontends to generate arbitrary sized
immediate values in IR. Specifically in rustc, it will generate an
integer value in LLVM IR for small structures that are less than a
pointer size, which is done for optimization purposes for the Rust ABI.
For example, if a Rust structure of three characters is passed into
function on the stack,
```
struct my_struct {
  field1: u8,
  field2: u8,
  field3: u8,
}
```
This will generate an `i24` type in LLVM IR.

Currently, it is not obvious for the backend to distinguish an integer
versus something that wasn't an integer to begin with (such as a
struct), and the latter case would not have an extend on the parameter.
Thus, this PR allows us to perform a truncation and extend on integers,
both non-simple and simple types.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list