diff options
author | Lang Hames <lhames@gmail.com> | 2012-10-04 03:23:25 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2012-10-04 03:23:25 +0000 |
commit | 4c8559e0a138ad0b63ce026cb30701bbc9940451 (patch) | |
tree | 95cb3d8eb858a16f15b32e5a95b19bcbff2d77d9 /clang/lib/CodeGen/CGExprScalar.cpp | |
parent | 05a3e31a21d5dfe629dbb900c4fbd4fd17e1318c (diff) | |
download | bcm5719-llvm-4c8559e0a138ad0b63ce026cb30701bbc9940451.tar.gz bcm5719-llvm-4c8559e0a138ad0b63ce026cb30701bbc9940451.zip |
Fail early with a clear assert if an operation with multiple uses somehow ends
up being contracted during codegen.
llvm-svn: 165197
Diffstat (limited to 'clang/lib/CodeGen/CGExprScalar.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGExprScalar.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp index 0d68ff5a69c..0e8afb04d00 100644 --- a/clang/lib/CodeGen/CGExprScalar.cpp +++ b/clang/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); } } |