[PATCH] D30350: [LSR] Add a cap for reassociation of AllFixupsOutsideLoop type LSRUse to protect compile time

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 26 11:42:11 PST 2017


Wei Mi via Phabricator <reviews at reviews.llvm.org> writes:

> wmi created this revision.
> Herald added a subscriber: mzolotukhin.
>
> In PR32043, we saw a testcase containing a AllFixupsOutsideLoop type LSRUse with huge SCEVAddExpr. LSRInstance::GenerateReassociations generates lots of new formula for the LSRUse because of the huge AddExpr, and causes compilation to hang.
>
> Since AllFixupsOutsideLoop type LSRUses are outside of current loop, reassociation for them should have much less impact compared with that for normal LSRUses. The fix is to add a cap in reassociation if the LSRUse is of AllFixupsOutsideLoop type. I admit this is a workround. AllFixupsOutsideLoop LSRUse needs to be handled in a better way to reduce compile time and improve LSR results.
>
> No test because I am not sure the potential hanging test from PR32043 is proper to be added.

Ideally it would be reduced further, but even as is it is probably
better than no test.

Cheers,
Rafael


More information about the llvm-commits mailing list