comparison lib/CodeGen/ScheduleDAGInstrs.cpp @ 134:3a76565eade5 LLVM5.0.1

update 5.0.1
author mir3636
date Sat, 17 Feb 2018 09:57:20 +0900
parents 803732b1fca8
children c2174574ed3a
comparison
equal deleted inserted replaced
133:c60214abe0e8 134:3a76565eade5
19 #include "llvm/ADT/SmallVector.h" 19 #include "llvm/ADT/SmallVector.h"
20 #include "llvm/ADT/SparseSet.h" 20 #include "llvm/ADT/SparseSet.h"
21 #include "llvm/ADT/iterator_range.h" 21 #include "llvm/ADT/iterator_range.h"
22 #include "llvm/Analysis/AliasAnalysis.h" 22 #include "llvm/Analysis/AliasAnalysis.h"
23 #include "llvm/Analysis/ValueTracking.h" 23 #include "llvm/Analysis/ValueTracking.h"
24 #include "llvm/CodeGen/LiveIntervalAnalysis.h" 24 #include "llvm/CodeGen/LiveIntervals.h"
25 #include "llvm/CodeGen/LivePhysRegs.h" 25 #include "llvm/CodeGen/LivePhysRegs.h"
26 #include "llvm/CodeGen/MachineBasicBlock.h" 26 #include "llvm/CodeGen/MachineBasicBlock.h"
27 #include "llvm/CodeGen/MachineFrameInfo.h" 27 #include "llvm/CodeGen/MachineFrameInfo.h"
28 #include "llvm/CodeGen/MachineFunction.h" 28 #include "llvm/CodeGen/MachineFunction.h"
29 #include "llvm/CodeGen/MachineInstr.h" 29 #include "llvm/CodeGen/MachineInstr.h"
34 #include "llvm/CodeGen/PseudoSourceValue.h" 34 #include "llvm/CodeGen/PseudoSourceValue.h"
35 #include "llvm/CodeGen/RegisterPressure.h" 35 #include "llvm/CodeGen/RegisterPressure.h"
36 #include "llvm/CodeGen/ScheduleDAG.h" 36 #include "llvm/CodeGen/ScheduleDAG.h"
37 #include "llvm/CodeGen/ScheduleDFS.h" 37 #include "llvm/CodeGen/ScheduleDFS.h"
38 #include "llvm/CodeGen/SlotIndexes.h" 38 #include "llvm/CodeGen/SlotIndexes.h"
39 #include "llvm/CodeGen/TargetRegisterInfo.h"
40 #include "llvm/CodeGen/TargetSubtargetInfo.h"
39 #include "llvm/IR/Constants.h" 41 #include "llvm/IR/Constants.h"
40 #include "llvm/IR/Function.h" 42 #include "llvm/IR/Function.h"
41 #include "llvm/IR/Instruction.h" 43 #include "llvm/IR/Instruction.h"
42 #include "llvm/IR/Instructions.h" 44 #include "llvm/IR/Instructions.h"
43 #include "llvm/IR/Operator.h" 45 #include "llvm/IR/Operator.h"
50 #include "llvm/Support/Compiler.h" 52 #include "llvm/Support/Compiler.h"
51 #include "llvm/Support/Debug.h" 53 #include "llvm/Support/Debug.h"
52 #include "llvm/Support/ErrorHandling.h" 54 #include "llvm/Support/ErrorHandling.h"
53 #include "llvm/Support/Format.h" 55 #include "llvm/Support/Format.h"
54 #include "llvm/Support/raw_ostream.h" 56 #include "llvm/Support/raw_ostream.h"
55 #include "llvm/Target/TargetRegisterInfo.h"
56 #include "llvm/Target/TargetSubtargetInfo.h"
57 #include <algorithm> 57 #include <algorithm>
58 #include <cassert> 58 #include <cassert>
59 #include <iterator> 59 #include <iterator>
60 #include <string> 60 #include <string>
61 #include <utility> 61 #include <utility>
112 const MachineLoopInfo *mli, 112 const MachineLoopInfo *mli,
113 bool RemoveKillFlags) 113 bool RemoveKillFlags)
114 : ScheduleDAG(mf), MLI(mli), MFI(mf.getFrameInfo()), 114 : ScheduleDAG(mf), MLI(mli), MFI(mf.getFrameInfo()),
115 RemoveKillFlags(RemoveKillFlags), 115 RemoveKillFlags(RemoveKillFlags),
116 UnknownValue(UndefValue::get( 116 UnknownValue(UndefValue::get(
117 Type::getVoidTy(mf.getFunction()->getContext()))) { 117 Type::getVoidTy(mf.getFunction().getContext()))) {
118 DbgValues.clear(); 118 DbgValues.clear();
119 119
120 const TargetSubtargetInfo &ST = mf.getSubtarget(); 120 const TargetSubtargetInfo &ST = mf.getSubtarget();
121 SchedModel.init(ST.getSchedModel(), &ST, TII); 121 SchedModel.init(ST.getSchedModel(), &ST, TII);
122 } 122 }
774 RegOpers.adjustLaneLiveness(*LIS, MRI, SlotIdx); 774 RegOpers.adjustLaneLiveness(*LIS, MRI, SlotIdx);
775 } 775 }
776 if (PDiffs != nullptr) 776 if (PDiffs != nullptr)
777 PDiffs->addInstruction(SU->NodeNum, RegOpers, MRI); 777 PDiffs->addInstruction(SU->NodeNum, RegOpers, MRI);
778 778
779 RPTracker->recedeSkipDebugValues(); 779 if (RPTracker->getPos() == RegionEnd || &*RPTracker->getPos() != &MI)
780 RPTracker->recedeSkipDebugValues();
780 assert(&*RPTracker->getPos() == &MI && "RPTracker in sync"); 781 assert(&*RPTracker->getPos() == &MI && "RPTracker in sync");
781 RPTracker->recede(RegOpers); 782 RPTracker->recede(RegOpers);
782 } 783 }
783 784
784 assert( 785 assert(
1041 LiveRegs.addReg(Reg); 1042 LiveRegs.addReg(Reg);
1042 } 1043 }
1043 } 1044 }
1044 1045
1045 void ScheduleDAGInstrs::fixupKills(MachineBasicBlock &MBB) { 1046 void ScheduleDAGInstrs::fixupKills(MachineBasicBlock &MBB) {
1046 DEBUG(dbgs() << "Fixup kills for BB#" << MBB.getNumber() << '\n'); 1047 DEBUG(dbgs() << "Fixup kills for " << printMBBReference(MBB) << '\n');
1047 1048
1048 LiveRegs.init(*TRI); 1049 LiveRegs.init(*TRI);
1049 LiveRegs.addLiveOuts(MBB); 1050 LiveRegs.addLiveOuts(MBB);
1050 1051
1051 // Examine block from end to start... 1052 // Examine block from end to start...
1096 1097
1097 void ScheduleDAGInstrs::dumpNode(const SUnit *SU) const { 1098 void ScheduleDAGInstrs::dumpNode(const SUnit *SU) const {
1098 // Cannot completely remove virtual function even in release mode. 1099 // Cannot completely remove virtual function even in release mode.
1099 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) 1100 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
1100 SU->getInstr()->dump(); 1101 SU->getInstr()->dump();
1102 dbgs() << '\n';
1101 #endif 1103 #endif
1102 } 1104 }
1103 1105
1104 std::string ScheduleDAGInstrs::getGraphNodeLabel(const SUnit *SU) const { 1106 std::string ScheduleDAGInstrs::getGraphNodeLabel(const SUnit *SU) const {
1105 std::string s; 1107 std::string s;