This is an archive of the discontinued LLVM Phabricator instance.

[X86] Directly emit a BROADCAST_LOAD from constant pool in lowerUINT_TO_FP_vXi32 to avoid double loads seen in D71971
ClosedPublic

Authored by craig.topper on Jan 6 2020, 3:15 PM.

Details

Summary

By directly emitting the constants as a constant pool load we seem to avoid the build_vector/extract_subvector combines that resulted in the duplicate loads we had before.

Diff Detail

Event Timeline

craig.topper created this revision.Jan 6 2020, 3:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 6 2020, 3:15 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
RKSimon added inline comments.Jan 7 2020, 12:58 AM
llvm/lib/Target/X86/X86ISelLowering.cpp
19175

Could we avoid all this by using X86ISD::FOR instead?

RKSimon added inline comments.Jan 7 2020, 3:44 AM
llvm/lib/Target/X86/X86ISelLowering.cpp
19175

Turns out - no we can't, but this still seems a hacky way to fix this.

craig.topper marked an inline comment as done.Jan 9 2020, 6:12 PM
craig.topper added inline comments.
llvm/lib/Target/X86/X86ISelLowering.cpp
19175

I admit this is hacky. But its not the only place we are directly emitting loads pool operations during int->fp conversion. See also LowerUINT_TO_FP_i64, LowerUINT_TO_FP, and SelectionDAGLegalize::ExpandLegalINT_TO_FP

RKSimon accepted this revision.Jan 14 2020, 5:16 AM

OK - LGTM

This revision is now accepted and ready to land.Jan 14 2020, 5:16 AM
This revision was automatically updated to reflect the committed changes.