[all-commits] [llvm/llvm-project] 06ac45: [GISel][CallLowering] Set byval flag for inalloca/...

Ilpo Ruotsalainen via All-commits all-commits at lists.llvm.org
Wed Jun 3 09:17:42 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 06ac45db1597049c0e4f04c334bf78cd362b75ee
      https://github.com/llvm/llvm-project/commit/06ac45db1597049c0e4f04c334bf78cd362b75ee
  Author: Ilpo Ruotsalainen <lonewolf at iki.fi>
  Date:   2026-06-03 (Wed, 03 Jun 2026)

  Changed paths:
    M llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
    A llvm/test/CodeGen/X86/GlobalISel/calllowering-inalloca.ll

  Log Message:
  -----------
  [GISel][CallLowering] Set byval flag for inalloca/preallocated args (#200600)

GlobalISel asserts when lowering a function with an `inalloca` or
`preallocated` argument:

> TargetCallingConv.h:183: void
llvm::ISD::ArgFlagsTy::setByValSize(unsigned): Assertion `isByVal() &&
!isByRef()' failed.

https://godbolt.org/z/jWr4enjaj

`addFlagsFromAttrSet()` sets the `InAlloca`/`Preallocated` flags but
never `ByVal`.
`setArgFlags()` then calls `Flags.setByValSize()` for any non-`ByRef`
indirect argument which asserts `isByVal()`.

`SelectionDAGISel::LowerArguments()` avoids this by deliberately also
setting the `ByVal` flag for `inalloca`/`preallocated`, this change
makes the GlobalISel side match that behavior.



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