[PATCH] D92470: [ARM] Common inverse constant predicates to VPNOT

Simon Tatham via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 2 04:11:43 PST 2020


simon_tatham added a comment.

Should there be a range limit somewhere in this logic, beyond just 'in the same basic block'? I worry slightly that if there's a very long basic block with two completely separate predicated sections, and they happen to reuse the same constant, then it might not be a win to do this change. Something along the lines of

  %mask1 = [complicated constant]
  %mask2 = [exactly the inverse constant]
  [do a thing predicated on %mask1]
  [do a thing predicated on %mask2]
  [10 instructions of unrelated code not VPT-predicated at all]
  %mask3 = [same constant as %mask2]
  [do a thing predicated on %mask3]

In that situation, it's fine to turn the use of %mask2 into a VPNOT of %mask1, so that the first VPT block has a T and then an E instruction. But you'd probably prefer that %mask3 was rematerialized from scratch rather than (as I understand that this code would do) preserving %mask1 from ages ago in order to complement it again.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92470/new/

https://reviews.llvm.org/D92470



More information about the llvm-commits mailing list