diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp b/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp --- a/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp @@ -2567,22 +2567,6 @@ Value *FalseVal = SI.getFalseValue(); Type *SelType = SI.getType(); - // FIXME: Remove this workaround when freeze related patches are done. - // For select with undef operand which feeds into an equality comparison, - // don't simplify it so loop unswitch can know the equality comparison - // may have an undef operand. This is a workaround for PR31652 caused by - // descrepancy about branch on undef between LoopUnswitch and GVN. - if (match(TrueVal, m_Undef()) || match(FalseVal, m_Undef())) { - if (llvm::any_of(SI.users(), [&](User *U) { - ICmpInst *CI = dyn_cast(U); - if (CI && CI->isEquality()) - return true; - return false; - })) { - return nullptr; - } - } - if (Value *V = SimplifySelectInst(CondVal, TrueVal, FalseVal, SQ.getWithInstruction(&SI))) return replaceInstUsesWith(SI, V);