diff options
author | Dan Gohman <gohman@apple.com> | 2009-10-09 23:27:56 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-10-09 23:27:56 +0000 |
commit | a70dca156fa76d452f54829b5c5f962ddfd94ef2 (patch) | |
tree | 31322fbef91a904807aea13e1bc2ab409c0042c6 /lib/CodeGen/ScheduleDAGInstrs.cpp | |
parent | ac1ceb3dd33cb79ecb0dbd64b6abafa7ce067c5f (diff) | |
download | llvm-a70dca156fa76d452f54829b5c5f962ddfd94ef2.tar.gz llvm-a70dca156fa76d452f54829b5c5f962ddfd94ef2.tar.bz2 llvm-a70dca156fa76d452f54829b5c5f962ddfd94ef2.tar.xz |
Factor out LiveIntervalAnalysis' code to determine whether an instruction
is trivially rematerializable and integrate it into
TargetInstrInfo::isTriviallyReMaterializable. This way, all places that
need to know whether an instruction is rematerializable will get the
same answer.
This enables the useful parts of the aggressive-remat option by
default -- using AliasAnalysis to determine whether a memory location
is invariant, and removes the questionable parts -- rematting operations
with virtual register inputs that may not be live everywhere.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83687 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/ScheduleDAGInstrs.cpp')
-rw-r--r-- | lib/CodeGen/ScheduleDAGInstrs.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/ScheduleDAGInstrs.cpp b/lib/CodeGen/ScheduleDAGInstrs.cpp index f50844f44a..44e9296661 100644 --- a/lib/CodeGen/ScheduleDAGInstrs.cpp +++ b/lib/CodeGen/ScheduleDAGInstrs.cpp @@ -123,7 +123,7 @@ void ScheduleDAGInstrs::StartBlock(MachineBasicBlock *BB) { } } -void ScheduleDAGInstrs::BuildSchedGraph() { +void ScheduleDAGInstrs::BuildSchedGraph(AliasAnalysis *AA) { // We'll be allocating one SUnit for each instruction, plus one for // the region exit node. SUnits.reserve(BB->size()); @@ -375,7 +375,7 @@ void ScheduleDAGInstrs::BuildSchedGraph() { // Treat all other stores conservatively. goto new_chain; } else if (TID.mayLoad()) { - if (MI->isInvariantLoad()) { + if (MI->isInvariantLoad(AA)) { // Invariant load, no chain dependencies needed! } else if (const Value *V = getUnderlyingObjectForInstr(MI)) { // A load from a specific PseudoSourceValue. Add precise dependencies. |