This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Fold VMOVrh VLDR to LDRH
ClosedPublic

Authored by dmgreen on Mar 20 2020, 2:58 AM.

Details

Summary

This adds a simple fold to combine VMOVrh load to a integer load. This is similar to what is already done for BITCAST, but needs to account for the types being of different sizes, creating an extending load.

Diff Detail

Event Timeline

dmgreen created this revision.Mar 20 2020, 2:58 AM
efriedma added inline comments.Mar 20 2020, 12:06 PM
llvm/lib/Target/ARM/ARMISelLowering.cpp
12965

Can you call the overload of getExtLoad() that takes a MachineMemOperand ?

12969

I'd prefer to do all the replacements here, instead of relying on the caller to do the remaining replacement. This applies for all combines that are more complicated that replacing one node with another.

dmgreen updated this revision to Diff 251994.Mar 23 2020, 5:03 AM
dmgreen marked an inline comment as done.
dmgreen added inline comments.
llvm/lib/Target/ARM/ARMISelLowering.cpp
12969

OK. I took the existing code from DAGCombine::visitBITCAST (but, you know, adjusted for different sizes). Let me know if the new code looks better.

This revision is now accepted and ready to land.Mar 23 2020, 10:24 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMar 24 2020, 9:07 AM