This is an archive of the discontinued LLVM Phabricator instance.

[Target][ARM] Replace outdated getARMVPTBlockMask function
ClosedPublic

Authored by Pierre-vh on Apr 15 2020, 6:30 AM.

Details

Summary

getARMVPTBlockMask was an outdated function that only handled basic block masks: T, TT, TTT and TTTT.
This worked fine before the MVE VPT Block Insertion Pass improvements as it was the only kind of masks that it could generate, but now it can generate more complex masks that uses E predicates, so it's dangerous to use that function to calculate VPT/VPST block masks.

I replaced it with 2 different functions:

  • expandPredBlockMask, in ARMBaseInfo. This adds an "E" or "T" at the end of an existing PredBlockMask.
  • recomputeVPTBlockMask, in Thumb2InstrInfo. This takes an iterator to a VPT/VPST instruction and recomputes its block mask by looking at the predicated instructions that follows it. This should be used to recompute a block mask after removing/adding a predicated instruction to the block.

The expandPredBlockMask function is pretty much imported from the MVE VPT Blocks pass.

I also had to change the ARMLowOverheadLoops and MVEVPTBlocks passes as well so they could use these new functions.

Diff Detail

Event Timeline

Pierre-vh created this revision.Apr 15 2020, 6:30 AM
samparker added inline comments.Apr 17 2020, 5:14 AM
llvm/lib/Target/ARM/Thumb2InstrInfo.cpp
742

I think it would be cleaner just to pass a MachineInstr, which you can then derive these iterators.

744

VPST is covered by the isVPTOpcode helper.

Pierre-vh updated this revision to Diff 258301.Apr 17 2020, 5:50 AM
Pierre-vh marked 2 inline comments as done.
  • recomputeVPTBlockMask now takes a reference instead of 2 iterators
  • Fixed assertion in recomputeVPTBlockMask
samparker accepted this revision.May 5 2020, 11:48 PM

Thanks.

This revision is now accepted and ready to land.May 5 2020, 11:48 PM
This revision was automatically updated to reflect the committed changes.