summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2017-08-14 19:09:32 +0000
committerCraig Topper <craig.topper@intel.com>2017-08-14 19:09:32 +0000
commit69fa8e0d99177045e5ad3bef42360c635736c428 (patch)
treee2950fb3e5fe4cd4229e6d01624f82b80cdd8937 /llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
parent9c7b881677f65fce8cfbc6ec70c44790576b6ea5 (diff)
downloadbcm5719-llvm-69fa8e0d99177045e5ad3bef42360c635736c428.tar.gz
bcm5719-llvm-69fa8e0d99177045e5ad3bef42360c635736c428.zip
Revert r310869 "[InstSimplify][InstCombine] Modify the interface of decomposeBitTestICmp and use it in the InstSimplify"
Failed to add the two files that moved. And then added an extra change I didn't mean to while trying to fix that. Reverting everything. llvm-svn: 310873
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp18
1 files changed, 3 insertions, 15 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
index dc5b5bfefe6..dfc2ea3e4de 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
@@ -12,11 +12,11 @@
//===----------------------------------------------------------------------===//
#include "InstCombineInternal.h"
-#include "llvm/Analysis/CmpInstAnalysis.h"
#include "llvm/Analysis/InstructionSimplify.h"
#include "llvm/IR/ConstantRange.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/PatternMatch.h"
+#include "llvm/Transforms/Utils/CmpInstAnalysis.h"
#include "llvm/Transforms/Utils/Local.h"
using namespace llvm;
using namespace PatternMatch;
@@ -292,18 +292,6 @@ static unsigned conjugateICmpMask(unsigned Mask) {
return NewMask;
}
-// Adapts the external decomposeBitTestICmp for local use.
-static bool decomposeBitTestICmp(Value *LHS, Value *RHS, CmpInst::Predicate &Pred,
- Value *&X, Value *&Y, Value *&Z) {
- APInt Mask;
- if (!llvm::decomposeBitTestICmp(LHS, RHS, Pred, X, Mask))
- return false;
-
- Y = ConstantInt::get(X->getType(), Mask);
- Z = ConstantInt::get(X->getType(), 0);
- return true;
-}
-
/// Handle (icmp(A & B) ==/!= C) &/| (icmp(A & D) ==/!= E).
/// Return the set of pattern classes (from MaskedICmpType) that both LHS and
/// RHS satisfy.
@@ -328,7 +316,7 @@ static unsigned getMaskedTypeForICmpPair(Value *&A, Value *&B, Value *&C,
Value *L2 = LHS->getOperand(1);
Value *L11, *L12, *L21, *L22;
// Check whether the icmp can be decomposed into a bit test.
- if (decomposeBitTestICmp(L1, L2, PredL, L11, L12, L2)) {
+ if (decomposeBitTestICmp(LHS, PredL, L11, L12, L2)) {
L21 = L22 = L1 = nullptr;
} else {
// Look for ANDs in the LHS icmp.
@@ -359,7 +347,7 @@ static unsigned getMaskedTypeForICmpPair(Value *&A, Value *&B, Value *&C,
Value *R2 = RHS->getOperand(1);
Value *R11, *R12;
bool Ok = false;
- if (decomposeBitTestICmp(R1, R2, PredR, R11, R12, R2)) {
+ if (decomposeBitTestICmp(RHS, PredR, R11, R12, R2)) {
if (R11 == L11 || R11 == L12 || R11 == L21 || R11 == L22) {
A = R11;
D = R12;
OpenPOWER on IntegriCloud