brintos

brintos / llvm-project-archived public Read only

0
0
Text · 934 B · 25b5e0c Raw
28 lines · plain
1; RUN: llc -mtriple=aarch64-none-linux-gnu -verify-machineinstrs -o - %s | FileCheck %s2 3; We used to not mark NZCV as being used in the continuation basic-block4; when lowering a 128-bit "select" to branches. This meant a subsequent use5; of the same flags gave an internal fault here.6 7declare void @foo(fp128)8 9define double @test_f128csel_flags(i32 %lhs, fp128 %a, fp128 %b) nounwind {10; CHECK: test_f128csel_flags11 12    %tst = icmp ne i32 %lhs, 4213    %val = select i1 %tst, fp128 %a, fp128 %b14; CHECK: cmp w0, #4215; CHECK: b.eq .LBB016 17    call void @foo(fp128 %val)18    %retval = select i1 %tst, double 4.0, double 5.019 20    ; It's also reasonably important that the actual fcsel comes before the21    ; function call since bl may corrupt NZCV. We were doing the right thing anyway,22    ; but just as well test it while we're here.23; CHECK: fcsel {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}, ne24; CHECK: bl foo25 26    ret double %retval27}28