[PATCH] D86228: [GlobalISel][CallLowering] Use hasRetAttr for return flags on CallBases

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 19 10:04:16 PDT 2020


arsenm added a comment.

The change itself is fine and more consistent, but this is just making an existing problem worse. Instead of treating signext/zeroext as optimization hints on arguments and call results, we're actually introducing code to do the extension which we were promised was already done. We really should be emitting the equivalent of ISD::AssertZext/AssertSext



================
Comment at: llvm/test/CodeGen/AArch64/GlobalISel/call-translator.ll:392
+  ; CHECK:   ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
+  ; CHECK:   [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[TRUNC]](s16)
+  ; CHECK:   $w0 = COPY [[ZEXT]](s32)
----------------
 This doesn't actually need a G_ZEXT. In this context it's supposed to be an optimization hint, so really this should be something like

```
  ; CHECK:   [[COPY:%[0-9]+]]:_(s32) = COPY $w0
  ; CHECK: [[ZEXT_HINT]]:_(s32) = G_ASSERT_ZEXT [[COPY]]

```


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86228/new/

https://reviews.llvm.org/D86228



More information about the llvm-commits mailing list