projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PM/AA] Remove the last relics of the separate IPA library from LLVM,
[oota-llvm.git]
/
lib
/
CodeGen
/
ExecutionDepsFix.cpp
diff --git
a/lib/CodeGen/ExecutionDepsFix.cpp
b/lib/CodeGen/ExecutionDepsFix.cpp
index dd508b3e5e328a7cbdad6e759c3345db8218f78b..cbc3b80a6a5c130fae602ffda97aa0e18f0c1d89 100644
(file)
--- a/
lib/CodeGen/ExecutionDepsFix.cpp
+++ b/
lib/CodeGen/ExecutionDepsFix.cpp
@@
-110,7
+110,7
@@
struct DomainValue {
Instrs.clear();
}
};
Instrs.clear();
}
};
-}
// namespace
+}
namespace {
/// Information about a live register.
namespace {
/// Information about a live register.
@@
-201,7
+201,7
@@
private:
bool shouldBreakDependence(MachineInstr*, unsigned OpIdx, unsigned Pref);
void processUndefReads(MachineBasicBlock*);
};
bool shouldBreakDependence(MachineInstr*, unsigned OpIdx, unsigned Pref);
void processUndefReads(MachineBasicBlock*);
};
-}
// namespace
+}
char ExeDepsFix::ID = 0;
char ExeDepsFix::ID = 0;
@@
-559,12
+559,11
@@
void ExeDepsFix::processUndefReads(MachineBasicBlock *MBB) {
MachineInstr *UndefMI = UndefReads.back().first;
unsigned OpIdx = UndefReads.back().second;
MachineInstr *UndefMI = UndefReads.back().first;
unsigned OpIdx = UndefReads.back().second;
- for (MachineBasicBlock::reverse_iterator I = MBB->rbegin(), E = MBB->rend();
- I != E; ++I) {
+ for (MachineInstr &I : make_range(MBB->rbegin(), MBB->rend())) {
// Update liveness, including the current instruction's defs.
// Update liveness, including the current instruction's defs.
- LiveRegSet.stepBackward(
*
I);
+ LiveRegSet.stepBackward(I);
- if (UndefMI == &
*
I) {
+ if (UndefMI == &I) {
if (!LiveRegSet.contains(UndefMI->getOperand(OpIdx).getReg()))
TII->breakPartialRegDependency(UndefMI, OpIdx, TRI);
if (!LiveRegSet.contains(UndefMI->getOperand(OpIdx).getReg()))
TII->breakPartialRegDependency(UndefMI, OpIdx, TRI);
@@
-733,12
+732,14
@@
bool ExeDepsFix::runOnMachineFunction(MachineFunction &mf) {
// If no relevant registers are used in the function, we can skip it
// completely.
bool anyregs = false;
// If no relevant registers are used in the function, we can skip it
// completely.
bool anyregs = false;
+ const MachineRegisterInfo &MRI = mf.getRegInfo();
for (TargetRegisterClass::const_iterator I = RC->begin(), E = RC->end();
for (TargetRegisterClass::const_iterator I = RC->begin(), E = RC->end();
- I != E; ++I)
- if (MF->getRegInfo().isPhysRegUsed(*I)) {
- anyregs = true;
- break;
- }
+ I != E && !anyregs; ++I)
+ for (MCRegAliasIterator AI(*I, TRI, true); AI.isValid(); ++AI)
+ if (!MRI.reg_nodbg_empty(*AI)) {
+ anyregs = true;
+ break;
+ }
if (!anyregs) return false;
// Initialize the AliasMap on the first use.
if (!anyregs) return false;
// Initialize the AliasMap on the first use.