aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Scalar/InstructionCombining.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-07-23 17:10:17 +0000
committerChris Lattner <sabre@nondot.org>2007-07-23 17:10:17 +0000
commitd78ccfd4f024401f979345bbcdcad428b98d5cc7 (patch)
tree94a4dcf81a6d60dc43902254088659e48a269e53 /lib/Transforms/Scalar/InstructionCombining.cpp
parenta524e0e63d6c78172343ab58e89300e1c640595e (diff)
downloadexternal_llvm-d78ccfd4f024401f979345bbcdcad428b98d5cc7.zip
external_llvm-d78ccfd4f024401f979345bbcdcad428b98d5cc7.tar.gz
external_llvm-d78ccfd4f024401f979345bbcdcad428b98d5cc7.tar.bz2
completely remove a transformation that is unsafe in the face of
undefs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40439 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/InstructionCombining.cpp')
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp36
1 files changed, 0 insertions, 36 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 564b981..36e1fc2 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -3870,42 +3870,6 @@ Instruction *InstCombiner::visitOr(BinaryOperator &I) {
InsertNewInstBefore(BinaryOperator::createOr(V2, V3, "tmp"), I);
return BinaryOperator::createAnd(V1, Or);
}
-
- // (V1 & V3)|(V2 & ~V3) -> ((V1 ^ V2) & V3) ^ V2
- // Disable this transformations temporarily. This causes
- // mis-compilation when V2 is undefined.
- if (0 && isOnlyUse(Op0) && isOnlyUse(Op1)) {
- // Try all combination of terms to find V3 and ~V3.
- if (A->hasOneUse() && match(A, m_Not(m_Value(V3)))) {
- if (V3 == B)
- V1 = D, V2 = C;
- else if (V3 == D)
- V1 = B, V2 = C;
- }
- if (B->hasOneUse() && match(B, m_Not(m_Value(V3)))) {
- if (V3 == A)
- V1 = C, V2 = D;
- else if (V3 == C)
- V1 = A, V2 = D;
- }
- if (C->hasOneUse() && match(C, m_Not(m_Value(V3)))) {
- if (V3 == B)
- V1 = D, V2 = A;
- else if (V3 == D)
- V1 = B, V2 = A;
- }
- if (D->hasOneUse() && match(D, m_Not(m_Value(V3)))) {
- if (V3 == A)
- V1 = C, V2 = B;
- else if (V3 == C)
- V1 = A, V2 = B;
- }
- if (V1) {
- A = InsertNewInstBefore(BinaryOperator::createXor(V1, V2, "tmp"), I);
- A = InsertNewInstBefore(BinaryOperator::createAnd(A, V3, "tmp"), I);
- return BinaryOperator::createXor(A, V2);
- }
- }
}
}