Skip to content

Commit

Permalink
[RISCV] Add RUNs for different postra scheduling directions
Browse files Browse the repository at this point in the history
To `macro-fusion-lui-addi.ll`.

This is the precommit change for #116584.
  • Loading branch information
wangpc-pp committed Dec 10, 2024
1 parent f8c1a22 commit 9730760
Showing 1 changed file with 28 additions and 7 deletions.
35 changes: 28 additions & 7 deletions llvm/test/CodeGen/RISCV/macro-fusion-lui-addi.ll
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@
;RUN: llc < %s -mtriple=riscv64 -mattr=+f,+lui-addi-fusion -mcpu=sifive-u74 \
;RUN: -target-abi=lp64f | FileCheck %s --check-prefix=FUSION
;RUN: llc < %s -mtriple=riscv64 -mattr=+f,+lui-addi-fusion,+use-postra-scheduler -mcpu=sifive-u74 \
;RUN: -target-abi=lp64f | FileCheck %s --check-prefixes=FUSION-POSTRA
;RUN: -misched-postra-direction=topdown -target-abi=lp64f \
;RUN: | FileCheck %s --check-prefixes=FUSION-POSTRA,FUSION-POSTRA-TOPDOWN
;RUN: llc < %s -mtriple=riscv64 -mattr=+f,+lui-addi-fusion,+use-postra-scheduler -mcpu=sifive-u74 \
;RUN: -misched-postra-direction=bottomup -target-abi=lp64f \
;RUN: | FileCheck %s --check-prefixes=FUSION-POSTRA,FUSION-POSTRA-BOTTOMUP
;RUN: llc < %s -mtriple=riscv64 -mattr=+f,+lui-addi-fusion,+use-postra-scheduler -mcpu=sifive-u74 \
;RUN: -misched-postra-direction=bidirectional -target-abi=lp64f \
;RUN: | FileCheck %s --check-prefixes=FUSION-POSTRA,FUSION-POSTRA-BIDIRECTIONAL

@.str = private constant [4 x i8] c"%f\0A\00", align 1

Expand All @@ -23,12 +30,26 @@ define void @foo(i32 signext %0, i32 signext %1) {
; FUSION-NEXT: fcvt.s.w fa0, a1
; FUSION-NEXT: tail bar
;
; FUSION-POSTRA-LABEL: foo:
; FUSION-POSTRA: # %bb.0:
; FUSION-POSTRA-NEXT: lui a0, %hi(.L.str)
; FUSION-POSTRA-NEXT: addi a0, a0, %lo(.L.str)
; FUSION-POSTRA-NEXT: fcvt.s.w fa0, a1
; FUSION-POSTRA-NEXT: tail bar
; FUSION-POSTRA-TOPDOWN-LABEL: foo:
; FUSION-POSTRA-TOPDOWN: # %bb.0:
; FUSION-POSTRA-TOPDOWN-NEXT: lui a0, %hi(.L.str)
; FUSION-POSTRA-TOPDOWN-NEXT: addi a0, a0, %lo(.L.str)
; FUSION-POSTRA-TOPDOWN-NEXT: fcvt.s.w fa0, a1
; FUSION-POSTRA-TOPDOWN-NEXT: tail bar
;
; FUSION-POSTRA-BOTTOMUP-LABEL: foo:
; FUSION-POSTRA-BOTTOMUP: # %bb.0:
; FUSION-POSTRA-BOTTOMUP-NEXT: fcvt.s.w fa0, a1
; FUSION-POSTRA-BOTTOMUP-NEXT: lui a0, %hi(.L.str)
; FUSION-POSTRA-BOTTOMUP-NEXT: addi a0, a0, %lo(.L.str)
; FUSION-POSTRA-BOTTOMUP-NEXT: tail bar
;
; FUSION-POSTRA-BIDIRECTIONAL-LABEL: foo:
; FUSION-POSTRA-BIDIRECTIONAL: # %bb.0:
; FUSION-POSTRA-BIDIRECTIONAL-NEXT: lui a0, %hi(.L.str)
; FUSION-POSTRA-BIDIRECTIONAL-NEXT: fcvt.s.w fa0, a1
; FUSION-POSTRA-BIDIRECTIONAL-NEXT: addi a0, a0, %lo(.L.str)
; FUSION-POSTRA-BIDIRECTIONAL-NEXT: tail bar
%3 = sitofp i32 %1 to float
tail call void @bar(ptr @.str, float %3)
ret void
Expand Down

0 comments on commit 9730760

Please sign in to comment.