summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2018-10-13 16:15:37 +0000
committerSanjay Patel <spatel@rotateright.com>2018-10-13 16:15:37 +0000
commit47579b21e2043a69832a1378e85f1e545abfef08 (patch)
tree2f0dda4702edd27635e61d71851bceac0bb24032 /llvm/lib/Transforms
parentc5d7c6e5f68476fae3144fb2500bbf6d807555b3 (diff)
downloadbcm5719-llvm-47579b21e2043a69832a1378e85f1e545abfef08.tar.gz
bcm5719-llvm-47579b21e2043a69832a1378e85f1e545abfef08.zip
[InstCombine] fix complexity canonicalization with fake unary vector ops
This is a preliminary step to avoid regressions when we add an actual 'fneg' instruction to IR. See D52934 and D53205. llvm-svn: 344458
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineInternal.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineInternal.h b/llvm/lib/Transforms/InstCombine/InstCombineInternal.h
index 46c598d4bfb..3a18744e434 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineInternal.h
+++ b/llvm/lib/Transforms/InstCombine/InstCombineInternal.h
@@ -82,8 +82,8 @@ class User;
/// 5 -> Other instructions
static inline unsigned getComplexity(Value *V) {
if (isa<Instruction>(V)) {
- if (isa<CastInst>(V) || BinaryOperator::isNeg(V) ||
- BinaryOperator::isFNeg(V) || BinaryOperator::isNot(V))
+ if (isa<CastInst>(V) || match(V, m_Neg(m_Value())) ||
+ match(V, m_Not(m_Value())) || match(V, m_FNeg(m_Value())))
return 4;
return 5;
}
OpenPOWER on IntegriCloud