[PATCH] D105739: Mips/GlobalISel: Use more standard call lowering infrastructure

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 9 14:23:07 PDT 2021


arsenm created this revision.
arsenm added reviewers: dsanders, atanasyan, ahatanak, sdardis, paquette, aemerson, aditya_nandakumar.
Herald added subscribers: jrtc27, hiraditya, arichardson, rovka.
arsenm requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

This also fixes some missing implicit uses on call instructions, adds
missing G_ASSERT_SEXT/ZEXT annotations, and some missing outgoing
sext/zexts. This also fixes not respecting tablegen requested type
promotions.

      

This starts treating f64 passed in i32 GPRs as a type of custom
assignment, which restores some previously XFAILed tests. This is due
to getNumRegistersForCallingConv returns a static value, but in this
case it is context dependent on other arguments.

      

Most of the ugliness is reproducing a hack CC_MipsO32 uses in
SelectionDAG. CC_MipsO32 depends on a bunch of vectors populated from
the original IR argument types in MipsCCState. The way this ends up
working in GlobalISel is it only ends up inspecting the most recently
added vector element. I'm pretty sure there are cleaner ways to do
this, but this seemed easier than fixing up the current DAG
handling. This is another case where it would be easier of the
CCAssignFns were passed the original type instead of only the
pre-legalized ones.

      

There's still a lot of junk here that shouldn't be necessary. This
also likely breaks big endian handling, but it wasn't complete/tested
anyway since the IRTranslator gives up on big endian targets.


https://reviews.llvm.org/D105739

Files:
  llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h
  llvm/lib/Target/ARM/ARMCallLowering.cpp
  llvm/lib/Target/Mips/MipsCCState.cpp
  llvm/lib/Target/Mips/MipsCCState.h
  llvm/lib/Target/Mips/MipsCallLowering.cpp
  llvm/lib/Target/Mips/MipsCallLowering.h
  llvm/test/CodeGen/Mips/GlobalISel/irtranslator/extend_args.ll
  llvm/test/CodeGen/Mips/GlobalISel/irtranslator/float_args.ll
  llvm/test/CodeGen/Mips/GlobalISel/llvm-ir/float_args.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105739.357639.patch
Type: text/x-patch
Size: 50063 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210709/7189138c/attachment.bin>


More information about the llvm-commits mailing list