mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 08:17:40 +00:00
Only do switch-to-lookup table transformation when TargetTransformInfo
is available. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167552 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -3538,7 +3538,8 @@ static bool SwitchToLookupTable(SwitchInst *SI,
|
||||
const TargetTransformInfo *TTI) {
|
||||
assert(SI->getNumCases() > 1 && "Degenerate switch?");
|
||||
|
||||
if (TTI && !TTI->getScalarTargetTransformInfo()->shouldBuildLookupTables())
|
||||
// Only build lookup table when we have a target that supports it.
|
||||
if (!TTI || !TTI->getScalarTargetTransformInfo()->shouldBuildLookupTables())
|
||||
return false;
|
||||
|
||||
// FIXME: If the switch is too sparse for a lookup table, perhaps we could
|
||||
|
||||
Reference in New Issue
Block a user