summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2011-04-19 17:01:08 +0000
committerEli Friedman <eli.friedman@gmail.com>2011-04-19 17:01:08 +0000
commitbcd09b3a7f21b60945c84bde1343eabfb2ab2709 (patch)
treea52066f119e800a8cfeefaa6d9797e00176ac870 /llvm/lib/CodeGen
parent0b68c1219f4a9507d8e89379c39e7b2a0f81d9c7 (diff)
downloadbcm5719-llvm-bcd09b3a7f21b60945c84bde1343eabfb2ab2709.tar.gz
bcm5719-llvm-bcd09b3a7f21b60945c84bde1343eabfb2ab2709.zip
SelectBasicBlock is rather slow even when it doesn't do anything; skip the
unnecessary work where possible. llvm-svn: 129763
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 8e599aef7f3..af3188895ed 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -1017,11 +1017,13 @@ void SelectionDAGISel::SelectAllBasicBlocks(const Function &Fn) {
else
++NumFastIselBlocks;
- // Run SelectionDAG instruction selection on the remainder of the block
- // not handled by FastISel. If FastISel is not run, this is the entire
- // block.
- bool HadTailCall;
- SelectBasicBlock(Begin, BI, HadTailCall);
+ if (Begin != BI) {
+ // Run SelectionDAG instruction selection on the remainder of the block
+ // not handled by FastISel. If FastISel is not run, this is the entire
+ // block.
+ bool HadTailCall;
+ SelectBasicBlock(Begin, BI, HadTailCall);
+ }
FinishBasicBlock();
FuncInfo->PHINodesToUpdate.clear();
OpenPOWER on IntegriCloud