[PATCH] D112942: target ABI: improve call parameters extensions handling

Jonas Paulsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 26 09:01:30 PDT 2022


jonpa updated this revision to Diff 418399.
jonpa marked an inline comment as done.
jonpa added a comment.
Herald added a subscriber: fedor.sergeev.

Patch updated:

- only do a verification / default sign extension when an externally visible function is involved. IR producers such as Argument Promotion is free to change the ABI and pass a non-extended argument as long as it is only in local scope.

- Allow NoExt attribute also on returned values.

- Tests updated so that no tests are changed, but instead the -no-arg-exts CL option is passed, which makes the default sign extension to be skipped.

I found that with this patch, which enables the default sign extension by default, on SPEC I mainly see a lot of lhi -> lghi changes, with not many more instructions overall:

  lhi            :               219521               218299    -1222
  lghi           :               445907               447129    +1222
  llgfr          :                89262                89289      +27
  chi            :                53164                53180      +16
  lbh            :                 1141                 1125      -16
  lb             :                19083                19099      +16
  locfhrl        :                   27                   11      -16
  locrl          :                 2922                 2938      +16
  llcr           :                 5076                 5092      +16
  lr             :                63302                63287      -15
  risblg         :                17057                17042      -15
  cih            :                 6728                 6715      -13
  lgfr           :                89323                89329       +6

...
OPCDIFFS: +22


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

https://reviews.llvm.org/D112942

Files:
  clang/include/clang/CodeGen/CGFunctionInfo.h
  clang/lib/CodeGen/CGCall.cpp
  clang/lib/CodeGen/TargetInfo.cpp
  clang/test/CodeGen/SystemZ/systemz-abi-vector.c
  clang/test/CodeGen/SystemZ/systemz-abi.c
  clang/test/CodeGen/SystemZ/systemz-abi.cpp
  llvm/docs/LangRef.rst
  llvm/include/llvm/AsmParser/LLToken.h
  llvm/include/llvm/Bitcode/LLVMBitCodes.h
  llvm/include/llvm/CodeGen/TargetCallingConv.h
  llvm/include/llvm/CodeGen/TargetLowering.h
  llvm/include/llvm/IR/Attributes.td
  llvm/lib/AsmParser/LLLexer.cpp
  llvm/lib/Bitcode/Reader/BitcodeReader.cpp
  llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
  llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
  llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
  llvm/test/CodeGen/SystemZ/and-02.ll
  llvm/test/CodeGen/SystemZ/and-07.ll
  llvm/test/CodeGen/SystemZ/args-01.ll
  llvm/test/CodeGen/SystemZ/args-04.ll
  llvm/test/CodeGen/SystemZ/args-11.ll
  llvm/test/CodeGen/SystemZ/args-12.ll
  llvm/test/CodeGen/SystemZ/args-13.ll
  llvm/test/CodeGen/SystemZ/args-14.ll
  llvm/test/CodeGen/SystemZ/args-15.ll
  llvm/test/CodeGen/SystemZ/args-16.ll
  llvm/test/CodeGen/SystemZ/args-17.ll
  llvm/test/CodeGen/SystemZ/args-18.ll
  llvm/test/CodeGen/SystemZ/args-19.ll
  llvm/test/CodeGen/SystemZ/asm-11.ll
  llvm/test/CodeGen/SystemZ/asm-12.ll
  llvm/test/CodeGen/SystemZ/asm-13.ll
  llvm/test/CodeGen/SystemZ/asm-14.ll
  llvm/test/CodeGen/SystemZ/asm-15.ll
  llvm/test/CodeGen/SystemZ/asm-16.ll
  llvm/test/CodeGen/SystemZ/asm-17.ll
  llvm/test/CodeGen/SystemZ/asm-18.ll
  llvm/test/CodeGen/SystemZ/atomic-load-01.ll
  llvm/test/CodeGen/SystemZ/atomic-load-02.ll
  llvm/test/CodeGen/SystemZ/atomic-load-03.ll
  llvm/test/CodeGen/SystemZ/atomicrmw-add-01.ll
  llvm/test/CodeGen/SystemZ/atomicrmw-add-02.ll
  llvm/test/CodeGen/SystemZ/atomicrmw-add-03.ll
  llvm/test/CodeGen/SystemZ/atomicrmw-add-05.ll
  llvm/test/CodeGen/SystemZ/atomicrmw-and-01.ll
  llvm/test/CodeGen/SystemZ/atomicrmw-and-02.ll
  llvm/test/CodeGen/SystemZ/atomicrmw-and-03.ll
  llvm/test/CodeGen/SystemZ/atomicrmw-and-05.ll
  llvm/test/CodeGen/SystemZ/atomicrmw-minmax-01.ll
  llvm/test/CodeGen/SystemZ/atomicrmw-minmax-02.ll
  llvm/test/CodeGen/SystemZ/atomicrmw-minmax-03.ll
  llvm/test/CodeGen/SystemZ/atomicrmw-nand-01.ll
  llvm/test/CodeGen/SystemZ/atomicrmw-nand-02.ll
  llvm/test/CodeGen/SystemZ/atomicrmw-nand-03.ll
  llvm/test/CodeGen/SystemZ/atomicrmw-or-01.ll
  llvm/test/CodeGen/SystemZ/atomicrmw-or-02.ll
  llvm/test/CodeGen/SystemZ/atomicrmw-or-03.ll
  llvm/test/CodeGen/SystemZ/atomicrmw-or-05.ll
  llvm/test/CodeGen/SystemZ/atomicrmw-sub-01.ll
  llvm/test/CodeGen/SystemZ/atomicrmw-sub-02.ll
  llvm/test/CodeGen/SystemZ/atomicrmw-sub-03.ll
  llvm/test/CodeGen/SystemZ/atomicrmw-sub-05.ll
  llvm/test/CodeGen/SystemZ/atomicrmw-xchg-01.ll
  llvm/test/CodeGen/SystemZ/atomicrmw-xchg-02.ll
  llvm/test/CodeGen/SystemZ/atomicrmw-xchg-03.ll
  llvm/test/CodeGen/SystemZ/atomicrmw-xor-01.ll
  llvm/test/CodeGen/SystemZ/atomicrmw-xor-02.ll
  llvm/test/CodeGen/SystemZ/atomicrmw-xor-03.ll
  llvm/test/CodeGen/SystemZ/atomicrmw-xor-05.ll
  llvm/test/CodeGen/SystemZ/branch-05.ll
  llvm/test/CodeGen/SystemZ/branch-11.ll
  llvm/test/CodeGen/SystemZ/bswap-02.ll
  llvm/test/CodeGen/SystemZ/bswap-06.ll
  llvm/test/CodeGen/SystemZ/call-03.ll
  llvm/test/CodeGen/SystemZ/cmpxchg-01.ll
  llvm/test/CodeGen/SystemZ/cmpxchg-02.ll
  llvm/test/CodeGen/SystemZ/cmpxchg-03.ll
  llvm/test/CodeGen/SystemZ/cmpxchg-04.ll
  llvm/test/CodeGen/SystemZ/cmpxchg-06.ll
  llvm/test/CodeGen/SystemZ/codegenprepare-form-OF-ops.ll
  llvm/test/CodeGen/SystemZ/cond-move-02.ll
  llvm/test/CodeGen/SystemZ/cond-move-06.ll
  llvm/test/CodeGen/SystemZ/ctpop-01.ll
  llvm/test/CodeGen/SystemZ/fp-conv-09.ll
  llvm/test/CodeGen/SystemZ/fp-conv-10.ll
  llvm/test/CodeGen/SystemZ/fp-conv-14.ll
  llvm/test/CodeGen/SystemZ/fp-conv-16.ll
  llvm/test/CodeGen/SystemZ/fp-move-02.ll
  llvm/test/CodeGen/SystemZ/fp-strict-conv-09.ll
  llvm/test/CodeGen/SystemZ/fp-strict-conv-10.ll
  llvm/test/CodeGen/SystemZ/fp-strict-conv-14.ll
  llvm/test/CodeGen/SystemZ/fp-strict-conv-16.ll
  llvm/test/CodeGen/SystemZ/fpc-intrinsics.ll
  llvm/test/CodeGen/SystemZ/htm-intrinsics.ll
  llvm/test/CodeGen/SystemZ/inline-asm-i128.ll
  llvm/test/CodeGen/SystemZ/insert-01.ll
  llvm/test/CodeGen/SystemZ/int-abs-01.ll
  llvm/test/CodeGen/SystemZ/int-add-13.ll
  llvm/test/CodeGen/SystemZ/int-add-14.ll
  llvm/test/CodeGen/SystemZ/int-cmp-36.ll
  llvm/test/CodeGen/SystemZ/int-cmp-38.ll
  llvm/test/CodeGen/SystemZ/int-cmp-44.ll
  llvm/test/CodeGen/SystemZ/int-cmp-45.ll
  llvm/test/CodeGen/SystemZ/int-cmp-57.ll
  llvm/test/CodeGen/SystemZ/int-cmp-61.ll
  llvm/test/CodeGen/SystemZ/int-const-01.ll
  llvm/test/CodeGen/SystemZ/int-conv-01.ll
  llvm/test/CodeGen/SystemZ/int-conv-02.ll
  llvm/test/CodeGen/SystemZ/int-conv-05.ll
  llvm/test/CodeGen/SystemZ/int-conv-06.ll
  llvm/test/CodeGen/SystemZ/int-conv-13.ll
  llvm/test/CodeGen/SystemZ/int-div-01.ll
  llvm/test/CodeGen/SystemZ/int-div-06.ll
  llvm/test/CodeGen/SystemZ/int-move-01.ll
  llvm/test/CodeGen/SystemZ/int-move-02.ll
  llvm/test/CodeGen/SystemZ/int-move-08.ll
  llvm/test/CodeGen/SystemZ/int-move-10.ll
  llvm/test/CodeGen/SystemZ/int-mul-05.ll
  llvm/test/CodeGen/SystemZ/int-mul-11.ll
  llvm/test/CodeGen/SystemZ/int-neg-01.ll
  llvm/test/CodeGen/SystemZ/int-neg-02.ll
  llvm/test/CodeGen/SystemZ/int-sub-08.ll
  llvm/test/CodeGen/SystemZ/int-uadd-06.ll
  llvm/test/CodeGen/SystemZ/int-usub-06.ll
  llvm/test/CodeGen/SystemZ/knownbits-intrinsics-binop.ll
  llvm/test/CodeGen/SystemZ/knownbits.ll
  llvm/test/CodeGen/SystemZ/memcmp-01.ll
  llvm/test/CodeGen/SystemZ/not-01.ll
  llvm/test/CodeGen/SystemZ/or-07.ll
  llvm/test/CodeGen/SystemZ/pr42512.ll
  llvm/test/CodeGen/SystemZ/risbg-01.ll
  llvm/test/CodeGen/SystemZ/risbg-02.ll
  llvm/test/CodeGen/SystemZ/risbg-04.ll
  llvm/test/CodeGen/SystemZ/rot-01.ll
  llvm/test/CodeGen/SystemZ/rot-02.ll
  llvm/test/CodeGen/SystemZ/scalar-ctlz.ll
  llvm/test/CodeGen/SystemZ/selectcc-01.ll
  llvm/test/CodeGen/SystemZ/selectcc-02.ll
  llvm/test/CodeGen/SystemZ/setcc-01.ll
  llvm/test/CodeGen/SystemZ/setcc-02.ll
  llvm/test/CodeGen/SystemZ/sext-zext.ll
  llvm/test/CodeGen/SystemZ/shift-01.ll
  llvm/test/CodeGen/SystemZ/shift-02.ll
  llvm/test/CodeGen/SystemZ/shift-03.ll
  llvm/test/CodeGen/SystemZ/shift-04.ll
  llvm/test/CodeGen/SystemZ/shift-09.ll
  llvm/test/CodeGen/SystemZ/shift-11.ll
  llvm/test/CodeGen/SystemZ/shift-12.ll
  llvm/test/CodeGen/SystemZ/soft-float-args.ll
  llvm/test/CodeGen/SystemZ/stack-clash-dynamic-alloca.ll
  llvm/test/CodeGen/SystemZ/stack-clash-protection.ll
  llvm/test/CodeGen/SystemZ/store_nonbytesized_vecs.ll
  llvm/test/CodeGen/SystemZ/strcmp-01.ll
  llvm/test/CodeGen/SystemZ/strcpy-01.ll
  llvm/test/CodeGen/SystemZ/strcpy-nobuiltin.ll
  llvm/test/CodeGen/SystemZ/swift-return.ll
  llvm/test/CodeGen/SystemZ/swifterror.ll
  llvm/test/CodeGen/SystemZ/tdc-01.ll
  llvm/test/CodeGen/SystemZ/tdc-06.ll
  llvm/test/CodeGen/SystemZ/tdc-07.ll
  llvm/test/CodeGen/SystemZ/trap-01.ll
  llvm/test/CodeGen/SystemZ/trap-02.ll
  llvm/test/CodeGen/SystemZ/trap-03.ll
  llvm/test/CodeGen/SystemZ/unaligned-01.ll
  llvm/test/CodeGen/SystemZ/vec-combine-02.ll
  llvm/test/CodeGen/SystemZ/vec-extract-02.ll
  llvm/test/CodeGen/SystemZ/vec-intrinsics-01.ll
  llvm/test/CodeGen/SystemZ/vec-intrinsics-02.ll
  llvm/test/CodeGen/SystemZ/vec-move-05.ll
  llvm/test/CodeGen/SystemZ/xor-07.ll
  llvm/test/DebugInfo/Generic/missing-abstract-variable.ll
  llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/systemz_function_name.ll
  llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/systemz_function_name.ll.expected
  llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/systemz_generated_funcs.ll
  llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/systemz_generated_funcs.ll.generated.expected
  llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/systemz_generated_funcs.ll.nogenerated.expected

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112942.418399.patch
Type: text/x-patch
Size: 118366 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220326/7d096756/attachment-0001.bin>


More information about the llvm-commits mailing list