diff --git a/llvm/lib/Transforms/Scalar/DFAJumpThreading.cpp b/llvm/lib/Transforms/Scalar/DFAJumpThreading.cpp index 434b55868c99d..22cb385652644 100644 --- a/llvm/lib/Transforms/Scalar/DFAJumpThreading.cpp +++ b/llvm/lib/Transforms/Scalar/DFAJumpThreading.cpp @@ -521,7 +521,7 @@ struct MainSwitch { Instruction *SIUse = dyn_cast(SI->user_back()); // The use of the select inst should be either a phi or another select. - if (!SIUse && !(isa(SIUse) || isa(SIUse))) + if (!SIUse || !(isa(SIUse) || isa(SIUse))) return false; BasicBlock *SIBB = SI->getParent();