Switch SimplifyCFG over to the TargetTransformInfo interface rather than
authorChandler Carruth <chandlerc@gmail.com>
Sat, 5 Jan 2013 10:05:26 +0000 (10:05 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sat, 5 Jan 2013 10:05:26 +0000 (10:05 +0000)
the ScalarTargetTransformInfo interface.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171617 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/SimplifyCFG.cpp

index 321a744b8d2489835bda78836042f2ba0bd32afa..d4039507dc4158630d485fb9791a07b238949827 100644 (file)
@@ -3523,8 +3523,7 @@ static bool ShouldBuildLookupTable(SwitchInst *SI,
     Type *Ty = I->second;
 
     // Saturate this flag to true.
-    HasIllegalType = HasIllegalType ||
-      !TTI->getScalarTargetTransformInfo()->isTypeLegal(Ty);
+    HasIllegalType = HasIllegalType || !TTI->isTypeLegal(Ty);
 
     // Saturate this flag to false.
     AllTablesFitInRegister = AllTablesFitInRegister &&
@@ -3561,8 +3560,7 @@ static bool SwitchToLookupTable(SwitchInst *SI,
   assert(SI->getNumCases() > 1 && "Degenerate switch?");
 
   // Only build lookup table when we have a target that supports it.
-  if (!TTI || !TTI->getScalarTargetTransformInfo() ||
-      !TTI->getScalarTargetTransformInfo()->shouldBuildLookupTables())
+  if (!TTI || !TTI->shouldBuildLookupTables())
     return false;
 
   // FIXME: If the switch is too sparse for a lookup table, perhaps we could