[llvm-commits] PATCH: Fix AddressSanitizer to emit basic blocks in the natural order for the CFG

Jakob Stoklund Olesen stoklund at 2pi.dk
Tue Jul 10 09:46:09 PDT 2012


On Jul 10, 2012, at 9:21 AM, Chandler Carruth <chandlerc at gmail.com> wrote:

> On Tue, Jul 10, 2012 at 9:13 AM, Jakob Stoklund Olesen <stoklund at 2pi.dk> wrote:

> Unfortunately, we can't bail out of register allocation.
> 
> But is there a cheaper algorithm we could fall over to? I don't know the first thing about regalloc, so maybe this doesn't make sense. Just trying to get a feel for whether this is solvable within the backend, or we simply must not produce such inputs.

It is not impossible to fall back to RAFast which doesn't compute liveness at all, and so won't have this problem. It's a giant hack that I'd rather not do, though.

The fundamental problem is that LLVM doesn't have an IR optimizer, it has an IR canonicalizer. In this case, it's probably LICM hoisting a thousand GEPs out of a thousand-block loop, creating the quadratic problem. Normally, CodeGenPrepare would sink those GEPs again, but in this case they are used by PHIs which CGP won't touch.

If you sink those GEPs, I expect the problem will go away.

Long term, I want to replace MachineCSE and MachineLICM with a global code motion pass that can balance register and execution resource usage. That's not exactly trivial, though.

/jakob

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120710/713792d7/attachment.html>


More information about the llvm-commits mailing list