This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by craig.topper on Oct 18 2020, 1:22 PM.

Details

Summary

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.

Diff Detail

Event Timeline

craig.topper created this revision.Oct 18 2020, 1:22 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 18 2020, 1:22 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
craig.topper requested review of this revision.Oct 18 2020, 1:22 PM
RKSimon accepted this revision.Oct 19 2020, 2:47 AM

LGTM

llvm/lib/Target/X86/X86InstrInfo.cpp
5529

Add a comment here or down below explaining the purpose + limits on reg/store size.

This revision is now accepted and ready to land.Oct 19 2020, 2:47 AM
This revision was landed with ongoing or failed builds.Oct 19 2020, 12:57 PM
This revision was automatically updated to reflect the committed changes.