[PATCH] D132978: [CodeGen] Using ZExt for extractelement indices.
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 12 20:43:26 PDT 2022
craig.topper 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:
----------------
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.
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