Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit 6eac2ba

Browse files
committed
SimplifyCFG: Don't assume non-null ScalarTargetTransformInfo.
Patch by Pekka Jääskeläinen! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168176 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 1358841 commit 6eac2ba

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/Transforms/Utils/SimplifyCFG.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3539,7 +3539,8 @@ static bool SwitchToLookupTable(SwitchInst *SI,
35393539
assert(SI->getNumCases() > 1 && "Degenerate switch?");
35403540

35413541
// Only build lookup table when we have a target that supports it.
3542-
if (!TTI || !TTI->getScalarTargetTransformInfo()->shouldBuildLookupTables())
3542+
if (!TTI || !TTI->getScalarTargetTransformInfo() ||
3543+
!TTI->getScalarTargetTransformInfo()->shouldBuildLookupTables())
35433544
return false;
35443545

35453546
// FIXME: If the switch is too sparse for a lookup table, perhaps we could

0 commit comments

Comments
 (0)