[all-commits] [llvm/llvm-project] 1eb49b: [GlobalISel][CallLowering] Use hasRetAttr for retu...

Jessica Paquette via All-commits all-commits at lists.llvm.org
Wed Sep 28 19:38:52 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1eb49bbab6b65182f651ea96cfe076ac0d9191d7
      https://github.com/llvm/llvm-project/commit/1eb49bbab6b65182f651ea96cfe076ac0d9191d7
  Author: Jessica Paquette <jpaquette at apple.com>
  Date:   2022-09-28 (Wed, 28 Sep 2022)

  Changed paths:
    M llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h
    M llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
    M llvm/test/CodeGen/AArch64/GlobalISel/call-translator.ll
    M llvm/test/CodeGen/AMDGPU/GlobalISel/irtranslator-call-return-values.ll

  Log Message:
  -----------
  [GlobalISel][CallLowering] Use hasRetAttr for return flags on CallBases

Given something like this:

```
declare signext i16 @signext_callee()
define i32 @caller() {
  %res = call i16 @signext_callee()
  ...
}
```

CallLowering would miss that signext_callee's return value is sign extended,
because it isn't on the call.

Use hasRetAttr on the CallBase to allow us to catch this.

(This now inserts G_ASSERT_SEXT/G_ASSERT_ZEXT like in the original review.)

Differential Revision: https://reviews.llvm.org/D86228




More information about the All-commits mailing list