[llvm] [RISCV][GISel] Add gisel-commandline-option.ll similar to AArch64. (PR #65299)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 4 23:36:02 PDT 2023


https://github.com/topperc created https://github.com/llvm/llvm-project/pull/65299:

This allows us to see the pass pipeline for GlobalISel.


>From 550836fb34dff595d4e74777a4d4f2c72fa1b727 Mon Sep 17 00:00:00 2001
From: Craig Topper <craig.topper at sifive.com>
Date: Mon, 4 Sep 2023 23:34:16 -0700
Subject: [PATCH] [RISCV][GISel] Add gisel-commandline-option.ll similar to
 AArch64.

This allows us to see the pass pipeline for GlobalISel.
---
 .../GlobalISel/gisel-commandline-option.ll    | 37 +++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 llvm/test/CodeGen/RISCV/GlobalISel/gisel-commandline-option.ll

diff --git a/llvm/test/CodeGen/RISCV/GlobalISel/gisel-commandline-option.ll b/llvm/test/CodeGen/RISCV/GlobalISel/gisel-commandline-option.ll
new file mode 100644
index 00000000000000..7dec60d368b464
--- /dev/null
+++ b/llvm/test/CodeGen/RISCV/GlobalISel/gisel-commandline-option.ll
@@ -0,0 +1,37 @@
+; RUN: llc -mtriple=riscv64-- -debug-pass=Structure %s -o /dev/null 2>&1 \
+; RUN:   -O0 -global-isel \
+; RUN:   | FileCheck %s --check-prefix ENABLED --check-prefix NOFALLBACK
+
+; RUN: llc -mtriple=riscv64-- -debug-pass=Structure %s -o /dev/null 2>&1 \
+; RUN:   -global-isel \
+; RUN:   | FileCheck %s --check-prefix ENABLED --check-prefix NOFALLBACK  --check-prefix ENABLED-O1
+
+; RUN: llc -mtriple=riscv64-- -debug-pass=Structure %s -o /dev/null 2>&1 \
+; RUN:   -global-isel -global-isel-abort=2 \
+; RUN:   | FileCheck %s --check-prefix ENABLED --check-prefix FALLBACK --check-prefix ENABLED-O1
+
+; RUN: llc -mtriple=riscv64-- -debug-pass=Structure %s -o /dev/null 2>&1 \
+; RUN:   | FileCheck %s --check-prefix DISABLED
+
+; ENABLED:       IRTranslator
+; ENABLED-NEXT:  Analysis containing CSE Info
+; ENABLED-NEXT:  Analysis for ComputingKnownBits
+; ENABLED-NEXT:  Legalizer
+; ENABLED-NEXT:  RegBankSelect
+; ENABLED-NEXT:  Analysis for ComputingKnownBits
+; ENABLED-O1-NEXT:  Lazy Branch Probability Analysis
+; ENABLED-O1-NEXT:  Lazy Block Frequency Analysis
+; ENABLED-NEXT:  InstructionSelect
+; ENABLED-NEXT:  ResetMachineFunction
+
+; FALLBACK:       RISC-V DAG->DAG Pattern Instruction Selection
+; NOFALLBACK-NOT: RISC-V DAG->DAG Pattern Instruction Selection
+
+; DISABLED-NOT: IRTranslator
+
+; DISABLED: RISC-V DAG->DAG Pattern Instruction Selection
+; DISABLED: Finalize ISel and expand pseudo-instructions
+
+define void @empty() {
+  ret void
+}



More information about the llvm-commits mailing list