mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Properly emit range comparisons for switch cases, where neighbour cases
go to the same destination. Now we're producing really good code for switch-lower-feature.ll testcase git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35672 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -82,15 +82,17 @@ public:
|
||||
/// SDISel for the code generation of additional basic blocks needed by multi-
|
||||
/// case switch statements.
|
||||
struct CaseBlock {
|
||||
CaseBlock(ISD::CondCode cc, Value *cmplhs, Value *cmprhs,
|
||||
CaseBlock(ISD::CondCode cc, Value *cmplhs, Value *cmprhs, Value *cmpmiddle,
|
||||
MachineBasicBlock *truebb, MachineBasicBlock *falsebb,
|
||||
MachineBasicBlock *me)
|
||||
: CC(cc), CmpLHS(cmplhs), CmpRHS(cmprhs),
|
||||
: CC(cc), CmpLHS(cmplhs), CmpMHS(cmpmiddle), CmpRHS(cmprhs),
|
||||
TrueBB(truebb), FalseBB(falsebb), ThisBB(me) {}
|
||||
// CC - the condition code to use for the case block's setcc node
|
||||
ISD::CondCode CC;
|
||||
// CmpLHS/CmpRHS - The LHS/RHS of the comparison to emit.
|
||||
Value *CmpLHS, *CmpRHS;
|
||||
// CmpLHS/CmpRHS/CmpMHS - The LHS/MHS/RHS of the comparison to emit.
|
||||
// Emit by default LHS op RHS. MHS is used for range comparisons:
|
||||
// If MHS is not null: (LHS <= MHS) and (MHS <= RHS).
|
||||
Value *CmpLHS, *CmpMHS, *CmpRHS;
|
||||
// TrueBB/FalseBB - the block to branch to if the setcc is true/false.
|
||||
MachineBasicBlock *TrueBB, *FalseBB;
|
||||
// ThisBB - the block into which to emit the code for the setcc and branches
|
||||
|
Reference in New Issue
Block a user