[PATCH] Check Dest Register Liveness using MRI in CondOpt pass

Pete Cooper peter_cooper at apple.com
Tue Apr 21 15:50:35 PDT 2015


Hi Chad

http://reviews.llvm.org/D6048 <http://reviews.llvm.org/D6048> (everyone CCed here was CCed on it) added register liveness checking to the CondOpt pass.  It does this with

if (I->getOperand(0).isDead())

However, this requires that some kind of liveness has been run beforehand, so the pass had to require live intervals.  Looking at the pass manager dump, we then invalidated live intervals shortly after CondOpt because other passes don’t preserve it.

Attached is a patch which removes the dependency on LiveIntervals by checking if the def has any uses.  If it has no uses then it was going to be marked dead anyway, so this is equivalent to your original code.  I’ve verified that this passes ‘make check’ and specifically stepped through the examples in combine-comparisons-by-cse.ll in lldb to ensure the behavior was the same.

When building a bitcode containing all of llc with/without this change, it results in one less run of LiveIntervals per MF and saves 4s out of 80s total compile time.

Thanks,
Pete


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150421/72f42290/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: condopt.diff
Type: application/octet-stream
Size: 2355 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150421/72f42290/attachment.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150421/72f42290/attachment-0001.html>


More information about the llvm-commits mailing list