aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprScalar.cpp
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2012-10-04 03:23:25 +0000
committerLang Hames <lhames@gmail.com>2012-10-04 03:23:25 +0000
commitff4ae6d4031962a7c4fdd344f40a91f0fcd26a64 (patch)
tree2a6373b10d47407f9c3a9983731cbc268c93d429 /lib/CodeGen/CGExprScalar.cpp
parenteddb00a704ed39ea781693cf8fcf7cc69a175b95 (diff)
Fail early with a clear assert if an operation with multiple uses somehow ends
up being contracted during codegen. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165197 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprScalar.cpp')
-rw-r--r--lib/CodeGen/CGExprScalar.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp
index 0d68ff5a69..0e8afb04d0 100644
--- a/lib/CodeGen/CGExprScalar.cpp
+++ b/lib/CodeGen/CGExprScalar.cpp
@@ -2045,11 +2045,15 @@ static Value* tryEmitFMulAdd(const BinOpInfo &op,
// We have a potentially fusable op. Look for a mul on one of the operands.
if (llvm::BinaryOperator* LHSBinOp = dyn_cast<llvm::BinaryOperator>(op.LHS)) {
if (LHSBinOp->getOpcode() == llvm::Instruction::FMul) {
+ assert(LHSBinOp->getNumUses() == 0 &&
+ "Operations with multiple uses shouldn't be contracted.");
return buildFMulAdd(LHSBinOp, op.RHS, CGF, Builder, false, isSub);
}
} else if (llvm::BinaryOperator* RHSBinOp =
dyn_cast<llvm::BinaryOperator>(op.RHS)) {
if (RHSBinOp->getOpcode() == llvm::Instruction::FMul) {
+ assert(RHSBinOp->getNumUses() == 0 &&
+ "Operations with multiple uses shouldn't be contracted.");
return buildFMulAdd(RHSBinOp, op.LHS, CGF, Builder, isSub, false);
}
}