summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2018-07-27 09:04:35 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2018-07-27 09:04:35 +0000
commitd1496507600e0e298f37dc3538a9d29776b4688f (patch)
treef63b6b315d23d558b9e88073e99c0a351f8326e7 /llvm/lib
parentcdc92ff2543641393ef5aa4abbfb04931c72975a (diff)
downloadbcm5719-llvm-d1496507600e0e298f37dc3538a9d29776b4688f.tar.gz
bcm5719-llvm-d1496507600e0e298f37dc3538a9d29776b4688f.zip
PatternMatch: Add wrappers for fabs and canonicalize
llvm-svn: 338111
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
index af79851ad36..cbfbd8a5399 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
@@ -2098,8 +2098,8 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) {
}
// fma fabs(x), fabs(x), z -> fma x, x, z
- if (match(Src0, m_Intrinsic<Intrinsic::fabs>(m_Value(X))) &&
- match(Src1, m_Intrinsic<Intrinsic::fabs>(m_Specific(X)))) {
+ if (match(Src0, m_FAbs(m_Value(X))) &&
+ match(Src1, m_FAbs(m_Specific(X)))) {
II->setArgOperand(0, X);
II->setArgOperand(1, X);
return II;
@@ -2146,7 +2146,7 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) {
Value *SrcSrc;
Value *Src = II->getArgOperand(0);
if (match(Src, m_FNeg(m_Value(SrcSrc))) ||
- match(Src, m_Intrinsic<Intrinsic::fabs>(m_Value(SrcSrc)))) {
+ match(Src, m_FAbs(m_Value(SrcSrc)))) {
// cos(-x) -> cos(x)
// cos(fabs(x)) -> cos(x)
II->setArgOperand(0, SrcSrc);
OpenPOWER on IntegriCloud