diff options
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/StructurizeCFG.cpp | 10 | 
1 files changed, 2 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp b/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp index be9b6e4534c..e9ac39beae5 100644 --- a/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp +++ b/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp @@ -377,14 +377,8 @@ void StructurizeCFG::analyzeLoops(RegionNode *N) {  /// \brief Invert the given condition  Value *StructurizeCFG::invert(Value *Condition) {    // First: Check if it's a constant -  if (Condition == BoolTrue) -    return BoolFalse; - -  if (Condition == BoolFalse) -    return BoolTrue; - -  if (Condition == BoolUndef) -    return BoolUndef; +  if (Constant *C = dyn_cast<Constant>(Condition)) +    return ConstantExpr::getNot(C);    // Second: If the condition is already inverted, return the original value    if (match(Condition, m_Not(m_Value(Condition))))  | 

