This transform is not safe. Thanks to Eli for pointing that out!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137575 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Transforms/InstCombine/InstructionCombining.cpp b/lib/Transforms/InstCombine/InstructionCombining.cpp
index 4166636..41d542a 100644
--- a/lib/Transforms/InstCombine/InstructionCombining.cpp
+++ b/lib/Transforms/InstCombine/InstructionCombining.cpp
@@ -294,14 +294,7 @@
         I.setOperand(1, Folded);
         // Conservatively clear the optional flags, since they may not be
         // preserved by the reassociation.
-        if (MaintainNoSignedWrap(I, C1, C2) && Op0->hasNoSignedWrap() &&
-	    Op1->hasNoSignedWrap()) {
-          New->setHasNoSignedWrap(true);
-          I.clearSubclassOptionalData();
-          I.setHasNoSignedWrap(true);
-        } else {
-          I.clearSubclassOptionalData();
-        }
+        I.clearSubclassOptionalData();
 
         Changed = true;
         continue;