[PATCH] D119432: [FastISel] Reuse register for bitcast that does not change MVT

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 10 05:21:37 PST 2022


nikic created this revision.
nikic added reviewers: craig.topper, RKSimon, spatel.
Herald added subscribers: pengfei, hiraditya.
nikic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The current FastISel code reuses the register for a bitcast that doesn't change the IR type, but uses a reg-to-reg copy if it changes the MVT. However, we can simply reuse the register in that case as well.

In particular, this avoids unnecessary reg-to-reg copies for pointer bitcasts. This was found while inspecting `O0` codegen differences between typed and opaque pointers.


https://reviews.llvm.org/D119432

Files:
  llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
  llvm/test/CodeGen/AArch64/swifterror.ll
  llvm/test/CodeGen/ARM/swifterror.ll
  llvm/test/CodeGen/X86/atomic64.ll
  llvm/test/CodeGen/X86/swifterror.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119432.407491.patch
Type: text/x-patch
Size: 38501 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220210/14972df0/attachment.bin>


More information about the llvm-commits mailing list