summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/Reassociate.cpp
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@codeaurora.org>2014-11-11 23:36:42 +0000
committerChad Rosier <mcrosier@codeaurora.org>2014-11-11 23:36:42 +0000
commitf53f07046b2cfcc92f66cc330a05ba6efd7a7f44 (patch)
treea9f295831f1a42f6ae4f9d376087fbd184f20a55 /llvm/lib/Transforms/Scalar/Reassociate.cpp
parent66c6de61eea9d88061648fe505f420b7cb958df5 (diff)
downloadbcm5719-llvm-f53f07046b2cfcc92f66cc330a05ba6efd7a7f44.tar.gz
bcm5719-llvm-f53f07046b2cfcc92f66cc330a05ba6efd7a7f44.zip
[Reassociate] Canonicalize negative constants out of expressions.
Add support for FDiv, which was regressed by the previous commit. llvm-svn: 221738
Diffstat (limited to 'llvm/lib/Transforms/Scalar/Reassociate.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/Reassociate.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/Reassociate.cpp b/llvm/lib/Transforms/Scalar/Reassociate.cpp
index 7cde3ab6be8..a24d3d454f6 100644
--- a/llvm/lib/Transforms/Scalar/Reassociate.cpp
+++ b/llvm/lib/Transforms/Scalar/Reassociate.cpp
@@ -1955,7 +1955,8 @@ Instruction *Reassociate::canonicalizeNegConstExpr(Instruction *I) {
// Must be a mul instruction.
unsigned Opcode = I->getOpcode();
- if (Opcode != Instruction::Mul && Opcode != Instruction::FMul)
+ if (Opcode != Instruction::Mul && Opcode != Instruction::FMul &&
+ Opcode != Instruction::FDiv)
return nullptr;
// Must have at least one constant operand.
OpenPOWER on IntegriCloud