SelectionDAGISel can now natively handle Switch instructions, in the same
authorNate Begeman <natebegeman@mac.com>
Mon, 27 Mar 2006 01:32:24 +0000 (01:32 +0000)
committerNate Begeman <natebegeman@mac.com>
Mon, 27 Mar 2006 01:32:24 +0000 (01:32 +0000)
commitf15485a8d0dff5f720b7ad27346129ac5c3ec503
treebd4a5e97dbebfdd53e3eb69083ae1915d132211b
parentfbcf23c3c12449c264f1448a2eee524be0b799f7
SelectionDAGISel can now natively handle Switch instructions, in the same
manner that the LowerSwitch LLVM to LLVM pass does: emitting a binary
search tree of basic blocks.  The new approach has several advantages:
it is faster, it generates significantly smaller code in many cases, and
it paves the way for implementing dense switch tables as a jump table by
handling switches directly in the instruction selector.

This functionality is currently only enabled on x86, but should be safe for
every target.  In anticipation of making it the default, the cfg is now
properly updated in the x86, ppc, and sparc select lowering code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27156 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/SelectionDAGISel.h
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
lib/Target/PowerPC/PPCISelLowering.cpp
lib/Target/Sparc/SparcISelDAGToDAG.cpp
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86TargetMachine.cpp