summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
diff options
context:
space:
mode:
authorUlrich Weigand <ulrich.weigand@de.ibm.com>2019-07-16 15:55:45 +0000
committerUlrich Weigand <ulrich.weigand@de.ibm.com>2019-07-16 15:55:45 +0000
commit450c62e33ea5310481b06d3fd59df911f5451ff2 (patch)
tree19ff49028b591c07b394160a36a5abf0562e6bed /llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
parent63a0c2bce8e5731f90fc99b75d59f2e85283cb3b (diff)
downloadbcm5719-llvm-450c62e33ea5310481b06d3fd59df911f5451ff2.tar.gz
bcm5719-llvm-450c62e33ea5310481b06d3fd59df911f5451ff2.zip
[Strict FP] Allow more relaxed scheduling
Reimplement scheduling constraints for strict FP instructions in ScheduleDAGInstrs::buildSchedGraph to allow for more relaxed scheduling. Specifially, allow one strict FP instruction to be scheduled across another, as long as it is not moved across any global barrier. Differential Revision: https://reviews.llvm.org/D64412 Reviewed By: cameron.mcinally llvm-svn: 366222
Diffstat (limited to 'llvm/lib/CodeGen/ScheduleDAGInstrs.cpp')
-rw-r--r--llvm/lib/CodeGen/ScheduleDAGInstrs.cpp31
1 files changed, 21 insertions, 10 deletions
diff --git a/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp b/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
index a5380108896..d5ad7e92299 100644
--- a/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
+++ b/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
@@ -712,7 +712,6 @@ void ScheduleDAGInstrs::buildSchedGraph(AliasAnalysis *AA,
AAForDep = UseAA ? AA : nullptr;
BarrierChain = nullptr;
- SUnit *FPBarrierChain = nullptr;
this->TrackLaneMasks = TrackLaneMasks;
MISUnitMap.clear();
@@ -744,6 +743,14 @@ void ScheduleDAGInstrs::buildSchedGraph(AliasAnalysis *AA,
// done.
Value2SUsMap NonAliasStores, NonAliasLoads(1 /*TrueMemOrderLatency*/);
+ // Track all instructions that may raise floating-point exceptions.
+ // These do not depend on one other (or normal loads or stores), but
+ // must not be rescheduled across global barriers. Note that we don't
+ // really need a "map" here since we don't track those MIs by value;
+ // using the same Value2SUsMap data type here is simply a matter of
+ // convenience.
+ Value2SUsMap FPExceptions;
+
// Remove any stale debug info; sometimes BuildSchedGraph is called again
// without emitting the info from the previous call.
DbgValues.clear();
@@ -871,20 +878,24 @@ void ScheduleDAGInstrs::buildSchedGraph(AliasAnalysis *AA,
addBarrierChain(Loads);
addBarrierChain(NonAliasStores);
addBarrierChain(NonAliasLoads);
-
- // Add dependency against previous FP barrier and reset FP barrier.
- if (FPBarrierChain)
- FPBarrierChain->addPredBarrier(BarrierChain);
- FPBarrierChain = BarrierChain;
+ addBarrierChain(FPExceptions);
continue;
}
- // Instructions that may raise FP exceptions depend on each other.
+ // Instructions that may raise FP exceptions may not be moved
+ // across any global barriers.
if (MI.mayRaiseFPException()) {
- if (FPBarrierChain)
- FPBarrierChain->addPredBarrier(SU);
- FPBarrierChain = SU;
+ if (BarrierChain)
+ BarrierChain->addPredBarrier(SU);
+
+ FPExceptions.insert(SU, UnknownValue);
+
+ if (FPExceptions.size() >= HugeRegion) {
+ LLVM_DEBUG(dbgs() << "Reducing FPExceptions map.\n";);
+ Value2SUsMap empty;
+ reduceHugeMemNodeMaps(FPExceptions, empty, getReductionSize());
+ }
}
// If it's not a store or a variant load, we're done.
OpenPOWER on IntegriCloud