[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Nate Begeman
natebegeman at mac.com
Mon May 8 09:51:49 PDT 2006
Changes in directory llvm/lib/CodeGen/SelectionDAG:
SelectionDAGISel.cpp updated: 1.236 -> 1.237
---
Log message:
Make emission of jump tables a bit less conservative; they are now required
to be only 31.25% dense, rather than 75% dense.
---
Diffs of the changes: (+4 -4)
SelectionDAGISel.cpp | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.236 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.237
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.236 Sat May 6 04:10:37 2006
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon May 8 11:51:36 2006
@@ -880,9 +880,9 @@
const BasicBlock *LLVMBB = CurMBB->getBasicBlock();
Reloc::Model Relocs = TLI.getTargetMachine().getRelocationModel();
- // If the switch has more than 5 blocks, and at least 75% dense, then emit a
- // jump table rather than lowering the switch to a binary tree of conditional
- // branches.
+ // If the switch has more than 5 blocks, and at least 31.25% dense, and the
+ // target supports indirect branches, then emit a jump table rather than
+ // lowering the switch to a binary tree of conditional branches.
// FIXME: Make this work with PIC code
if (TLI.isOperationLegal(ISD::BRIND, TLI.getPointerTy()) &&
(Relocs == Reloc::Static || Relocs == Reloc::DynamicNoPIC) &&
@@ -891,7 +891,7 @@
uint64_t Last = cast<ConstantIntegral>(Cases.back().first)->getRawValue();
double Density = (double)Cases.size() / (double)((Last - First) + 1ULL);
- if (Density >= 0.75) {
+ if (Density >= 0.3125) {
// Create a new basic block to hold the code for loading the address
// of the jump table, and jumping to it. Update successor information;
// we will either branch to the default case for the switch, or the jump
More information about the llvm-commits
mailing list