mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-18 01:18:33 +00:00
[ARM] Fix crash caused by r294945
I'd missed a creator of FCMP nodes - duplicateCmp(). Kindly and promptly reported by Gabor Ballabas, due to his CSiBE test suite. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294968 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f32a3fd4af
commit
eef9539b00
@ -3812,10 +3812,12 @@ ARMTargetLowering::duplicateCmp(SDValue Cmp, SelectionDAG &DAG) const {
|
||||
Cmp = Cmp.getOperand(0);
|
||||
Opc = Cmp.getOpcode();
|
||||
if (Opc == ARMISD::CMPFP)
|
||||
Cmp = DAG.getNode(Opc, DL, MVT::Glue, Cmp.getOperand(0),Cmp.getOperand(1));
|
||||
Cmp = DAG.getNode(Opc, DL, MVT::Glue, Cmp.getOperand(0),
|
||||
Cmp.getOperand(1), Cmp.getOperand(2));
|
||||
else {
|
||||
assert(Opc == ARMISD::CMPFPw0 && "unexpected operand of FMSTAT");
|
||||
Cmp = DAG.getNode(Opc, DL, MVT::Glue, Cmp.getOperand(0));
|
||||
Cmp = DAG.getNode(Opc, DL, MVT::Glue, Cmp.getOperand(0),
|
||||
Cmp.getOperand(1));
|
||||
}
|
||||
return DAG.getNode(ARMISD::FMSTAT, DL, MVT::Glue, Cmp);
|
||||
}
|
||||
|
11
test/CodeGen/ARM/vcmp-crash.ll
Normal file
11
test/CodeGen/ARM/vcmp-crash.ll
Normal file
@ -0,0 +1,11 @@
|
||||
; RUN: llc -mcpu=cortex-m4 < %s | FileCheck %s
|
||||
|
||||
target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
|
||||
target triple = "thumbv7em-none--eabi"
|
||||
|
||||
; CHECK: vcmp.f32
|
||||
define double @f(double %a, double %b, double %c, float %d) {
|
||||
%1 = fcmp oeq float %d, 0.0
|
||||
%2 = select i1 %1, double %a, double %c
|
||||
ret double %2
|
||||
}
|
Loading…
Reference in New Issue
Block a user