This is an archive of the discontinued LLVM Phabricator instance.

[DAG] Fold vector (aext (load x)) -> (zext (truncate (zextload x)))
ClosedPublic

Authored by RKSimon on Aug 3 2020, 5:52 AM.

Details

Summary

We currently don't do anything to fold any_extend vector loads as no target has such an instruction.

Instead I've added support for folding to a zextload, SimplifyDemandedBits does a good job of adjusting the zext(truncate(()) stages as required later on.

We still need the custom scalar extload handling instead of using the tryToFoldExtOfLoad helper as it has different legality tests - we can probably tweak that to reduce most of the code duplication.

Fixes the regression I mentioned in rG99a971cadff7

Diff Detail

Event Timeline

RKSimon created this revision.Aug 3 2020, 5:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 3 2020, 5:52 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
RKSimon requested review of this revision.Aug 3 2020, 5:52 AM
This revision is now accepted and ready to land.Aug 4 2020, 9:31 PM
This revision was landed with ongoing or failed builds.Aug 5 2020, 3:22 AM
This revision was automatically updated to reflect the committed changes.