Skip to content

Commit 4075923

Browse files
committed
Update test to check loop invariant motion
1 parent 42f37d5 commit 4075923

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

llvm/test/CodeGen/RISCV/live-variables-pre-regalloc.ll

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,29 @@
1-
; RUN: llc -mtriple riscv64 -mattr=+d -riscv-enable-live-variables --stop-after=riscv-live-variables -riscv-liveness-update-kills < %s | FileCheck %s
1+
; RUN: llc -mtriple riscv64 -mattr=+d -riscv-enable-live-variables \
2+
; RUN: --stop-after=riscv-live-variables -riscv-liveness-update-kills < %s | FileCheck %s
3+
4+
; RUN: llc -mtriple riscv64 -mattr=+d -riscv-enable-live-variables \
5+
; RUN: -riscv-liveness-update-kills < %s | FileCheck --check-prefix=CHECK-LICM %s
26

37
; Issue: #166141 Pessimistic MachineLICM due to missing liveness info.
48

5-
; CHECK: %42:fpr64 = nofpexcept FMUL_D killed %2, killed %41, 7, implicit $frm
9+
; Check that live variable analysis correctly marks %41 as kill
10+
; CHECK: bb.2.if:
11+
; CHECK: successors: %bb.3(0x80000000)
12+
;
13+
; CHECK: %40:gpr = LUI target-flags(riscv-hi) %const.0
14+
; CHECK: %41:fpr64 = FLD killed %40, target-flags(riscv-lo) %const.0 :: (load (s64) from constant-pool)
15+
; CHECK: %42:fpr64 = nofpexcept FMUL_D killed %2, killed %41, 7, implicit $frm
16+
; CHECK: FSD killed %42, %1, 0 :: (store (s64) into %ir.lsr.iv1)
17+
18+
; Check that the loop invariant `fld` is hoisted out of the loop.
19+
; CHECK-LICM: # %bb.0:
20+
; CHECK-LICM: lui a1, %hi(.LCPI0_0)
21+
; CHECK-LICM: fld fa5, %lo(.LCPI0_0)(a1)
22+
; CHECK-LICM: lui a1, 2
23+
; CHECK-LICM: add a1, a0, a1
24+
; CHECK-LICM: fmv.d.x fa4, zero
25+
; CHECK-LICM: j .LBB0_2
26+
; CHECK-LICM: .LBB0_1:
627

728
define void @f(ptr %p) {
829
entry:

0 commit comments

Comments
 (0)