<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Sep 25, 2010, at 5:04 AM, Lang Hames wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Author: lhames<br>Date: Sat Sep 25 07:04:16 2010<br>New Revision: 114791<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=114791&view=rev">http://llvm.org/viewvc/llvm-project?rev=114791&view=rev</a><br>Log:<br>Removed VNInfo::isDefAccurate(). Def "accuracy" can be checked by testing whether LiveIntervals::getInstructionFromIndex(def) returns NULL.<br></div></blockquote><div><br></div><div>Awesome. Thanks, Lang!</div><div><br></div><blockquote type="cite"><div>Modified: llvm/trunk/lib/CodeGen/InlineSpiller.cpp</div><div>URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/InlineSpiller.cpp?rev=114791&r1=114790&r2=114791&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/InlineSpiller.cpp?rev=114791&r1=114790&r2=114791&view=diff</a><br>==============================================================================<br>--- llvm/trunk/lib/CodeGen/InlineSpiller.cpp (original)<br>+++ llvm/trunk/lib/CodeGen/InlineSpiller.cpp Sat Sep 25 07:04:16 2010<br>@@ -283,7 +282,7 @@<br> lis_.RemoveMachineInstrFromMaps(DefMI);<br> vrm_.RemoveMachineInstrFromMaps(DefMI);<br> DefMI->eraseFromParent();<br>- VNI->setIsDefAccurate(false);<br>+ VNI->def = lis_.getZeroIndex();<br></div></blockquote><div><br></div><div>Would it be possible to simply use SlotIndex() here? I am not completely clear on the difference, but it would be nice to have just one exceptional SlotIndex.</div><div><br></div><blockquote type="cite"><div>Modified: llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp</div><div>URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp?rev=114791&r1=114790&r2=114791&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp?rev=114791&r1=114790&r2=114791&view=diff</a><br>==============================================================================<br>--- llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp (original)<br>+++ llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp Sat Sep 25 07:04:16 2010<br>@@ -967,8 +968,7 @@<br><br> assert(!ValNo->isUnused() && "Val# is defined by a dead def?");<br><br>- MachineInstr *DefMI = ValNo->isDefAccurate()<br>- ? LIs->getInstructionFromIndex(ValNo->def) : NULL;<br>+ MachineInstr *DefMI = LIs->getInstructionFromIndex(ValNo->def);<br><br> // If this would create a new join point, do not split.<br> if (DefMI && createsNewJoin(LR, DefMI->getParent(), Barrier->getParent())) {<br>@@ -1005,7 +1005,7 @@<br> SlotIndex SpillIndex;<br> MachineInstr *SpillMI = NULL;<br> int SS = -1;<br>- if (!ValNo->isDefAccurate()) {<br>+ if (LIs->getInstructionFromIndex(ValNo->def) == 0) {<br></div></blockquote><div><br></div><div>This lookup is already available as DefMI above.</div><div><br></div><blockquote type="cite"><div>Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp</div><div>URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=114791&r1=114790&r2=114791&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=114791&r1=114790&r2=114791&view=diff</a><br>==============================================================================<br>--- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original)<br>+++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Sat Sep 25 07:04:16 2010<br>@@ -218,7 +218,7 @@<br> continue;<br> LiveInterval &SRLI = li_->getInterval(*SR);<br> SRLI.addRange(LiveRange(FillerStart, FillerEnd,<br>- SRLI.getNextValue(FillerStart, 0, true,<br>+ SRLI.getNextValue(FillerStart, 0,<br> li_->getVNInfoAllocator())));<br> }<br> }<br>@@ -267,7 +267,8 @@<br> if (BI->valno == BValNo)<br> continue;<br> // When BValNo is null, we're looking for a dummy clobber-value for a subreg.<br>- if (!BValNo && !BI->valno->isDefAccurate() && !BI->valno->getCopy())<br>+ if (!BValNo && li_->getInstructionFromIndex(BI->valno->def) == 0 &&<br>+ !BI->valno->getCopy())<br></div></blockquote><div><br></div><div>Yeah, this is my fault. Those dummy clobber values don't exist any more. They used inaccurate defs a lot. This test can just be assumed false always.</div><br><blockquote type="cite"><div> continue;<br> if (BI->start <= AI->start && BI->end > AI->start)<br> return true;<br></div></blockquote><div><br></div><br><blockquote type="cite"><div>@@ -351,12 +352,11 @@<br> assert(ALR != IntA.end() && "Live range not found!");<br> VNInfo *AValNo = ALR->valno;<br> // If other defs can reach uses of this def, then it's not safe to perform<br>- // the optimization. FIXME: Do isPHIDef and isDefAccurate both need to be<br>- // tested?<br>- if (AValNo->isPHIDef() || !AValNo->isDefAccurate() ||<br>- AValNo->isUnused() || AValNo->hasPHIKill())<br>- return false;<br>+ // the optimization.<br> MachineInstr *DefMI = li_->getInstructionFromIndex(AValNo->def);<br>+ if (AValNo->isPHIDef() || DefMI == 0 || AValNo->isUnused() ||<br>+ AValNo->hasPHIKill())<br>+ return false;<br> if (!DefMI)<br> return false;<br> const TargetInstrDesc &TID = DefMI->getDesc();<br>@@ -652,9 +652,8 @@<br> assert(SrcLR != SrcInt.end() && "Live range not found!");<br> VNInfo *ValNo = SrcLR->valno;<br> // If other defs can reach uses of this def, then it's not safe to perform<br>- // the optimization. FIXME: Do isPHIDef and isDefAccurate both need to be<br>- // tested?<br>- if (ValNo->isPHIDef() || !ValNo->isDefAccurate() ||<br>+ // the optimization.<br>+ if (ValNo->isPHIDef() || li_->getInstructionFromIndex(ValNo->def)==0 ||<br> ValNo->isUnused() || ValNo->hasPHIKill())<br> return false;<br> MachineInstr *DefMI = li_->getInstructionFromIndex(ValNo->def);<font class="Apple-style-span" color="#000000"><font class="Apple-style-span" color="#144FAE"><br></font></font></div></blockquote><div><br></div><div>These are both meant to be short-circuit optimizations: if isPHIDef() or isUnused(), don't pay the price of getInstructionFromIndex().</div><div><br></div><div>They should read:</div><div><br></div><div>if (isPHIDef || isUnused || hasPHIKill) return false;</div><div>MachineInstr *DefMI = li_->getInstructionFromIndex(ValNo->def);</div><div>if (!DefMI) return false;</div><div><br></div><div>/jakob</div><div><br></div></div></body></html>