diff options
| author | Chad Rosier <mcrosier@codeaurora.org> | 2014-11-11 23:36:42 +0000 |
|---|---|---|
| committer | Chad Rosier <mcrosier@codeaurora.org> | 2014-11-11 23:36:42 +0000 |
| commit | f53f07046b2cfcc92f66cc330a05ba6efd7a7f44 (patch) | |
| tree | a9f295831f1a42f6ae4f9d376087fbd184f20a55 /llvm/lib/Transforms/Scalar/Reassociate.cpp | |
| parent | 66c6de61eea9d88061648fe505f420b7cb958df5 (diff) | |
| download | bcm5719-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.cpp | 3 |
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. |

