summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2017-06-22 15:28:01 +0000
committerSanjay Patel <spatel@rotateright.com>2017-06-22 15:28:01 +0000
commite800df8eac0f5c6e6f463d45c2b096a887fae7ad (patch)
tree7e4ae6eff8b67507188b86d1b4f85b71e8fc86ef /llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
parent636851b8458b0b14a9ae87b04428d487bde29f72 (diff)
downloadbcm5719-llvm-e800df8eac0f5c6e6f463d45c2b096a887fae7ad.tar.gz
bcm5719-llvm-e800df8eac0f5c6e6f463d45c2b096a887fae7ad.zip
[InstCombine] add peekThroughBitcast() helper; NFC
This is an NFC portion of D33517. We have similar helpers in the backend. llvm-svn: 306008
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
index e2eb2ba5d42..2de83a01062 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
@@ -1615,12 +1615,8 @@ static Value *matchSelectFromAndOr(Value *A, Value *C, Value *B, Value *D,
// The potential condition of the select may be bitcasted. In that case, look
// through its bitcast and the corresponding bitcast of the 'not' condition.
Type *OrigType = A->getType();
- Value *SrcA, *SrcB;
- if (match(A, m_OneUse(m_BitCast(m_Value(SrcA)))) &&
- match(B, m_OneUse(m_BitCast(m_Value(SrcB))))) {
- A = SrcA;
- B = SrcB;
- }
+ A = peekThroughBitcast(A, true);
+ B = peekThroughBitcast(B, true);
if (Value *Cond = getSelectCondition(A, B, Builder)) {
// ((bc Cond) & C) | ((bc ~Cond) & D) --> bc (select Cond, (bc C), (bc D))
OpenPOWER on IntegriCloud