[PATCH] D132978: [CodeGen] Using ZExt for extractelement indices.

Peter Rong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 13 10:57:21 PDT 2022


Peter marked 2 inline comments as done.
Peter added inline comments.


================
Comment at: llvm/test/CodeGen/PowerPC/variable_elem_vec_extracts.ll:9
 ; Function Attrs: norecurse nounwind readnone
-define signext i32 @geti(<4 x i32> %a, i32 signext %b) {
+define zeroext i32 @geti(<4 x i32> %a, i32 zeroext %b) {
 ; CHECK-LABEL: geti:
----------------
craig.topper wrote:
> pengfei wrote:
> > Peter wrote:
> > > I am wondering which part of the code, if any, in the front end is responsible for generating these attributes. I feel like we should generate `zeroext` for indices instead of `signext` due to the document change.
> > I think it's `CodeGenModule::ConstructAttributeList`
> The attributes tend to follow the types of the arguments in the C source code. So if it was a unsigned type it would be zeroext, if it was a signed type it would be signext. It's not based on how it is used in the function.
In that case I don't have to change anything. BYW thanks pengfei for pointing out, I just reviewed that code.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132978



More information about the llvm-commits mailing list