aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineCombiner.cpp
diff options
context:
space:
mode:
authorChen Zheng <czhengsz@cn.ibm.com>2020-05-26 22:39:37 -0400
committerChen Zheng <czhengsz@cn.ibm.com>2020-05-31 23:21:04 -0400
commit2a24d350dbeacb131af91e8c438fed2bd81698c0 (patch)
tree6e5a12141e9f9d4339ed6a8313d1a90ae3bef3c2 /llvm/lib/CodeGen/MachineCombiner.cpp
parent3101601b54fbb8062c179e804974b9fb4e2b7c19 (diff)
downloadllvm-2a24d350dbeacb131af91e8c438fed2bd81698c0.zip
llvm-2a24d350dbeacb131af91e8c438fed2bd81698c0.tar.gz
llvm-2a24d350dbeacb131af91e8c438fed2bd81698c0.tar.bz2
[MachineCombine] add a hook for resource length limit
Diffstat (limited to 'llvm/lib/CodeGen/MachineCombiner.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineCombiner.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineCombiner.cpp b/llvm/lib/CodeGen/MachineCombiner.cpp
index 73895bd..34087d0 100644
--- a/llvm/lib/CodeGen/MachineCombiner.cpp
+++ b/llvm/lib/CodeGen/MachineCombiner.cpp
@@ -406,12 +406,14 @@ bool MachineCombiner::preservesResourceLen(
<< ResLenBeforeCombine
<< " and after: " << ResLenAfterCombine << "\n";);
LLVM_DEBUG(
- ResLenAfterCombine <= ResLenBeforeCombine
+ ResLenAfterCombine <=
+ ResLenBeforeCombine + TII->getExtendResourceLenLimit()
? dbgs() << "\t\t As result it IMPROVES/PRESERVES Resource Length\n"
: dbgs() << "\t\t As result it DOES NOT improve/preserve Resource "
"Length\n");
- return ResLenAfterCombine <= ResLenBeforeCombine;
+ return ResLenAfterCombine <=
+ ResLenBeforeCombine + TII->getExtendResourceLenLimit();
}
/// \returns true when new instruction sequence should be generated