This is an archive of the discontinued LLVM Phabricator instance.

[ARM] MVE VPT Blocks
ClosedPublic

Authored by SjoerdMeijer on Jun 24 2019, 5:36 AM.

Details

Summary

A minor iteration enabling more efficient VPT Block code generation: consecutive VPT
predicated statements, predicated on the same condition, will be placed within
the same VPT Block. This essentially is an exercise to write some more tests
for the next step, which should be more generic also merging instructions when
they are not consecutive.

Diff Detail

Repository
rL LLVM

Event Timeline

SjoerdMeijer created this revision.Jun 24 2019, 5:36 AM
samparker added inline comments.Jun 24 2019, 6:35 AM
llvm/lib/Target/ARM/Thumb2ITBlockPass.cpp
403 ↗(On Diff #206202)

Do we need to keep track of LastMI? Looks like it's only used to get an iterator once out of the loop, but it is derived from MBIter anyway...

llvm/test/CodeGen/ARM/mve-vpt-block5.mir
66 ↗(On Diff #206202)

So why do we have two bundles here? I'm missing something...

SjoerdMeijer marked 2 inline comments as done.Jun 24 2019, 6:46 AM
SjoerdMeijer added inline comments.
llvm/lib/Target/ARM/Thumb2ITBlockPass.cpp
403 ↗(On Diff #206202)

cheers, that looks like a good clean-up, will look into that.

llvm/test/CodeGen/ARM/mve-vpt-block5.mir
66 ↗(On Diff #206202)

because there is a MOV in between the 2nd and 3rd MVE_VMINNMf32 instructions:

$q3 = MVE_VORR $q0, $q0, 0, $noreg, undef $q3

Feedback addressed

samparker added inline comments.Jun 24 2019, 8:53 AM
llvm/lib/Target/ARM/Thumb2ITBlockPass.cpp
405 ↗(On Diff #206209)

But we don't need LastMI at all :)

llvm/test/CodeGen/ARM/mve-vpt-block5.mir
66 ↗(On Diff #206202)

cheers!

SjoerdMeijer marked an inline comment as done.Jun 24 2019, 9:17 AM
SjoerdMeijer added inline comments.
llvm/lib/Target/ARM/Thumb2ITBlockPass.cpp
405 ↗(On Diff #206209)

I think I see what you mean, you want to see:

finalizeBundle(Block, VPSTInsertPos.getInstrIterator(), MBIter);

But they are different iterators:

  • MBIter is a MachineBasicBlock::iterator
  • and finalizeBundle expects a MachineBasicBlock::instr_iterator

I didn't really investigate the difference to be honest, but must be related to iterating over instructions of blocks or bundles.

samparker accepted this revision.Jun 24 2019, 9:17 AM

Ok, please ignore my nonsense. LGTM

This revision is now accepted and ready to land.Jun 24 2019, 9:17 AM

No worries, thanks a lot for reviewing!

This revision was automatically updated to reflect the committed changes.