aboutsummaryrefslogtreecommitdiff
path: root/third_party/llvm/llvm/test/CodeGen/RISCV/macro-fusion-logic-reg-imm.mir
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/llvm/llvm/test/CodeGen/RISCV/macro-fusion-logic-reg-imm.mir')
-rw-r--r--third_party/llvm/llvm/test/CodeGen/RISCV/macro-fusion-logic-reg-imm.mir62
1 files changed, 62 insertions, 0 deletions
diff --git a/third_party/llvm/llvm/test/CodeGen/RISCV/macro-fusion-logic-reg-imm.mir b/third_party/llvm/llvm/test/CodeGen/RISCV/macro-fusion-logic-reg-imm.mir
new file mode 100644
index 0000000..eba113b
--- /dev/null
+++ b/third_party/llvm/llvm/test/CodeGen/RISCV/macro-fusion-logic-reg-imm.mir
@@ -0,0 +1,62 @@
+# REQUIRES: asserts
+# RUN: llc -mtriple=riscv64-linux-gnu -x=mir < %s \
+# RUN: -debug-only=machine-scheduler -start-before=machine-scheduler 2>&1 \
+# RUN: -mattr=+fusion-logic-reg-imm | FileCheck %s
+
+# Test logic register-immediate fusion: AND/OR/XOR + ANDI/ORI/XORI
+# This fusion combines a logic operation on registers followed by
+# a logic operation with an immediate.
+
+# CHECK: and_andi
+# CHECK: Macro fuse: {{.*}}AND - ANDI
+---
+name: and_andi
+tracksRegLiveness: true
+body: |
+ bb.0.entry:
+ liveins: $x10, $x11
+ %1:gpr = COPY $x10
+ %2:gpr = COPY $x11
+ %3:gpr = AND %1, %2
+ %4:gpr = XORI %2, 3
+ %5:gpr = ANDI %3, 255
+ $x10 = COPY %4
+ $x11 = COPY %5
+ PseudoRET
+...
+
+# CHECK: or_ori
+# CHECK: Macro fuse: {{.*}}OR - ORI
+---
+name: or_ori
+tracksRegLiveness: true
+body: |
+ bb.0.entry:
+ liveins: $x10, $x11
+ %1:gpr = COPY $x10
+ %2:gpr = COPY $x11
+ %3:gpr = OR %1, %2
+ %4:gpr = XORI %2, 3
+ %5:gpr = ORI %3, 15
+ $x10 = COPY %4
+ $x11 = COPY %5
+ PseudoRET
+...
+
+# CHECK: xor_xori
+# CHECK: Macro fuse: {{.*}}XOR - XORI
+---
+name: xor_xori
+tracksRegLiveness: true
+body: |
+ bb.0.entry:
+ liveins: $x10, $x11
+ %1:gpr = COPY $x10
+ %2:gpr = COPY $x11
+ %3:gpr = XOR %1, %2
+ %4:gpr = XORI %2, 3
+ %5:gpr = XORI %3, 7
+ $x10 = COPY %4
+ $x11 = COPY %5
+ PseudoRET
+...