[PATCH] D111688: [MachineSink] Compile time improvement for large testcases which has many kill flags

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 19 16:30:12 PDT 2021


craig.topper added a comment.

In D111688#3062166 <https://reviews.llvm.org/D111688#3062166>, @MatzeB wrote:

> huh... I guess the problem here was that we interpreted the register numbers as plain unsigned... And virtual registers always have bit 31 set, so I guess the bitset could indeed grow to unreasonable sizes.
>
> - Please try if `DenseSet<Register>` works too.
> - If you can please find a shorter more succinct title.
>
> Then we should be good to land this.

SparseBitVector shouldn't be effected by bit 31 being set. It stores 128 bit chunks of bits in a linked list. Insertion does a linear scan forward or backward from the most recently accessed chunk to trying to find the chunk to insert in. Were we accessing it in some pathologically bad way that caused long linear scans?

If the issue is with the inserting function, then the title of this patch is misleading. The number of kill flags in is irrelevant. The place where the insert happens doesn't know how many kill flags exist. Only the later call to MRI->clearKillFlags(I) would know that.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D111688



More information about the llvm-commits mailing list