[llvm] r274928 - Allow dead insts to be kept in DeadRemat only when they are rematerializable.
Chris Matthews via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 11 10:41:17 PDT 2016
I have triggered a system wide clean of the workspaces. Lets see if that fixes it.
It could also be a cmake issue, this is one of the first cmake builds we run.
On July 11, 2016 at 10:14:11 AM, Quentin Colombet (qcolombet at apple.com) wrote:
Hi Chris,
Is there a way to check what is on the buildslave?
It looks as if it did not updated the header file.
Cheers,
-Quentin
On Jul 9, 2016, at 11:24 PM, Lang Hames <lhames at gmail.com> wrote:
Hi Wei,
I am still seeing failures on the buildbots: http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_build/ , but you're right the code looks ok to me. Quentin, Chris - could this be a builder config issue?
- Lang.
On Sat, Jul 9, 2016 at 11:05 AM, Wei Mi <wmi at google.com> wrote:
Hi Lang,
Sorry, I am little confused. I check the program and cannot see any
discrepancy reported in the error log, and I also cannot reproduce the
error in clang bootstrap build. Is it anything related with
incremental build?
Thanks,
Wei.
On Sat, Jul 9, 2016 at 9:28 AM, Wei Mi <wmi at google.com> wrote:
> Sorry, I will fix it.
>
> Thanks,
> Wei.
>
> On Sat, Jul 9, 2016 at 9:03 AM, Lang Hames <lhames at gmail.com> wrote:
>> Hi Wei,
>>
>> This appears to have broken the bots:
>> http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_build/27331/
>>
>> Could you please fix or revert?
>>
>> Cheers,
>> Lang.
>>
>>
>> On Fri, Jul 8, 2016 at 2:08 PM, Wei Mi via llvm-commits
>> <llvm-commits at lists.llvm.org> wrote:
>>>
>>> Author: wmi
>>> Date: Fri Jul 8 16:08:09 2016
>>> New Revision: 274928
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=274928&view=rev
>>> Log:
>>> Allow dead insts to be kept in DeadRemat only when they are
>>> rematerializable.
>>>
>>> Because isReallyTriviallyReMaterializableGeneric puts many limits on
>>> rematerializable instructions, this fix can prevent instructions with
>>> tied virtual operands and instructions with virtual register uses from
>>> being kept in DeadRemat, so as to workaround the live interval consistency
>>> problem for the dummy instructions kept in DeadRemat.
>>>
>>> But we still need to fix the live interval consistency problem. This patch
>>> is just a short time relieve. PR28464 has been filed as a reminder.
>>>
>>> Differential Revision: http://reviews.llvm.org/D19486
>>>
>>> Modified:
>>> llvm/trunk/include/llvm/CodeGen/LiveRangeEdit.h
>>> llvm/trunk/lib/CodeGen/InlineSpiller.cpp
>>> llvm/trunk/lib/CodeGen/LiveRangeEdit.cpp
>>> llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp
>>> llvm/trunk/lib/CodeGen/SplitKit.cpp
>>> llvm/trunk/lib/CodeGen/SplitKit.h
>>>
>>> Modified: llvm/trunk/include/llvm/CodeGen/LiveRangeEdit.h
>>> URL:
>>> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveRangeEdit.h?rev=274928&r1=274927&r2=274928&view=diff
>>>
>>> ==============================================================================
>>> --- llvm/trunk/include/llvm/CodeGen/LiveRangeEdit.h (original)
>>> +++ llvm/trunk/include/llvm/CodeGen/LiveRangeEdit.h Fri Jul 8 16:08:09
>>> 2016
>>> @@ -100,7 +100,8 @@ private:
>>> SmallVector<LiveInterval*, 8>,
>>> SmallPtrSet<LiveInterval*, 8> > ToShrinkSet;
>>> /// Helper for eliminateDeadDefs.
>>> - void eliminateDeadDef(MachineInstr *MI, ToShrinkSet &ToShrink);
>>> + void eliminateDeadDef(MachineInstr *MI, ToShrinkSet &ToShrink,
>>> + AliasAnalysis *AA);
>>>
>>> /// MachineRegisterInfo callback to notify when new virtual
>>> /// registers are created.
>>> @@ -242,7 +243,8 @@ public:
>>> /// allocator. These registers should not be split into new intervals
>>> /// as currently those new intervals are not guaranteed to spill.
>>> void eliminateDeadDefs(SmallVectorImpl<MachineInstr *> &Dead,
>>> - ArrayRef<unsigned> RegsBeingSpilled = None);
>>> + ArrayRef<unsigned> RegsBeingSpilled = None,
>>> + AliasAnalysis *AA = nullptr);
>>>
>>> /// calculateRegClassAndHint - Recompute register class and hint for
>>> each new
>>> /// register.
>>>
>>> Modified: llvm/trunk/lib/CodeGen/InlineSpiller.cpp
>>> URL:
>>> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/InlineSpiller.cpp?rev=274928&r1=274927&r2=274928&view=diff
>>>
>>> ==============================================================================
>>> --- llvm/trunk/lib/CodeGen/InlineSpiller.cpp (original)
>>> +++ llvm/trunk/lib/CodeGen/InlineSpiller.cpp Fri Jul 8 16:08:09 2016
>>> @@ -626,7 +626,7 @@ void InlineSpiller::reMaterializeAll() {
>>> if (DeadDefs.empty())
>>> return;
>>> DEBUG(dbgs() << "Remat created " << DeadDefs.size() << " dead
>>> defs.\n");
>>> - Edit->eliminateDeadDefs(DeadDefs, RegsToSpill);
>>> + Edit->eliminateDeadDefs(DeadDefs, RegsToSpill, AA);
>>>
>>> // LiveRangeEdit::eliminateDeadDef is used to remove dead define
>>> instructions
>>> // after rematerialization. To remove a VNI for a vreg from its
>>> LiveInterval,
>>> @@ -996,7 +996,7 @@ void InlineSpiller::spillAll() {
>>> // Hoisted spills may cause dead code.
>>> if (!DeadDefs.empty()) {
>>> DEBUG(dbgs() << "Eliminating " << DeadDefs.size() << " dead defs\n");
>>> - Edit->eliminateDeadDefs(DeadDefs, RegsToSpill);
>>> + Edit->eliminateDeadDefs(DeadDefs, RegsToSpill, AA);
>>> }
>>>
>>> // Finally delete the SnippetCopies.
>>> @@ -1440,7 +1440,7 @@ void HoistSpillHelper::hoistAllSpills()
>>> RMEnt->RemoveOperand(i - 1);
>>> }
>>> }
>>> - Edit.eliminateDeadDefs(SpillsToRm, None);
>>> + Edit.eliminateDeadDefs(SpillsToRm, None, AA);
>>> }
>>> }
>>>
>>>
>>> Modified: llvm/trunk/lib/CodeGen/LiveRangeEdit.cpp
>>> URL:
>>> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveRangeEdit.cpp?rev=274928&r1=274927&r2=274928&view=diff
>>>
>>> ==============================================================================
>>> --- llvm/trunk/lib/CodeGen/LiveRangeEdit.cpp (original)
>>> +++ llvm/trunk/lib/CodeGen/LiveRangeEdit.cpp Fri Jul 8 16:08:09 2016
>>> @@ -234,7 +234,8 @@ bool LiveRangeEdit::useIsKill(const Live
>>> }
>>>
>>> /// Find all live intervals that need to shrink, then remove the
>>> instruction.
>>> -void LiveRangeEdit::eliminateDeadDef(MachineInstr *MI, ToShrinkSet
>>> &ToShrink) {
>>> +void LiveRangeEdit::eliminateDeadDef(MachineInstr *MI, ToShrinkSet
>>> &ToShrink,
>>> + AliasAnalysis *AA) {
>>> assert(MI->allDefsAreDead() && "Def isn't really dead");
>>> SlotIndex Idx = LIS.getInstructionIndex(*MI).getRegSlot();
>>>
>>> @@ -327,11 +328,12 @@ void LiveRangeEdit::eliminateDeadDef(Mac
>>> }
>>> DEBUG(dbgs() << "Converted physregs to:\t" << *MI);
>>> } else {
>>> - // If the dest of MI is an original reg, don't delete the inst.
>>> Replace
>>> - // the dest with a new reg, keep the inst for remat of other
>>> siblings.
>>> - // The inst is saved in LiveRangeEdit::DeadRemats and will be deleted
>>> - // after all the allocations of the func are done.
>>> - if (isOrigDef) {
>>> + // If the dest of MI is an original reg and MI is reMaterializable,
>>> + // don't delete the inst. Replace the dest with a new reg, and keep
>>> + // the inst for remat of other siblings. The inst is saved in
>>> + // LiveRangeEdit::DeadRemats and will be deleted after all the
>>> + // allocations of the func are done.
>>> + if (isOrigDef && DeadRemats && TII.isTriviallyReMaterializable(*MI,
>>> AA)) {
>>> LiveInterval &NewLI = createEmptyIntervalFrom(Dest);
>>> VNInfo *VNI = NewLI.getNextValue(Idx, LIS.getVNInfoAllocator());
>>> NewLI.addSegment(LiveInterval::Segment(Idx, Idx.getDeadSlot(),
>>> VNI));
>>> @@ -361,13 +363,14 @@ void LiveRangeEdit::eliminateDeadDef(Mac
>>> }
>>>
>>> void LiveRangeEdit::eliminateDeadDefs(SmallVectorImpl<MachineInstr *>
>>> &Dead,
>>> - ArrayRef<unsigned>
>>> RegsBeingSpilled) {
>>> + ArrayRef<unsigned>
>>> RegsBeingSpilled,
>>> + AliasAnalysis *AA) {
>>> ToShrinkSet ToShrink;
>>>
>>> for (;;) {
>>> // Erase all dead defs.
>>> while (!Dead.empty())
>>> - eliminateDeadDef(Dead.pop_back_val(), ToShrink);
>>> + eliminateDeadDef(Dead.pop_back_val(), ToShrink, AA);
>>>
>>> if (ToShrink.empty())
>>> break;
>>>
>>> Modified: llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp
>>> URL:
>>> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp?rev=274928&r1=274927&r2=274928&view=diff
>>>
>>> ==============================================================================
>>> --- llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp (original)
>>> +++ llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp Fri Jul 8 16:08:09 2016
>>> @@ -129,6 +129,7 @@ class RAGreedy : public MachineFunctionP
>>> EdgeBundles *Bundles;
>>> SpillPlacement *SpillPlacer;
>>> LiveDebugVariables *DebugVars;
>>> + AliasAnalysis *AA;
>>>
>>> // state
>>> std::unique_ptr<Spiller> SpillerInstance;
>>> @@ -2592,6 +2593,7 @@ bool RAGreedy::runOnMachineFunction(Mach
>>> Bundles = &getAnalysis<EdgeBundles>();
>>> SpillPlacer = &getAnalysis<SpillPlacement>();
>>> DebugVars = &getAnalysis<LiveDebugVariables>();
>>> + AA = &getAnalysis<AAResultsWrapperPass>().getAAResults();
>>>
>>> initializeCSRCost();
>>>
>>> @@ -2600,7 +2602,7 @@ bool RAGreedy::runOnMachineFunction(Mach
>>> DEBUG(LIS->dump());
>>>
>>> SA.reset(new SplitAnalysis(*VRM, *LIS, *Loops));
>>> - SE.reset(new SplitEditor(*SA, *LIS, *VRM, *DomTree, *MBFI));
>>> + SE.reset(new SplitEditor(*SA, *AA, *LIS, *VRM, *DomTree, *MBFI));
>>> ExtraRegInfo.clear();
>>> ExtraRegInfo.resize(MRI->getNumVirtRegs());
>>> NextCascade = 1;
>>>
>>> Modified: llvm/trunk/lib/CodeGen/SplitKit.cpp
>>> URL:
>>> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SplitKit.cpp?rev=274928&r1=274927&r2=274928&view=diff
>>>
>>> ==============================================================================
>>> --- llvm/trunk/lib/CodeGen/SplitKit.cpp (original)
>>> +++ llvm/trunk/lib/CodeGen/SplitKit.cpp Fri Jul 8 16:08:09 2016
>>> @@ -338,11 +338,13 @@ void SplitAnalysis::analyze(const LiveIn
>>>
>>> //===----------------------------------------------------------------------===//
>>>
>>> /// Create a new SplitEditor for editing the LiveInterval analyzed by SA.
>>> -SplitEditor::SplitEditor(SplitAnalysis &sa, LiveIntervals &lis,
>>> VirtRegMap &vrm,
>>> +SplitEditor::SplitEditor(SplitAnalysis &sa, AliasAnalysis &aa,
>>> + LiveIntervals &lis, VirtRegMap &vrm,
>>> MachineDominatorTree &mdt,
>>> MachineBlockFrequencyInfo &mbfi)
>>> - : SA(sa), LIS(lis), VRM(vrm),
>>> MRI(vrm.getMachineFunction().getRegInfo()),
>>> - MDT(mdt),
>>> TII(*vrm.getMachineFunction().getSubtarget().getInstrInfo()),
>>> + : SA(sa), AA(aa), LIS(lis), VRM(vrm),
>>> + MRI(vrm.getMachineFunction().getRegInfo()), MDT(mdt),
>>> + TII(*vrm.getMachineFunction().getSubtarget().getInstrInfo()),
>>> TRI(*vrm.getMachineFunction().getSubtarget().getRegisterInfo()),
>>> MBFI(mbfi), Edit(nullptr), OpenIdx(0), SpillMode(SM_Partition),
>>> RegAssign(Allocator) {}
>>> @@ -1130,7 +1132,7 @@ void SplitEditor::deleteRematVictims() {
>>> if (Dead.empty())
>>> return;
>>>
>>> - Edit->eliminateDeadDefs(Dead);
>>> + Edit->eliminateDeadDefs(Dead, None, &AA);
>>> }
>>>
>>> void SplitEditor::finish(SmallVectorImpl<unsigned> *LRMap) {
>>>
>>> Modified: llvm/trunk/lib/CodeGen/SplitKit.h
>>> URL:
>>> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SplitKit.h?rev=274928&r1=274927&r2=274928&view=diff
>>>
>>> ==============================================================================
>>> --- llvm/trunk/lib/CodeGen/SplitKit.h (original)
>>> +++ llvm/trunk/lib/CodeGen/SplitKit.h Fri Jul 8 16:08:09 2016
>>> @@ -235,6 +235,7 @@ public:
>>> ///
>>> class LLVM_LIBRARY_VISIBILITY SplitEditor {
>>> SplitAnalysis &SA;
>>> + AliasAnalysis &AA;
>>> LiveIntervals &LIS;
>>> VirtRegMap &VRM;
>>> MachineRegisterInfo &MRI;
>>> @@ -380,8 +381,9 @@ private:
>>> public:
>>> /// Create a new SplitEditor for editing the LiveInterval analyzed by
>>> SA.
>>> /// Newly created intervals will be appended to newIntervals.
>>> - SplitEditor(SplitAnalysis &SA, LiveIntervals&, VirtRegMap&,
>>> - MachineDominatorTree&, MachineBlockFrequencyInfo &);
>>> + SplitEditor(SplitAnalysis &SA, AliasAnalysis &AA, LiveIntervals&,
>>> + VirtRegMap&, MachineDominatorTree&,
>>> + MachineBlockFrequencyInfo &);
>>>
>>> /// reset - Prepare for a new split.
>>> void reset(LiveRangeEdit&, ComplementSpillMode = SM_Partition);
>>>
>>>
>>> _______________________________________________
>>> llvm-commits mailing list
>>> llvm-commits at lists.llvm.org
>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160711/f9705ebd/attachment-0001.html>
More information about the llvm-commits
mailing list