mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-24 08:24:33 +00:00
Use TargetTransformInfo to control switch-to-lookup table transformation
When the switch-to-lookup tables transform landed in SimplifyCFG, it was pointed out that this could be inappropriate for some targets. Since there was no way at the time for the pass to know anything about the target, an awkward reverse-transform was added in CodeGenPrepare that turned lookup tables back into switches for some targets. This patch uses the new TargetTransformInfo to determine if a switch should be transformed, and removes CodeGenPrepare::ConvertLoadToSwitch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167011 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -37,6 +37,7 @@ class AllocaInst;
|
||||
class ConstantExpr;
|
||||
class DataLayout;
|
||||
class TargetLibraryInfo;
|
||||
class TargetTransformInfo;
|
||||
class DIBuilder;
|
||||
|
||||
template<typename T> class SmallVectorImpl;
|
||||
@ -134,7 +135,8 @@ bool EliminateDuplicatePHINodes(BasicBlock *BB);
|
||||
/// of the CFG. It returns true if a modification was made, possibly deleting
|
||||
/// the basic block that was pointed to.
|
||||
///
|
||||
bool SimplifyCFG(BasicBlock *BB, const DataLayout *TD = 0);
|
||||
bool SimplifyCFG(BasicBlock *BB, const DataLayout *TD = 0,
|
||||
const TargetTransformInfo *TTI = 0);
|
||||
|
||||
/// FoldBranchToCommonDest - If this basic block is ONLY a setcc and a branch,
|
||||
/// and if a predecessor branches to us and one of our successors, fold the
|
||||
|
Reference in New Issue
Block a user