[CodeGenPrepare] Delete dead !DL check
authorFangrui Song <maskray@google.com>
Sun, 2 Feb 2020 17:45:48 +0000 (09:45 -0800)
committerFangrui Song <maskray@google.com>
Sun, 2 Feb 2020 17:49:06 +0000 (09:49 -0800)
Follow-up for D73754

DL is assigned in CodeGenPrepare::runOnFunction and is guaranteed to be
non-null.

llvm/lib/CodeGen/CodeGenPrepare.cpp

index 5dcda73..38563b5 100644 (file)
@@ -1811,9 +1811,6 @@ static bool despeculateCountZeros(IntrinsicInst *CountZeros,
                                   const TargetLowering *TLI,
                                   const DataLayout *DL,
                                   bool &ModifiedDT) {
-  if (!DL)
-    return false;
-
   // If a zero input is undefined, it doesn't make sense to despeculate that.
   if (match(CountZeros->getOperand(1), m_One()))
     return false;
@@ -6344,9 +6341,6 @@ bool CodeGenPrepare::tryToSinkFreeOperands(Instruction *I) {
 }
 
 bool CodeGenPrepare::optimizeSwitchInst(SwitchInst *SI) {
-  if (!DL)
-    return false;
-
   Value *Cond = SI->getCondition();
   Type *OldType = Cond->getType();
   LLVMContext &Context = Cond->getContext();