From e6fc9d40b37495056fa9fcd2fea188cb98726035 Mon Sep 17 00:00:00 2001 From: Manman Ren Date: Thu, 7 Jun 2012 19:27:33 +0000 Subject: [PATCH] PR13046: we can't replace usage of SUB with CMP in the lowering phase. It will cause assertion failure later on. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158160 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86ISelLowering.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index 57f61ab38fc..7b2f13b75d7 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -8306,7 +8306,8 @@ SDValue X86TargetLowering::EmitTest(SDValue Op, unsigned X86CC, if (Opcode == X86ISD::CMP) { SDValue New = DAG.getNode(Opcode, dl, MVT::i32, Op.getOperand(0), Op.getOperand(1)); - DAG.ReplaceAllUsesWith(Op, New); + // We can't replace usage of SUB with CMP. + // The SUB node will be removed later because there is no use of it. return SDValue(New.getNode(), 0); }