[PATCH] D89656: [X86] Add i32->float and i64->double bitcast pseudo instructions to store folding table.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 18 13:22:37 PDT 2020


craig.topper created this revision.
craig.topper added reviewers: efriedma, RKSimon, spatel, pengfei.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.
craig.topper requested review of this revision.

We have pseudo instructions we use for bitcasts between these types.
We have them in the load folding table, but not the store folding
table. This adds them there so they can be used for stack spills.

I added an exact size check so that we don't fold when the stack slot
is larger than the GPR. Otherwise the upper bits in the stack slot
would be garbage. That would be fine for Eli's test case in PR47874,
but I'm not sure its safe in general.

A step towards fixing PR47874. Next steps are to change the ADDSSrr_Int
pseudo instructions to use FR32 as the second source register class
instead of VR128. That will keep the coalescer from promoting the
register class of the bitcast instruction which will make the stack
slot 4 bytes instead of 16 bytes.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D89656

Files:
  llvm/lib/Target/X86/X86InstrFoldTables.cpp
  llvm/lib/Target/X86/X86InstrInfo.cpp
  llvm/test/CodeGen/X86/pr47874.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89656.298897.patch
Type: text/x-patch
Size: 5817 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201018/2d362862/attachment.bin>


More information about the llvm-commits mailing list