diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2011-03-31 10:11:58 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2011-03-31 10:11:58 +0000 |
commit | 2ccfbc8b71aa094476cf6a746d6dfd9a2b2a734c (patch) | |
tree | 4cbe768c5c98217b8621e2536dc7285aaf8198f7 /llvm/lib/Transforms | |
parent | 7c2b338a7ef4c653e01f71552640446bd20af599 (diff) | |
download | bcm5719-llvm-2ccfbc8b71aa094476cf6a746d6dfd9a2b2a734c.tar.gz bcm5719-llvm-2ccfbc8b71aa094476cf6a746d6dfd9a2b2a734c.zip |
InstCombine: fold fcmp (fpext x), (fpext y) -> fcmp x, y.
llvm-svn: 128624
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp index 8787e2ae0e0..698b715fd8b 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp @@ -2813,5 +2813,12 @@ Instruction *InstCombiner::visitFCmpInst(FCmpInst &I) { } } + // fcmp (fpext x), (fpext y) -> fcmp x, y + if (FPExtInst *LHSExt = dyn_cast<FPExtInst>(Op0)) + if (FPExtInst *RHSExt = dyn_cast<FPExtInst>(Op1)) + if (LHSExt->getSrcTy() == RHSExt->getSrcTy()) + return new FCmpInst(I.getPredicate(), LHSExt->getOperand(0), + RHSExt->getOperand(0)); + return Changed ? &I : 0; } |