[PATCH] Fix PR 23525 - Separate header mass propagation in irregular loops.
Duncan P. N. Exon Smith
dexonsmith at apple.com
Fri Jun 12 13:08:59 PDT 2015
> On 2015-Jun-10, at 08:43, Diego Novillo <dnovillo at google.com> wrote:
>
> > I think you have two options:
> >
> > - Force the size of the `BackedgeMass` vector to be exactly
> > `NumHeaders`. In this code, do a binary search through the range
> > between `NodeList.begin()` and `NodeList.begin() + NumHeaders` to
> > find the index of the header in `NodeList`, and use the same index
> > for `BackedgeMass`. This will have logarithmic runtime cost in the
> > number of loop headers (locally), and linear memory requirements
> > overall.
> > - Use a `SmallDenseMap<BlockNode, BlockMass, 2>`.
> >
> > I prefer the former approach, unless you have some reason against it?
>
> No particular preference. The map approach seems a tad more convenient to implement, though. Seems to me that it would also make the code more readable?
>
Seems like adding a map unfairly punishes the compile-time of the normal
case, where there's exactly one loop header. But if you don't have any
compile-time regressions in LNT or in a clang LTO bootstrap, it doesn't
really matter though.
More information about the llvm-commits
mailing list