This is an archive of the discontinued LLVM Phabricator instance.

[ARM] A predicate cast of a predicate cast is a predicate cast
ClosedPublic

Authored by dmgreen on Sep 15 2019, 6:35 AM.

Details

Summary

The adds some very basic folding of PREDICATE_CASTS, removing cases when they are chained together. These would already be removed eventually, as these are lowered to copies. This just allows it to happen earlier, which can help during lowering.

Diff Detail

Repository
rL LLVM

Event Timeline

dmgreen created this revision.Sep 15 2019, 6:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 15 2019, 6:35 AM

Could you say what it is generally helping? For the first few test cases, the main change that I see is push and pop instructions being introduced...

Yeah, it's a shame about the masked ld-st tests. They appear to be in a different order, causing the extra register usage. Seems like more of a scheduling problem. The tests in mve-pred-bitcast.ll and mve-pred-loadstore.ll are both smaller (and the masked load-store tests will eventually generate narrow/widen masked loads/stores.)

This seems like a fairly obvious simplification to me. It should in certain situations allow further simplification, so should in general be an improvement.

samparker accepted this revision.Sep 16 2019, 7:27 AM

Good point, the copies probably would do a good job of constraining the scheduler!

llvm/lib/Target/ARM/ARMISelLowering.cpp
12641 ↗(On Diff #220246)

Shouldn't this be casting to VT?

This revision is now accepted and ready to land.Sep 16 2019, 7:27 AM
This revision was automatically updated to reflect the committed changes.