73 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 22; RUN: llc < %s -mtriple=riscv32 -target-abi=ilp32f -mattr=+zfa \3; RUN: | FileCheck %s --check-prefix=RV324; RUN: llc < %s -mtriple=riscv64 -target-abi=lp64f -mattr=+zfa \5; RUN: | FileCheck %s --check-prefix=RV646 7; The purpose of this test is to check that an FLI instruction that8; materializes an immediate is not MachineLICM'd out of a loop.9 10%struct.Node = type { ptr, ptr }11 12define void @process_nodes(ptr %0) nounwind {13; RV32-LABEL: process_nodes:14; RV32: # %bb.0: # %entry15; RV32-NEXT: beqz a0, .LBB0_416; RV32-NEXT: # %bb.1: # %loop.preheader17; RV32-NEXT: addi sp, sp, -1618; RV32-NEXT: sw ra, 12(sp) # 4-byte Folded Spill19; RV32-NEXT: sw s0, 8(sp) # 4-byte Folded Spill20; RV32-NEXT: mv s0, a021; RV32-NEXT: .LBB0_2: # %loop22; RV32-NEXT: # =>This Inner Loop Header: Depth=123; RV32-NEXT: fli.s fa0, 1.024; RV32-NEXT: mv a0, s025; RV32-NEXT: call do_it26; RV32-NEXT: lw s0, 0(s0)27; RV32-NEXT: bnez s0, .LBB0_228; RV32-NEXT: # %bb.3:29; RV32-NEXT: lw ra, 12(sp) # 4-byte Folded Reload30; RV32-NEXT: lw s0, 8(sp) # 4-byte Folded Reload31; RV32-NEXT: addi sp, sp, 1632; RV32-NEXT: .LBB0_4: # %exit33; RV32-NEXT: ret34;35; RV64-LABEL: process_nodes:36; RV64: # %bb.0: # %entry37; RV64-NEXT: beqz a0, .LBB0_438; RV64-NEXT: # %bb.1: # %loop.preheader39; RV64-NEXT: addi sp, sp, -1640; RV64-NEXT: sd ra, 8(sp) # 8-byte Folded Spill41; RV64-NEXT: sd s0, 0(sp) # 8-byte Folded Spill42; RV64-NEXT: mv s0, a043; RV64-NEXT: .LBB0_2: # %loop44; RV64-NEXT: # =>This Inner Loop Header: Depth=145; RV64-NEXT: fli.s fa0, 1.046; RV64-NEXT: mv a0, s047; RV64-NEXT: call do_it48; RV64-NEXT: ld s0, 0(s0)49; RV64-NEXT: bnez s0, .LBB0_250; RV64-NEXT: # %bb.3:51; RV64-NEXT: ld ra, 8(sp) # 8-byte Folded Reload52; RV64-NEXT: ld s0, 0(sp) # 8-byte Folded Reload53; RV64-NEXT: addi sp, sp, 1654; RV64-NEXT: .LBB0_4: # %exit55; RV64-NEXT: ret56entry:57 %1 = icmp eq ptr %0, null58 br i1 %1, label %exit, label %loop59 60loop:61 %2 = phi ptr [ %4, %loop ], [ %0, %entry ]62 tail call void @do_it(float 1.000000e+00, ptr nonnull %2)63 %3 = getelementptr inbounds %struct.Node, ptr %2, i64 0, i32 064 %4 = load ptr, ptr %3, align 865 %5 = icmp eq ptr %4, null66 br i1 %5, label %exit, label %loop67 68exit:69 ret void70}71 72declare void @do_it(float, ptr)73