This is an archive of the discontinued LLVM Phabricator instance.

[SelectionDAG] Support promotion of PREFETCH operands
ClosedPublic

Authored by asb on Oct 15 2018, 4:01 AM.

Details

Summary

For targets where i32 is not a legal type (e.g. 64-bit RISC-V), LegalizeIntegerTypes must promote the operands of ISD::PREFETCH.

Diff Detail

Repository
rL LLVM

Event Timeline

asb created this revision.Oct 15 2018, 4:01 AM
craig.topper added inline comments.Oct 15 2018, 10:07 AM
lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
1337 ↗(On Diff #169676)

I think you might want ZExtPromotedInteger here. I don't think the prefetch node is defined to only look at certain bits. Since those arguments are constants, GetPromotedInteger probably appears to do the right thing since we wouldn't make up garbage to extend a constant. But zext is more explicitily correct.

asb updated this revision to Diff 174174.Nov 15 2018, 2:42 AM
asb marked an inline comment as done.

Refresh patch and use ZExtPromotedInteger.

Looks good?

efriedma accepted this revision.Nov 15 2018, 11:28 AM
efriedma added a subscriber: efriedma.

LGTM

This revision is now accepted and ready to land.Nov 15 2018, 11:28 AM
This revision was automatically updated to reflect the committed changes.