[PATCH] D122194: [SelectionDAG] Store LeadingZero count in LiveOutInfo instead of KnownBits.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 4 12:34:33 PDT 2022


craig.topper added a comment.

In D122194#3491983 <https://reviews.llvm.org/D122194#3491983>, @RKSimon wrote:

> I have been meaning to investigate adding a general AssertKnownBits DAG node, but haven't done anything on this yet.
>
> Is your main concern about saving memory in LiveOutInfo classes?

It saves memory. I think this simplifies how we keep track of this data being valid. We did an odd thing with a single bit KnownBits value before. See the code on line 422 of FunctionLoweringInfo::GetLiveOutRegInfo.

My original motivation was to try to solve the or_is_add problem on phi recurrences in unrolled loops. Those typically are trailing bits related where the phi has an aligned constant start value(usually 0), and that is incremented by an aligned constant. I was going to use matchSimpleRecurrence to detect that pattern in FunctionLoweringInfo's PHI handling then use that information to mark trailing zeros and add an AssertAlign. By explicitly storing trailing zeros and leading zeros separately instead of KnownBits I could restrict exactly when the AssertAlign would be inserted to only the phi case. Just inserting an AssertAlign based on the KnownBits we have now starts breaking lit tests. I haven't looked at it since March.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122194



More information about the llvm-commits mailing list