Skip to content

[RISCV] Implement tail call optimization in machine outliner #115297

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 26, 2024

Conversation

mga-sc
Copy link
Contributor

@mga-sc mga-sc commented Nov 7, 2024

Following up issue #89822, this patch adds opportunity to use tail call in machine outliner pass.
Also it enables outline patterns with X5(T0) register.

@llvmbot
Copy link
Member

llvmbot commented Nov 7, 2024

@llvm/pr-subscribers-backend-risc-v

Author: Mark Goncharov (mga-sc)

Changes

Following up issue #89822, this patch adds opportunity to use tail call in machine outliner pass.
Also it enables outline patterns with X5(T0) register.


Patch is 24.84 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/115297.diff

7 Files Affected:

  • (modified) llvm/lib/Target/RISCV/RISCVInstrInfo.cpp (+57-15)
  • (added) llvm/test/CodeGen/RISCV/machine-outliner-call.ll (+70)
  • (modified) llvm/test/CodeGen/RISCV/machine-outliner-cfi.mir (+8-14)
  • (modified) llvm/test/CodeGen/RISCV/machine-outliner-patchable.ll (+20-4)
  • (modified) llvm/test/CodeGen/RISCV/machine-outliner-position.mir (+10-12)
  • (added) llvm/test/CodeGen/RISCV/machineoutliner-x5.mir (+58)
  • (modified) llvm/test/CodeGen/RISCV/machineoutliner.mir (+12-6)
diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp b/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
index 04bb964bfc48cf..f6425d47fd81bb 100644
--- a/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
+++ b/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
@@ -2929,6 +2929,7 @@ bool RISCVInstrInfo::isMBBSafeToOutlineFrom(MachineBasicBlock &MBB,
 
 // Enum values indicating how an outlined call should be constructed.
 enum MachineOutlinerConstructionID {
+  MachineOutlinerTailCall,
   MachineOutlinerDefault
 };
 
@@ -2937,19 +2938,47 @@ bool RISCVInstrInfo::shouldOutlineFromFunctionByDefault(
   return MF.getFunction().hasMinSize();
 }
 
+static bool IsCandidatePatchable(const MachineInstr &MI) {
+  const MachineBasicBlock *MBB = MI.getParent();
+  const MachineFunction *MF = MBB->getParent();
+  const Function &F = MF->getFunction();
+  return F.getFnAttribute("fentry-call").getValueAsBool() ||
+         F.hasFnAttribute("patchable-function-entry");
+}
+
+static bool CannotInsertTailCall(const MachineInstr &MI) {
+  if (MI.isTerminator())
+    return IsCandidatePatchable(MI);
+  return true;
+}
+
+static bool MIUseX5(const MachineInstr &MI, const TargetRegisterInfo *TRI) {
+  return MI.modifiesRegister(RISCV::X5, TRI) ||
+         MI.getDesc().hasImplicitDefOfPhysReg(RISCV::X5);
+}
+
 std::optional<std::unique_ptr<outliner::OutlinedFunction>>
 RISCVInstrInfo::getOutliningCandidateInfo(
     const MachineModuleInfo &MMI,
     std::vector<outliner::Candidate> &RepeatedSequenceLocs,
     unsigned MinRepeats) const {
 
-  // First we need to filter out candidates where the X5 register (IE t0) can't
-  // be used to setup the function call.
-  auto CannotInsertCall = [](outliner::Candidate &C) {
+  auto CandidateUseX5 = [](outliner::Candidate &C) {
     const TargetRegisterInfo *TRI = C.getMF()->getSubtarget().getRegisterInfo();
+    for (const MachineInstr &MI : C)
+      if (MIUseX5(MI, TRI))
+        return true;
     return !C.isAvailableAcrossAndOutOfSeq(RISCV::X5, *TRI);
   };
 
+  auto CannotInsertCall = [CandidateUseX5](outliner::Candidate &C) {
+    if (!CandidateUseX5(C))
+      return false;
+    if (!CannotInsertTailCall(C.back()))
+      return false;
+    return true;
+  };
+
   llvm::erase_if(RepeatedSequenceLocs, CannotInsertCall);
 
   // If the sequence doesn't have enough candidates left, then we're done.
@@ -2961,6 +2990,17 @@ RISCVInstrInfo::getOutliningCandidateInfo(
   for (auto &MI : RepeatedSequenceLocs[0])
     SequenceSize += getInstSizeInBytes(MI);
 
+  if (!CannotInsertTailCall(RepeatedSequenceLocs[0].back())) {
+    // tail function = 8 bytes. Can't be compressed
+    for (auto &C : RepeatedSequenceLocs)
+      C.setCallInfo(MachineOutlinerTailCall, 8);
+
+    // Using tail call we move ret instrunction from caller to calee.
+    //   So, FrameOverhead for this is 0
+    return std::make_unique<outliner::OutlinedFunction>(
+        RepeatedSequenceLocs, SequenceSize, 0, MachineOutlinerTailCall);
+  }
+
   // call t0, function = 8 bytes.
   unsigned CallOverhead = 8;
   for (auto &C : RepeatedSequenceLocs)
@@ -2997,15 +3037,7 @@ RISCVInstrInfo::getOutliningTypeImpl(const MachineModuleInfo &MMI,
     return F.needsUnwindTableEntry() ? outliner::InstrType::Illegal
                                      : outliner::InstrType::Invisible;
 
-  // We need support for tail calls to outlined functions before return
-  // statements can be allowed.
-  if (MI.isReturn())
-    return outliner::InstrType::Illegal;
-
-  // Don't allow modifying the X5 register which we use for return addresses for
-  // these outlined functions.
-  if (MI.modifiesRegister(RISCV::X5, TRI) ||
-      MI.getDesc().hasImplicitDefOfPhysReg(RISCV::X5))
+  if (CannotInsertTailCall(MBB->back()) && MIUseX5(MI, TRI))
     return outliner::InstrType::Illegal;
 
   // Make sure the operands don't reference something unsafe.
@@ -3041,19 +3073,29 @@ void RISCVInstrInfo::buildOutlinedFrame(
     }
   }
 
+  if (OF.FrameConstructionID == MachineOutlinerTailCall)
+    return;
+
   MBB.addLiveIn(RISCV::X5);
 
   // Add in a return instruction to the end of the outlined frame.
   MBB.insert(MBB.end(), BuildMI(MF, DebugLoc(), get(RISCV::JALR))
-      .addReg(RISCV::X0, RegState::Define)
-      .addReg(RISCV::X5)
-      .addImm(0));
+                            .addReg(RISCV::X0, RegState::Define)
+                            .addReg(RISCV::X5)
+                            .addImm(0));
 }
 
 MachineBasicBlock::iterator RISCVInstrInfo::insertOutlinedCall(
     Module &M, MachineBasicBlock &MBB, MachineBasicBlock::iterator &It,
     MachineFunction &MF, outliner::Candidate &C) const {
 
+  if (C.CallConstructionID == MachineOutlinerTailCall) {
+    It = MBB.insert(It, BuildMI(MF, DebugLoc(), get(RISCV::PseudoTAIL))
+                            .addGlobalAddress(M.getNamedValue(MF.getName()),
+                                              /*Offset=*/0, RISCVII::MO_CALL));
+    return It;
+  }
+
   // Add in a call instruction to the outlined function at the given location.
   It = MBB.insert(It,
                   BuildMI(MF, DebugLoc(), get(RISCV::PseudoCALLReg), RISCV::X5)
diff --git a/llvm/test/CodeGen/RISCV/machine-outliner-call.ll b/llvm/test/CodeGen/RISCV/machine-outliner-call.ll
new file mode 100644
index 00000000000000..b019cfe74864b0
--- /dev/null
+++ b/llvm/test/CodeGen/RISCV/machine-outliner-call.ll
@@ -0,0 +1,70 @@
+; RUN: llc < %s -verify-machineinstrs -enable-machine-outliner | FileCheck %s
+
+target triple = "riscv64-unknown-linux-gnu"
+
+declare void @foo(i32, i32, i32, i32) minsize
+
+define void @fentry0(i1 %a) nounwind {
+; CHECK-LABEL: fentry0:
+; CHECK:       # %bb.1:
+; CHECK-NEXT:    call t0, OUTLINED_FUNCTION_[[BB1:[0-9]+]]
+; CHECK-NEXT:    call foo
+; CHECK-LABEL: .LBB0_2:
+; CHECK-NEXT:    tail OUTLINED_FUNCTION_[[BB2:[0-9]+]]
+entry:
+  br i1 %a, label %if.then, label %if.end
+if.then:
+  call void @foo(i32 1, i32 2, i32 3, i32 4)
+  br label %if.end
+if.end:
+  call void @foo(i32 5, i32 6, i32 7, i32 8)
+  ret void
+}
+
+define void @fentry1(i1 %a) nounwind {
+; CHECK-LABEL: fentry1:
+; CHECK:       # %bb.1:
+; CHECK-NEXT:    call t0, OUTLINED_FUNCTION_[[BB1:[0-9]+]]
+; CHECK-NEXT:    call foo
+; CHECK-LABEL: .LBB1_2:
+; CHECK-NEXT:    tail OUTLINED_FUNCTION_[[BB2:[0-9]+]]
+entry:
+  br i1 %a, label %if.then, label %if.end
+if.then:
+  call void @foo(i32 1, i32 2, i32 3, i32 4)
+  br label %if.end
+if.end:
+  call void @foo(i32 5, i32 6, i32 7, i32 8)
+  ret void
+}
+
+define void @fentry2(i1 %a) nounwind {
+; CHECK-LABEL: fentry2:
+; CHECK:       # %bb.1:
+; CHECK-NEXT:    call t0, OUTLINED_FUNCTION_[[BB1:[0-9]+]]
+; CHECK-NEXT:    call foo
+; CHECK-LABEL: .LBB2_2:
+; CHECK-NEXT:    tail OUTLINED_FUNCTION_[[BB2:[0-9]+]]
+entry:
+  br i1 %a, label %if.then, label %if.end
+if.then:
+  call void @foo(i32 1, i32 2, i32 3, i32 4)
+  br label %if.end
+if.end:
+  call void @foo(i32 5, i32 6, i32 7, i32 8)
+  ret void
+}
+
+; CHECK:       OUTLINED_FUNCTION_[[BB2]]:
+; CHECK:       li      a0, 5
+; CHECK-NEXT:  li      a1, 6
+; CHECK-NEXT:  li      a2, 7
+; CHECK-NEXT:  li      a3, 8
+; CHECK-NEXT:  call foo
+
+; CHECK:       OUTLINED_FUNCTION_[[BB1]]:
+; CHECK:       li      a0, 1
+; CHECK-NEXT:  li      a1, 2
+; CHECK-NEXT:  li      a2, 3
+; CHECK-NEXT:  li      a3, 4
+; CHECK-NEXT:  jr      t0
diff --git a/llvm/test/CodeGen/RISCV/machine-outliner-cfi.mir b/llvm/test/CodeGen/RISCV/machine-outliner-cfi.mir
index 6ecca6a1b18ef8..2acb1d43e01eaf 100644
--- a/llvm/test/CodeGen/RISCV/machine-outliner-cfi.mir
+++ b/llvm/test/CodeGen/RISCV/machine-outliner-cfi.mir
@@ -22,13 +22,11 @@ body:             |
     ; RV32I-MO-LABEL: name: func1
     ; RV32I-MO: liveins: $x10, $x11
     ; RV32I-MO-NEXT: {{  $}}
-    ; RV32I-MO-NEXT: $x5 = PseudoCALLReg target-flags(riscv-call) @OUTLINED_FUNCTION_0, implicit-def $x5, implicit-def $x10, implicit-def $x11, implicit-def $x12, implicit $x10, implicit $x11
-    ; RV32I-MO-NEXT: PseudoRET
+    ; RV32I-MO-NEXT: PseudoTAIL target-flags(riscv-call) @OUTLINED_FUNCTION_0, implicit $x2, implicit-def $x10, implicit-def $x11, implicit-def $x12, implicit $x2, implicit $x10, implicit $x11
     ; RV64I-MO-LABEL: name: func1
     ; RV64I-MO: liveins: $x10, $x11
     ; RV64I-MO-NEXT: {{  $}}
-    ; RV64I-MO-NEXT: $x5 = PseudoCALLReg target-flags(riscv-call) @OUTLINED_FUNCTION_0, implicit-def $x5, implicit-def $x10, implicit-def $x11, implicit-def $x12, implicit $x10, implicit $x11
-    ; RV64I-MO-NEXT: PseudoRET
+    ; RV64I-MO-NEXT: PseudoTAIL target-flags(riscv-call) @OUTLINED_FUNCTION_0, implicit $x2, implicit-def $x10, implicit-def $x11, implicit-def $x12, implicit $x2, implicit $x10, implicit $x11
     $x10 = ORI $x10, 1023
     CFI_INSTRUCTION offset $x1, 0
     $x11 = ORI $x11, 1023
@@ -49,13 +47,11 @@ body:             |
     ; RV32I-MO-LABEL: name: func2
     ; RV32I-MO: liveins: $x10, $x11
     ; RV32I-MO-NEXT: {{  $}}
-    ; RV32I-MO-NEXT: $x5 = PseudoCALLReg target-flags(riscv-call) @OUTLINED_FUNCTION_0, implicit-def $x5, implicit-def $x10, implicit-def $x11, implicit-def $x12, implicit $x10, implicit $x11
-    ; RV32I-MO-NEXT: PseudoRET
+    ; RV32I-MO-NEXT: PseudoTAIL target-flags(riscv-call) @OUTLINED_FUNCTION_0, implicit $x2, implicit-def $x10, implicit-def $x11, implicit-def $x12, implicit $x2, implicit $x10, implicit $x11
     ; RV64I-MO-LABEL: name: func2
     ; RV64I-MO: liveins: $x10, $x11
     ; RV64I-MO-NEXT: {{  $}}
-    ; RV64I-MO-NEXT: $x5 = PseudoCALLReg target-flags(riscv-call) @OUTLINED_FUNCTION_0, implicit-def $x5, implicit-def $x10, implicit-def $x11, implicit-def $x12, implicit $x10, implicit $x11
-    ; RV64I-MO-NEXT: PseudoRET
+    ; RV64I-MO-NEXT: PseudoTAIL target-flags(riscv-call) @OUTLINED_FUNCTION_0, implicit $x2, implicit-def $x10, implicit-def $x11, implicit-def $x12, implicit $x2, implicit $x10, implicit $x11
     $x10 = ORI $x10, 1023
     CFI_INSTRUCTION offset $x1, 0
     $x11 = ORI $x11, 1023
@@ -76,13 +72,11 @@ body:             |
     ; RV32I-MO-LABEL: name: func3
     ; RV32I-MO: liveins: $x10, $x11
     ; RV32I-MO-NEXT: {{  $}}
-    ; RV32I-MO-NEXT: $x5 = PseudoCALLReg target-flags(riscv-call) @OUTLINED_FUNCTION_0, implicit-def $x5, implicit-def $x10, implicit-def $x11, implicit-def $x12, implicit $x10, implicit $x11
-    ; RV32I-MO-NEXT: PseudoRET
+    ; RV32I-MO-NEXT: PseudoTAIL target-flags(riscv-call) @OUTLINED_FUNCTION_0, implicit $x2, implicit-def $x10, implicit-def $x11, implicit-def $x12, implicit $x2, implicit $x10, implicit $x11
     ; RV64I-MO-LABEL: name: func3
     ; RV64I-MO: liveins: $x10, $x11
     ; RV64I-MO-NEXT: {{  $}}
-    ; RV64I-MO-NEXT: $x5 = PseudoCALLReg target-flags(riscv-call) @OUTLINED_FUNCTION_0, implicit-def $x5, implicit-def $x10, implicit-def $x11, implicit-def $x12, implicit $x10, implicit $x11
-    ; RV64I-MO-NEXT: PseudoRET
+    ; RV64I-MO-NEXT: PseudoTAIL target-flags(riscv-call) @OUTLINED_FUNCTION_0, implicit $x2, implicit-def $x10, implicit-def $x11, implicit-def $x12, implicit $x2, implicit $x10, implicit $x11
     $x10 = ORI $x10, 1023
     CFI_INSTRUCTION offset $x1, -12
     $x11 = ORI $x11, 1023
@@ -96,11 +90,11 @@ body:             |
 
 
 # OUTLINED-LABEL: name: OUTLINED_FUNCTION_0
-# OUTLINED: liveins: $x11, $x10, $x5
+# OUTLINED: liveins: $x11, $x10
 # OUTLINED-NEXT: {{  $}}
 # OUTLINED-NEXT: $x10 = ORI $x10, 1023
 # OUTLINED-NEXT: $x11 = ORI $x11, 1023
 # OUTLINED-NEXT: $x12 = ADDI $x10, 17
 # OUTLINED-NEXT: $x11 = AND $x12, $x11
 # OUTLINED-NEXT: $x10 = SUB $x10, $x11
-# OUTLINED-NEXT: $x0 = JALR $x5, 0
+# OUTLINED-NEXT: PseudoRET
diff --git a/llvm/test/CodeGen/RISCV/machine-outliner-patchable.ll b/llvm/test/CodeGen/RISCV/machine-outliner-patchable.ll
index 4ef3abd241577f..4a54a7289ddf27 100644
--- a/llvm/test/CodeGen/RISCV/machine-outliner-patchable.ll
+++ b/llvm/test/CodeGen/RISCV/machine-outliner-patchable.ll
@@ -11,7 +11,11 @@ define void @fentry0(i1 %a) nounwind "fentry-call"="true" {
 ; CHECK-NEXT:  # %bb.0:
 ; CHECK-NEXT:    # FEntry call
 ; CHECK:       # %bb.1:
-; CHECK-NEXT:    call t0, OUTLINED_FUNCTION_1
+; CHECK-NEXT:    call t0, OUTLINED_FUNCTION_[[BB1:[0-9]+]]
+; CHECK-NEXT:    call foo
+; CHECK-LABEL: .LBB0_2:
+; CHECK-NEXT:    call	t0, OUTLINED_FUNCTION_[[BB2:[0-9]+]]
+; CHECK-NEXT:    call	foo
 entry:
   br i1 %a, label %if.then, label %if.end
 if.then:
@@ -27,7 +31,11 @@ define void @fentry1(i1 %a) nounwind "fentry-call"="true" {
 ; CHECK-NEXT:  # %bb.0:
 ; CHECK-NEXT:    # FEntry call
 ; CHECK:       # %bb.1:
-; CHECK-NEXT:    call t0, OUTLINED_FUNCTION_1
+; CHECK-NEXT:    call t0, OUTLINED_FUNCTION_[[BB1:[0-9]+]]
+; CHECK-NEXT:    call foo
+; CHECK-LABEL: .LBB1_2:
+; CHECK-NEXT:    call	t0, OUTLINED_FUNCTION_[[BB2:[0-9]+]]
+; CHECK-NEXT:    call	foo
 entry:
   br i1 %a, label %if.then, label %if.end
 if.then:
@@ -47,7 +55,11 @@ define void @patchable0(i1 %a) nounwind "patchable-function-entry"="2" {
 ; CHECK-NEXT:    nop
 ; CHECK-NEXT:    nop
 ; CHECK:       # %bb.1:
-; CHECK-NEXT:    call t0, OUTLINED_FUNCTION_1
+; CHECK-NEXT:    call t0, OUTLINED_FUNCTION_[[BB1:[0-9]+]]
+; CHECK-NEXT:    call foo
+; CHECK-LABEL: .LBB2_2:
+; CHECK-NEXT:    call	t0, OUTLINED_FUNCTION_[[BB2:[0-9]+]]
+; CHECK-NEXT:    call	foo
 entry:
   br i1 %a, label %if.then, label %if.end
 if.then:
@@ -65,7 +77,11 @@ define void @patchable1(i1 %a) nounwind "patchable-function-entry"="2" {
 ; CHECK-NEXT:    nop
 ; CHECK-NEXT:    nop
 ; CHECK:       # %bb.1:
-; CHECK-NEXT:    call t0, OUTLINED_FUNCTION_1
+; CHECK-NEXT:    call t0, OUTLINED_FUNCTION_[[BB1:[0-9]+]]
+; CHECK-NEXT:    call foo
+; CHECK-LABEL: .LBB3_2:
+; CHECK-NEXT:    call	t0, OUTLINED_FUNCTION_[[BB2:[0-9]+]]
+; CHECK-NEXT:    call	foo
 entry:
   br i1 %a, label %if.then, label %if.end
 if.then:
diff --git a/llvm/test/CodeGen/RISCV/machine-outliner-position.mir b/llvm/test/CodeGen/RISCV/machine-outliner-position.mir
index 715e212eecabb3..f2f43f7a1dcd9d 100644
--- a/llvm/test/CodeGen/RISCV/machine-outliner-position.mir
+++ b/llvm/test/CodeGen/RISCV/machine-outliner-position.mir
@@ -1,3 +1,4 @@
+# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 2
 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
 # RUN: llc -mtriple=riscv32 -x mir -run-pass=machine-outliner -simplify-mir -verify-machineinstrs < %s \
 # RUN: | FileCheck -check-prefixes=RV32I-MO %s
@@ -25,15 +26,14 @@ body:             |
     ; RV32I-MO-NEXT: {{  $}}
     ; RV32I-MO-NEXT: $x10 = ORI $x10, 1023
     ; RV32I-MO-NEXT: EH_LABEL <mcsymbol .Ltmp0>
-    ; RV32I-MO-NEXT: $x5 = PseudoCALLReg target-flags(riscv-call) @OUTLINED_FUNCTION_0, implicit-def $x5, implicit-def $x10, implicit-def $x11, implicit-def $x12, implicit $x10, implicit $x11
-    ; RV32I-MO-NEXT: PseudoRET
+    ; RV32I-MO-NEXT: PseudoTAIL target-flags(riscv-call) @OUTLINED_FUNCTION_0, implicit $x2, implicit-def $x10, implicit-def $x11, implicit-def $x12, implicit $x2, implicit $x10, implicit $x11
+    ;
     ; RV64I-MO-LABEL: name: func1
     ; RV64I-MO: liveins: $x10, $x11
     ; RV64I-MO-NEXT: {{  $}}
     ; RV64I-MO-NEXT: $x10 = ORI $x10, 1023
     ; RV64I-MO-NEXT: EH_LABEL <mcsymbol .Ltmp0>
-    ; RV64I-MO-NEXT: $x5 = PseudoCALLReg target-flags(riscv-call) @OUTLINED_FUNCTION_0, implicit-def $x5, implicit-def $x10, implicit-def $x11, implicit-def $x12, implicit $x10, implicit $x11
-    ; RV64I-MO-NEXT: PseudoRET
+    ; RV64I-MO-NEXT: PseudoTAIL target-flags(riscv-call) @OUTLINED_FUNCTION_0, implicit $x2, implicit-def $x10, implicit-def $x11, implicit-def $x12, implicit $x2, implicit $x10, implicit $x11
     $x10 = ORI $x10, 1023
     EH_LABEL <mcsymbol .Ltmp0>
     $x11 = ORI $x11, 1023
@@ -53,15 +53,14 @@ body:             |
     ; RV32I-MO-NEXT: {{  $}}
     ; RV32I-MO-NEXT: $x10 = ORI $x10, 1023
     ; RV32I-MO-NEXT: GC_LABEL <mcsymbol .Ltmp1>
-    ; RV32I-MO-NEXT: $x5 = PseudoCALLReg target-flags(riscv-call) @OUTLINED_FUNCTION_0, implicit-def $x5, implicit-def $x10, implicit-def $x11, implicit-def $x12, implicit $x10, implicit $x11
-    ; RV32I-MO-NEXT: PseudoRET
+    ; RV32I-MO-NEXT: PseudoTAIL target-flags(riscv-call) @OUTLINED_FUNCTION_0, implicit $x2, implicit-def $x10, implicit-def $x11, implicit-def $x12, implicit $x2, implicit $x10, implicit $x11
+    ;
     ; RV64I-MO-LABEL: name: func2
     ; RV64I-MO: liveins: $x10, $x11
     ; RV64I-MO-NEXT: {{  $}}
     ; RV64I-MO-NEXT: $x10 = ORI $x10, 1023
     ; RV64I-MO-NEXT: GC_LABEL <mcsymbol .Ltmp1>
-    ; RV64I-MO-NEXT: $x5 = PseudoCALLReg target-flags(riscv-call) @OUTLINED_FUNCTION_0, implicit-def $x5, implicit-def $x10, implicit-def $x11, implicit-def $x12, implicit $x10, implicit $x11
-    ; RV64I-MO-NEXT: PseudoRET
+    ; RV64I-MO-NEXT: PseudoTAIL target-flags(riscv-call) @OUTLINED_FUNCTION_0, implicit $x2, implicit-def $x10, implicit-def $x11, implicit-def $x12, implicit $x2, implicit $x10, implicit $x11
     $x10 = ORI $x10, 1023
     GC_LABEL <mcsymbol .Ltmp1>
     $x11 = ORI $x11, 1023
@@ -81,15 +80,14 @@ body:             |
     ; RV32I-MO-NEXT: {{  $}}
     ; RV32I-MO-NEXT: $x10 = ORI $x10, 1023
     ; RV32I-MO-NEXT: ANNOTATION_LABEL <mcsymbol .Ltmp2>
-    ; RV32I-MO-NEXT: $x5 = PseudoCALLReg target-flags(riscv-call) @OUTLINED_FUNCTION_0, implicit-def $x5, implicit-def $x10, implicit-def $x11, implicit-def $x12, implicit $x10, implicit $x11
-    ; RV32I-MO-NEXT: PseudoRET
+    ; RV32I-MO-NEXT: PseudoTAIL target-flags(riscv-call) @OUTLINED_FUNCTION_0, implicit $x2, implicit-def $x10, implicit-def $x11, implicit-def $x12, implicit $x2, implicit $x10, implicit $x11
+    ;
     ; RV64I-MO-LABEL: name: func3
     ; RV64I-MO: liveins: $x10, $x11
     ; RV64I-MO-NEXT: {{  $}}
     ; RV64I-MO-NEXT: $x10 = ORI $x10, 1023
     ; RV64I-MO-NEXT: ANNOTATION_LABEL <mcsymbol .Ltmp2>
-    ; RV64I-MO-NEXT: $x5 = PseudoCALLReg target-flags(riscv-call) @OUTLINED_FUNCTION_0, implicit-def $x5, implicit-def $x10, implicit-def $x11, implicit-def $x12, implicit $x10, implicit $x11
-    ; RV64I-MO-NEXT: PseudoRET
+    ; RV64I-MO-NEXT: PseudoTAIL target-flags(riscv-call) @OUTLINED_FUNCTION_0, implicit $x2, implicit-def $x10, implicit-def $x11, implicit-def $x12, implicit $x2, implicit $x10, implicit $x11
     $x10 = ORI $x10, 1023
     ANNOTATION_LABEL <mcsymbol .Ltmp2>
     $x11 = ORI $x11, 1023
diff --git a/llvm/test/CodeGen/RISCV/machineoutliner-x5.mir b/llvm/test/CodeGen/RISCV/machineoutliner-x5.mir
new file mode 100644
index 00000000000000..b01cda582e19b0
--- /dev/null
+++ b/llvm/test/CodeGen/RISCV/machineoutliner-x5.mir
@@ -0,0 +1,58 @@
+# Check that modifying X5 register is not a problem for machine outliner
+
+# RUN: llc -mtriple=riscv32 -x mir -run-pass=machine-outliner -simplify-mir -verify-machineinstrs < %s \
+# RUN: | FileCheck -check-prefixes=CHECK,RV32I-MO %s
+# RUN: llc -mtriple=riscv64 -x mir -run-pass=machine-outliner -simplify-mir -verify-machineinstrs < %s \
+# RUN: | FileCheck -check-prefixes=CHECK,RV64I-MO %s
+
+--- |
+  define i32 @outline_0(i32 %a, i32 %b) { ret i32 0 }
+
+  define i32 @outline_1(i32 %a, i32 %b) { ret i32 0 }
+
+  define i32 @outline_2(i32 %a, i32 %b) { ret i32 0 }
+
+...
+---
+name:            outline_0
+tracksRegLiveness: true
+isOutlined: false
+body:             |
+  bb.0:
+    liveins: $x10, $x11, $x5
+    ; RV32I-MO-LABEL: name: outline_0
+    ; RV32I-MO:         PseudoTAIL target-flags(riscv-call) @OUTLINED_FUNCTION_0, implicit $x2, implicit-def $x10, implicit-def $x11, implicit-def $x12, implicit $x2, implicit $x5, implicit $x10, implicit $x11
+    ;
+    ; RV64I-MO-LABEL: name: outline_0
+    ; RV64I-MO:         PseudoTAIL target-flags(riscv-call) @OUTLINED_FUNCTION_0, implicit $x2, implicit-def $x10, implicit-def $x11, implicit-def $x12, implicit $x2, implicit $x5, implicit $x10, implicit $x11
+    $x11 = ORI $x11, 1023
+    $x12 = ADDI $x10, 17
+    $x10 = ADD $x10, $x5
+    $x11 = AND $x12, $x11
+    $x10 = SUB $x10, $x11
+    PseudoRET implicit $x10
+
+...
+---
+name:            outline_1
+tracksRegLiveness: true
+isOutlined: false
+body:             |
+  bb.0:
+    liveins: $x10, $x11, $x5
+    ; RV32I-MO-LABEL: name: outline_1
+    ; RV32I-MO:         PseudoTAIL target-flags(riscv-call) @OUTLINED_FUNCTION_0, implicit $x2, implicit-def $x10, implicit-def $x11, implicit-def $x12, implicit $x2, implicit $x5, implicit $x10, implicit $x11
+    ;
+    ; RV64I-MO-LABEL: name: outline_1
+    ; RV64I-MO:         PseudoTAIL target-flags(riscv-call) @OUTLINED_FUNCTION_0, implicit $x2, implicit-def $x10, implicit-def $x11, implicit-def $x12, implicit $x2, implicit $x5,...
[truncated]

Following up issue llvm#89822, this patch adds opportunity
to use tail call in machine outliner pass.
Also it enables outline patterns with X5(T0) register.
@topperc topperc requested a review from ilovepi November 7, 2024 16:04
// First we need to filter out candidates where the X5 register (IE t0) can't
// be used to setup the function call.
auto CannotInsertCall = [](outliner::Candidate &C) {
auto CandidateUseX5 = [](outliner::Candidate &C) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use -> Uses

Copy link
Contributor

@ilovepi ilovepi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than @topperc's comments this seems good, modulo a few small nits w.r.t. formatting. Thanks for working on this! 😄

Comment on lines 3048 to 3085
.addReg(RISCV::X0, RegState::Define)
.addReg(RISCV::X5)
.addImm(0));
.addReg(RISCV::X0, RegState::Define)
.addReg(RISCV::X5)
.addImm(0));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, get changes back.
It was changed by git clang-format ...

@mga-sc mga-sc requested review from topperc and wangpc-pp November 8, 2024 06:40
Copy link
Contributor

@wangpc-pp wangpc-pp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM in general, but I'd like to know if we have passed all tests in llvm-test-suite with -Oz.

@mga-sc
Copy link
Contributor Author

mga-sc commented Nov 12, 2024

LGTM in general, but I'd like to know if we have passed all tests in llvm-test-suite with -Oz.

@wangpc-pp , llvm-test-suite with -Oz locally has been passed. I don't know how to run it using this git infrastructure

@wangpc-pp
Copy link
Contributor

LGTM in general, but I'd like to know if we have passed all tests in llvm-test-suite with -Oz.

@wangpc-pp , llvm-test-suite with -Oz locally has been passed. I don't know how to run it using this git infrastructure

It's OK as long as you have run llvm-test-suite on qemu and all tests are passed. The LLVM Github CI is not so complete for RISC-V.

Copy link
Contributor

@wangpc-pp wangpc-pp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@mga-sc
Copy link
Contributor Author

mga-sc commented Nov 12, 2024

@topperc , ping. Could we merge this MR? I don't have write access.

@@ -2961,6 +2990,17 @@ RISCVInstrInfo::getOutliningCandidateInfo(
for (auto &MI : RepeatedSequenceLocs[0])
SequenceSize += getInstSizeInBytes(MI);

if (!cannotInsertTailCall(RepeatedSequenceLocs[0].back())) {
// tail function = 8 bytes. Can't be compressed
Copy link
Collaborator

@topperc topperc Nov 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can't it be compressed? Or do you just mean it can't be compressed in the assembler. It should be compressible in the linker.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rewrote it in a more precise form

    // tail call = auipc + jalr in the worst case without linker relaxation.
    CallOverhead = 4 + InstrSizeCExt;

for (auto &C : RepeatedSequenceLocs)
C.setCallInfo(MachineOutlinerTailCall, 8);

// Using tail call we move ret instruction from caller to calle.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

callee*

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@@ -3054,6 +3089,13 @@ MachineBasicBlock::iterator RISCVInstrInfo::insertOutlinedCall(
Module &M, MachineBasicBlock &MBB, MachineBasicBlock::iterator &It,
MachineFunction &MF, outliner::Candidate &C) const {

if (C.CallConstructionID == MachineOutlinerTailCall) {
It = MBB.insert(It, BuildMI(MF, DebugLoc(), get(RISCV::PseudoTAIL))
Copy link
Collaborator

@topperc topperc Nov 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PseudoTAIL expands to AUIPC+JALR using X6 or X7 as a temporary. If the linker doesn't relax the AUIPC+JALR sequence to JAL, then X6 or X7 will be overwritten. How do we know it is ok to overwrite X6 or X7?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the comment, I did not consider the case of the influence of registers x6 and x7 before relaxation. Apparently, even llvm-test-suite didn't get such case.
I rewrote verification algorithm for tail call. If we modify X6/X7 (Specific register get from enabled extensions info) earlier than reads from X6/X7, than my optimization can be applied.

@mga-sc
Copy link
Contributor Author

mga-sc commented Nov 25, 2024

@topperc , ping

Copy link
Collaborator

@topperc topperc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mga-sc
Copy link
Contributor Author

mga-sc commented Nov 26, 2024

@topperc , could you please merge this PR?

@asi-sc asi-sc merged commit 2906232 into llvm:main Nov 26, 2024
8 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 26, 2024

LLVM Buildbot has detected a new failure on builder ml-opt-dev-x86-64 running on ml-opt-dev-x86-64-b1 while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/137/builds/9302

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: CodeGen/RISCV/compress-opt-select.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: /b/ml-opt-dev-x86-64-b1/build/bin/llc -mtriple=riscv32 -target-abi ilp32d -mattr=+c,+f,+d      -riscv-no-aliases < /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll    | /b/ml-opt-dev-x86-64-b1/build/bin/FileCheck -check-prefix=RV32IFDC /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll
+ /b/ml-opt-dev-x86-64-b1/build/bin/FileCheck -check-prefix=RV32IFDC /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll
+ /b/ml-opt-dev-x86-64-b1/build/bin/llc -mtriple=riscv32 -target-abi ilp32d -mattr=+c,+f,+d -riscv-no-aliases
/b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll:16:18: error: RV32IFDC-NEXT: expected string not found in input
; RV32IFDC-NEXT: addi a0, zero, 42
                 ^
<stdin>:13:9: note: scanning from here
# %bb.1:
        ^
<stdin>:18:13: note: possible intended match here
 .size ne_small_pos, .Lfunc_end0-ne_small_pos
            ^
/b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll:44:18: error: RV32IFDC-NEXT: expected string not found in input
; RV32IFDC-NEXT: addi a0, zero, 42
                 ^
<stdin>:29:9: note: scanning from here
# %bb.1:
        ^
<stdin>:34:8: note: possible intended match here
 .size ne_small_neg, .Lfunc_end1-ne_small_neg
       ^
/b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll:72:18: error: RV32IFDC-NEXT: expected string not found in input
; RV32IFDC-NEXT: addi a0, zero, 42
                 ^
<stdin>:45:9: note: scanning from here
# %bb.1:
        ^
<stdin>:51:2: note: possible intended match here
 .cfi_endproc
 ^
/b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll:100:18: error: RV32IFDC-NEXT: expected string not found in input
; RV32IFDC-NEXT: addi a0, zero, 42
                 ^
<stdin>:61:9: note: scanning from here
# %bb.1:
        ^
<stdin>:66:12: note: possible intended match here
 .size ne_small_edge_neg, .Lfunc_end3-ne_small_edge_neg
           ^
/b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll:129:18: error: RV32IFDC-NEXT: expected string not found in input
; RV32IFDC-NEXT: addi a0, zero, 42
                 ^
<stdin>:77:9: note: scanning from here
# %bb.1:
        ^
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 26, 2024

LLVM Buildbot has detected a new failure on builder ml-opt-rel-x86-64 running on ml-opt-rel-x86-64-b1 while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/185/builds/9183

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: CodeGen/RISCV/compress-opt-select.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: /b/ml-opt-rel-x86-64-b1/build/bin/llc -mtriple=riscv32 -target-abi ilp32d -mattr=+c,+f,+d      -riscv-no-aliases < /b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll    | /b/ml-opt-rel-x86-64-b1/build/bin/FileCheck -check-prefix=RV32IFDC /b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll
+ /b/ml-opt-rel-x86-64-b1/build/bin/FileCheck -check-prefix=RV32IFDC /b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll
+ /b/ml-opt-rel-x86-64-b1/build/bin/llc -mtriple=riscv32 -target-abi ilp32d -mattr=+c,+f,+d -riscv-no-aliases
/b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll:16:18: error: RV32IFDC-NEXT: expected string not found in input
; RV32IFDC-NEXT: addi a0, zero, 42
                 ^
<stdin>:13:9: note: scanning from here
# %bb.1:
        ^
<stdin>:18:13: note: possible intended match here
 .size ne_small_pos, .Lfunc_end0-ne_small_pos
            ^
/b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll:44:18: error: RV32IFDC-NEXT: expected string not found in input
; RV32IFDC-NEXT: addi a0, zero, 42
                 ^
<stdin>:29:9: note: scanning from here
# %bb.1:
        ^
<stdin>:34:8: note: possible intended match here
 .size ne_small_neg, .Lfunc_end1-ne_small_neg
       ^
/b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll:72:18: error: RV32IFDC-NEXT: expected string not found in input
; RV32IFDC-NEXT: addi a0, zero, 42
                 ^
<stdin>:45:9: note: scanning from here
# %bb.1:
        ^
<stdin>:51:2: note: possible intended match here
 .cfi_endproc
 ^
/b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll:100:18: error: RV32IFDC-NEXT: expected string not found in input
; RV32IFDC-NEXT: addi a0, zero, 42
                 ^
<stdin>:61:9: note: scanning from here
# %bb.1:
        ^
<stdin>:66:12: note: possible intended match here
 .size ne_small_edge_neg, .Lfunc_end3-ne_small_edge_neg
           ^
/b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll:129:18: error: RV32IFDC-NEXT: expected string not found in input
; RV32IFDC-NEXT: addi a0, zero, 42
                 ^
<stdin>:77:9: note: scanning from here
# %bb.1:
        ^
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 26, 2024

LLVM Buildbot has detected a new failure on builder ml-opt-devrel-x86-64 running on ml-opt-devrel-x86-64-b2 while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/175/builds/9184

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: CodeGen/RISCV/compress-opt-select.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: /b/ml-opt-devrel-x86-64-b1/build/bin/llc -mtriple=riscv32 -target-abi ilp32d -mattr=+c,+f,+d      -riscv-no-aliases < /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll    | /b/ml-opt-devrel-x86-64-b1/build/bin/FileCheck -check-prefix=RV32IFDC /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll
+ /b/ml-opt-devrel-x86-64-b1/build/bin/llc -mtriple=riscv32 -target-abi ilp32d -mattr=+c,+f,+d -riscv-no-aliases
+ /b/ml-opt-devrel-x86-64-b1/build/bin/FileCheck -check-prefix=RV32IFDC /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll
/b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll:16:18: error: RV32IFDC-NEXT: expected string not found in input
; RV32IFDC-NEXT: addi a0, zero, 42
                 ^
<stdin>:13:9: note: scanning from here
# %bb.1:
        ^
<stdin>:18:13: note: possible intended match here
 .size ne_small_pos, .Lfunc_end0-ne_small_pos
            ^
/b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll:44:18: error: RV32IFDC-NEXT: expected string not found in input
; RV32IFDC-NEXT: addi a0, zero, 42
                 ^
<stdin>:29:9: note: scanning from here
# %bb.1:
        ^
<stdin>:34:8: note: possible intended match here
 .size ne_small_neg, .Lfunc_end1-ne_small_neg
       ^
/b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll:72:18: error: RV32IFDC-NEXT: expected string not found in input
; RV32IFDC-NEXT: addi a0, zero, 42
                 ^
<stdin>:45:9: note: scanning from here
# %bb.1:
        ^
<stdin>:51:2: note: possible intended match here
 .cfi_endproc
 ^
/b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll:100:18: error: RV32IFDC-NEXT: expected string not found in input
; RV32IFDC-NEXT: addi a0, zero, 42
                 ^
<stdin>:61:9: note: scanning from here
# %bb.1:
        ^
<stdin>:66:12: note: possible intended match here
 .size ne_small_edge_neg, .Lfunc_end3-ne_small_edge_neg
           ^
/b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll:129:18: error: RV32IFDC-NEXT: expected string not found in input
; RV32IFDC-NEXT: addi a0, zero, 42
                 ^
<stdin>:77:9: note: scanning from here
# %bb.1:
        ^
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 26, 2024

LLVM Buildbot has detected a new failure on builder clang-x86_64-debian-fast running on gribozavr4 while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/56/builds/13099

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: CodeGen/RISCV/compress-opt-select.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: /b/1/clang-x86_64-debian-fast/llvm.obj/bin/llc -mtriple=riscv32 -target-abi ilp32d -mattr=+c,+f,+d      -riscv-no-aliases < /b/1/clang-x86_64-debian-fast/llvm.src/llvm/test/CodeGen/RISCV/compress-opt-select.ll    | /b/1/clang-x86_64-debian-fast/llvm.obj/bin/FileCheck -check-prefix=RV32IFDC /b/1/clang-x86_64-debian-fast/llvm.src/llvm/test/CodeGen/RISCV/compress-opt-select.ll
+ /b/1/clang-x86_64-debian-fast/llvm.obj/bin/llc -mtriple=riscv32 -target-abi ilp32d -mattr=+c,+f,+d -riscv-no-aliases
+ /b/1/clang-x86_64-debian-fast/llvm.obj/bin/FileCheck -check-prefix=RV32IFDC /b/1/clang-x86_64-debian-fast/llvm.src/llvm/test/CodeGen/RISCV/compress-opt-select.ll
/b/1/clang-x86_64-debian-fast/llvm.src/llvm/test/CodeGen/RISCV/compress-opt-select.ll:16:18: error: RV32IFDC-NEXT: expected string not found in input
; RV32IFDC-NEXT: addi a0, zero, 42
                 ^
<stdin>:13:9: note: scanning from here
# %bb.1:
        ^
<stdin>:18:13: note: possible intended match here
 .size ne_small_pos, .Lfunc_end0-ne_small_pos
            ^
/b/1/clang-x86_64-debian-fast/llvm.src/llvm/test/CodeGen/RISCV/compress-opt-select.ll:44:18: error: RV32IFDC-NEXT: expected string not found in input
; RV32IFDC-NEXT: addi a0, zero, 42
                 ^
<stdin>:29:9: note: scanning from here
# %bb.1:
        ^
<stdin>:34:8: note: possible intended match here
 .size ne_small_neg, .Lfunc_end1-ne_small_neg
       ^
/b/1/clang-x86_64-debian-fast/llvm.src/llvm/test/CodeGen/RISCV/compress-opt-select.ll:72:18: error: RV32IFDC-NEXT: expected string not found in input
; RV32IFDC-NEXT: addi a0, zero, 42
                 ^
<stdin>:45:9: note: scanning from here
# %bb.1:
        ^
<stdin>:51:2: note: possible intended match here
 .cfi_endproc
 ^
/b/1/clang-x86_64-debian-fast/llvm.src/llvm/test/CodeGen/RISCV/compress-opt-select.ll:100:18: error: RV32IFDC-NEXT: expected string not found in input
; RV32IFDC-NEXT: addi a0, zero, 42
                 ^
<stdin>:61:9: note: scanning from here
# %bb.1:
        ^
<stdin>:66:12: note: possible intended match here
 .size ne_small_edge_neg, .Lfunc_end3-ne_small_edge_neg
           ^
/b/1/clang-x86_64-debian-fast/llvm.src/llvm/test/CodeGen/RISCV/compress-opt-select.ll:129:18: error: RV32IFDC-NEXT: expected string not found in input
; RV32IFDC-NEXT: addi a0, zero, 42
                 ^
<stdin>:77:9: note: scanning from here
# %bb.1:
        ^
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 26, 2024

LLVM Buildbot has detected a new failure on builder clang-hip-vega20 running on hip-vega20-0 while building llvm at step 3 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/123/builds/10099

Here is the relevant piece of the build log for the reference
Step 3 (annotate) failure: '../llvm-zorg/zorg/buildbot/builders/annotated/hip-build.sh --jobs=' (failure)
...
[36/38] : && /buildbot/hip-vega20-0/clang-hip-vega20/llvm/bin/clang++ -O3 -DNDEBUG  External/HIP/CMakeFiles/memmove-hip-6.0.2.dir/memmove.hip.o -o External/HIP/memmove-hip-6.0.2  --rocm-path=/buildbot/Externals/hip/rocm-6.0.2 --hip-link -rtlib=compiler-rt -unwindlib=libgcc -frtlib-add-rpath && cd /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP && /usr/local/bin/cmake -E create_symlink /buildbot/llvm-test-suite/External/HIP/memmove.reference_output /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP/memmove.reference_output-hip-6.0.2
[37/38] /buildbot/hip-vega20-0/clang-hip-vega20/llvm/bin/clang++ -DNDEBUG  -O3 -DNDEBUG   -w -Werror=date-time --rocm-path=/buildbot/Externals/hip/rocm-6.0.2 --offload-arch=gfx908 --offload-arch=gfx90a --offload-arch=gfx1030 --offload-arch=gfx1100 -xhip -mfma -MD -MT External/HIP/CMakeFiles/TheNextWeek-hip-6.0.2.dir/workload/ray-tracing/TheNextWeek/main.cc.o -MF External/HIP/CMakeFiles/TheNextWeek-hip-6.0.2.dir/workload/ray-tracing/TheNextWeek/main.cc.o.d -o External/HIP/CMakeFiles/TheNextWeek-hip-6.0.2.dir/workload/ray-tracing/TheNextWeek/main.cc.o -c /buildbot/llvm-test-suite/External/HIP/workload/ray-tracing/TheNextWeek/main.cc
[38/38] : && /buildbot/hip-vega20-0/clang-hip-vega20/llvm/bin/clang++ -O3 -DNDEBUG  External/HIP/CMakeFiles/TheNextWeek-hip-6.0.2.dir/workload/ray-tracing/TheNextWeek/main.cc.o -o External/HIP/TheNextWeek-hip-6.0.2  --rocm-path=/buildbot/Externals/hip/rocm-6.0.2 --hip-link -rtlib=compiler-rt -unwindlib=libgcc -frtlib-add-rpath && cd /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP && /usr/local/bin/cmake -E create_symlink /buildbot/llvm-test-suite/External/HIP/TheNextWeek.reference_output /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP/TheNextWeek.reference_output-hip-6.0.2
+ build_step 'Testing HIP test-suite'
+ echo '@@@BUILD_STEP Testing HIP test-suite@@@'
@@@BUILD_STEP Testing HIP test-suite@@@
+ ninja -v check-hip-simple
[0/1] cd /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP && /buildbot/hip-vega20-0/clang-hip-vega20/llvm/bin/llvm-lit -sv empty-hip-6.0.2.test with-fopenmp-hip-6.0.2.test saxpy-hip-6.0.2.test memmove-hip-6.0.2.test TheNextWeek-hip-6.0.2.test blender.test
-- Testing: 6 tests, 6 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80
FAIL: test-suite :: External/HIP/blender.test (6 of 6)
******************** TEST 'test-suite :: External/HIP/blender.test' FAILED ********************

/buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/tools/timeit-target --timeout 7200 --limit-core 0 --limit-cpu 7200 --limit-file-size 209715200 --limit-rss-size 838860800 --append-exitstatus --redirect-output /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP/Output/blender.test.out --redirect-input /dev/null --summary /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP/Output/blender.test.time /bin/bash test_blender.sh
/bin/bash verify_blender.sh /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP/Output/blender.test.out
Begin Blender test.
TEST_SUITE_HIP_ROOT=/buildbot/Externals/hip
Render /buildbot/Externals/hip/Blender_Scenes/290skydemo_release.blend
ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5701:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM default
Blender 4.1.1 (hash e1743a0317bc built 2024-04-15 23:47:45)
Read blend: "/buildbot/Externals/hip/Blender_Scenes/290skydemo_release.blend"
Could not open as Ogawa file from provided streams.
Unable to open /buildbot/Externals/hip/Blender_Scenes/290skydemo2_flags.abc
WARN (bke.modifier): source/blender/blenkernel/intern/modifier.cc:425 BKE_modifier_set_error: Object: "GEO-flag", Modifier: "MeshSequenceCache", Could not create reader for file //290skydemo2_flags.abc
WARN (bke.modifier): source/blender/blenkernel/intern/modifier.cc:425 BKE_modifier_set_error: Object: "GEO-flag.004", Modifier: "MeshSequenceCache", Could not create reader for file //290skydemo2_flags.abc
WARN (bke.modifier): source/blender/blenkernel/intern/modifier.cc:425 BKE_modifier_set_error: Object: "GEO-flag.003", Modifier: "MeshSequenceCache", Could not create reader for file //290skydemo2_flags.abc
WARN (bke.modifier): source/blender/blenkernel/intern/modifier.cc:425 BKE_modifier_set_error: Object: "GEO-flag.001", Modifier: "MeshSequenceCache", Could not create reader for file //290skydemo2_flags.abc
WARN (bke.modifier): source/blender/blenkernel/intern/modifier.cc:425 BKE_modifier_set_error: Object: "GEO-flag.002", Modifier: "MeshSequenceCache", Could not create reader for file //290skydemo2_flags.abc
Could not open as Ogawa file from provided streams.
Unable to open /buildbot/Externals/hip/Blender_Scenes/290skydemo2_flags.abc
WARN (bke.modifier): source/blender/blenkernel/intern/modifier.cc:425 BKE_modifier_set_error: Object: "GEO-flag.004", Modifier: "MeshSequenceCache", Could not create reader for file //290skydemo2_flags.abc
WARN (bke.modifier): source/blender/blenkernel/intern/modifier.cc:425 BKE_modifier_set_error: Object: "GEO-flag", Modifier: "MeshSequenceCache", Could not create reader for file //290skydemo2_flags.abc
WARN (bke.modifier): source/blender/blenkernel/intern/modifier.cc:425 BKE_modifier_set_error: Object: "GEO-flag.003", Modifier: "MeshSequenceCache", Could not create reader for file //290skydemo2_flags.abc
WARN (bke.modifier): source/blender/blenkernel/intern/modifier.cc:425 BKE_modifier_set_error: Object: "GEO-flag.001", Modifier: "MeshSequenceCache", Could not create reader for file //290skydemo2_flags.abc
WARN (bke.modifier): source/blender/blenkernel/intern/modifier.cc:425 BKE_modifier_set_error: Object: "GEO-flag.002", Modifier: "MeshSequenceCache", Could not create reader for file //290skydemo2_flags.abc
I1126 09:38:51.075129 997790 device.cpp:39] HIPEW initialization succeeded
I1126 09:38:51.077973 997790 device.cpp:45] Found HIPCC hipcc
I1126 09:38:51.113063 997790 device.cpp:207] Device has compute preemption or is not used for display.
I1126 09:38:51.113076 997790 device.cpp:211] Added device "AMD Instinct MI100" with id "HIP_AMD Instinct MI100_0000:67:00".
I1126 09:38:51.113168 997790 device.cpp:568] Mapped host memory limit set to 62,771,126,272 bytes. (58.46G)
I1126 09:38:51.113412 997790 device_impl.cpp:63] Using AVX2 CPU kernels.
Fra:48 Mem:523.99M (Peak 524.70M) | Time:00:00.95 | Mem:0.00M, Peak:0.00M | Scene, View Layer | Synchronizing object | GEO-Rivets
Step 12 (Testing HIP test-suite) failure: Testing HIP test-suite (failure)
@@@BUILD_STEP Testing HIP test-suite@@@
+ ninja -v check-hip-simple
[0/1] cd /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP && /buildbot/hip-vega20-0/clang-hip-vega20/llvm/bin/llvm-lit -sv empty-hip-6.0.2.test with-fopenmp-hip-6.0.2.test saxpy-hip-6.0.2.test memmove-hip-6.0.2.test TheNextWeek-hip-6.0.2.test blender.test
-- Testing: 6 tests, 6 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80
FAIL: test-suite :: External/HIP/blender.test (6 of 6)
******************** TEST 'test-suite :: External/HIP/blender.test' FAILED ********************

/buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/tools/timeit-target --timeout 7200 --limit-core 0 --limit-cpu 7200 --limit-file-size 209715200 --limit-rss-size 838860800 --append-exitstatus --redirect-output /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP/Output/blender.test.out --redirect-input /dev/null --summary /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP/Output/blender.test.time /bin/bash test_blender.sh
/bin/bash verify_blender.sh /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP/Output/blender.test.out
Begin Blender test.
TEST_SUITE_HIP_ROOT=/buildbot/Externals/hip
Render /buildbot/Externals/hip/Blender_Scenes/290skydemo_release.blend
ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5701:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM default
Blender 4.1.1 (hash e1743a0317bc built 2024-04-15 23:47:45)
Read blend: "/buildbot/Externals/hip/Blender_Scenes/290skydemo_release.blend"
Could not open as Ogawa file from provided streams.
Unable to open /buildbot/Externals/hip/Blender_Scenes/290skydemo2_flags.abc
WARN (bke.modifier): source/blender/blenkernel/intern/modifier.cc:425 BKE_modifier_set_error: Object: "GEO-flag", Modifier: "MeshSequenceCache", Could not create reader for file //290skydemo2_flags.abc
WARN (bke.modifier): source/blender/blenkernel/intern/modifier.cc:425 BKE_modifier_set_error: Object: "GEO-flag.004", Modifier: "MeshSequenceCache", Could not create reader for file //290skydemo2_flags.abc
WARN (bke.modifier): source/blender/blenkernel/intern/modifier.cc:425 BKE_modifier_set_error: Object: "GEO-flag.003", Modifier: "MeshSequenceCache", Could not create reader for file //290skydemo2_flags.abc
WARN (bke.modifier): source/blender/blenkernel/intern/modifier.cc:425 BKE_modifier_set_error: Object: "GEO-flag.001", Modifier: "MeshSequenceCache", Could not create reader for file //290skydemo2_flags.abc
WARN (bke.modifier): source/blender/blenkernel/intern/modifier.cc:425 BKE_modifier_set_error: Object: "GEO-flag.002", Modifier: "MeshSequenceCache", Could not create reader for file //290skydemo2_flags.abc
Could not open as Ogawa file from provided streams.
Unable to open /buildbot/Externals/hip/Blender_Scenes/290skydemo2_flags.abc
WARN (bke.modifier): source/blender/blenkernel/intern/modifier.cc:425 BKE_modifier_set_error: Object: "GEO-flag.004", Modifier: "MeshSequenceCache", Could not create reader for file //290skydemo2_flags.abc
WARN (bke.modifier): source/blender/blenkernel/intern/modifier.cc:425 BKE_modifier_set_error: Object: "GEO-flag", Modifier: "MeshSequenceCache", Could not create reader for file //290skydemo2_flags.abc
WARN (bke.modifier): source/blender/blenkernel/intern/modifier.cc:425 BKE_modifier_set_error: Object: "GEO-flag.003", Modifier: "MeshSequenceCache", Could not create reader for file //290skydemo2_flags.abc
WARN (bke.modifier): source/blender/blenkernel/intern/modifier.cc:425 BKE_modifier_set_error: Object: "GEO-flag.001", Modifier: "MeshSequenceCache", Could not create reader for file //290skydemo2_flags.abc
WARN (bke.modifier): source/blender/blenkernel/intern/modifier.cc:425 BKE_modifier_set_error: Object: "GEO-flag.002", Modifier: "MeshSequenceCache", Could not create reader for file //290skydemo2_flags.abc
I1126 09:38:51.075129 997790 device.cpp:39] HIPEW initialization succeeded
I1126 09:38:51.077973 997790 device.cpp:45] Found HIPCC hipcc
I1126 09:38:51.113063 997790 device.cpp:207] Device has compute preemption or is not used for display.
I1126 09:38:51.113076 997790 device.cpp:211] Added device "AMD Instinct MI100" with id "HIP_AMD Instinct MI100_0000:67:00".
I1126 09:38:51.113168 997790 device.cpp:568] Mapped host memory limit set to 62,771,126,272 bytes. (58.46G)
I1126 09:38:51.113412 997790 device_impl.cpp:63] Using AVX2 CPU kernels.
Fra:48 Mem:523.99M (Peak 524.70M) | Time:00:00.95 | Mem:0.00M, Peak:0.00M | Scene, View Layer | Synchronizing object | GEO-Rivets
Fra:48 Mem:523.99M (Peak 524.70M) | Time:00:00.95 | Mem:0.00M, Peak:0.00M | Scene, View Layer | Synchronizing object | GEO-Rivets.007
Fra:48 Mem:524.01M (Peak 524.70M) | Time:00:00.95 | Mem:0.00M, Peak:0.00M | Scene, View Layer | Synchronizing object | GEO-Rivets.011
Fra:48 Mem:524.11M (Peak 524.70M) | Time:00:00.95 | Mem:0.00M, Peak:0.00M | Scene, View Layer | Synchronizing object | GEO-Rivets.014
Fra:48 Mem:524.25M (Peak 524.70M) | Time:00:00.95 | Mem:0.00M, Peak:0.00M | Scene, View Layer | Synchronizing object | GEO-Rivets.019
Fra:48 Mem:524.31M (Peak 524.70M) | Time:00:00.95 | Mem:0.00M, Peak:0.00M | Scene, View Layer | Synchronizing object | GEO-Rivets.023
Fra:48 Mem:524.39M (Peak 524.70M) | Time:00:00.95 | Mem:0.00M, Peak:0.00M | Scene, View Layer | Synchronizing object | GEO-Rivets.026

@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 26, 2024

LLVM Buildbot has detected a new failure on builder premerge-monolithic-linux running on premerge-linux-1 while building llvm at step 7 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/153/builds/15815

Here is the relevant piece of the build log for the reference
Step 7 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: CodeGen/RISCV/compress-opt-select.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: /build/buildbot/premerge-monolithic-linux/build/bin/llc -mtriple=riscv32 -target-abi ilp32d -mattr=+c,+f,+d      -riscv-no-aliases < /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll    | /build/buildbot/premerge-monolithic-linux/build/bin/FileCheck -check-prefix=RV32IFDC /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll
+ /build/buildbot/premerge-monolithic-linux/build/bin/llc -mtriple=riscv32 -target-abi ilp32d -mattr=+c,+f,+d -riscv-no-aliases
+ /build/buildbot/premerge-monolithic-linux/build/bin/FileCheck -check-prefix=RV32IFDC /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll
/build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll:16:18: error: RV32IFDC-NEXT: expected string not found in input
; RV32IFDC-NEXT: addi a0, zero, 42
                 ^
<stdin>:13:9: note: scanning from here
# %bb.1:
        ^
<stdin>:18:13: note: possible intended match here
 .size ne_small_pos, .Lfunc_end0-ne_small_pos
            ^
/build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll:44:18: error: RV32IFDC-NEXT: expected string not found in input
; RV32IFDC-NEXT: addi a0, zero, 42
                 ^
<stdin>:29:9: note: scanning from here
# %bb.1:
        ^
<stdin>:34:8: note: possible intended match here
 .size ne_small_neg, .Lfunc_end1-ne_small_neg
       ^
/build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll:72:18: error: RV32IFDC-NEXT: expected string not found in input
; RV32IFDC-NEXT: addi a0, zero, 42
                 ^
<stdin>:45:9: note: scanning from here
# %bb.1:
        ^
<stdin>:51:2: note: possible intended match here
 .cfi_endproc
 ^
/build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll:100:18: error: RV32IFDC-NEXT: expected string not found in input
; RV32IFDC-NEXT: addi a0, zero, 42
                 ^
<stdin>:61:9: note: scanning from here
# %bb.1:
        ^
<stdin>:66:12: note: possible intended match here
 .size ne_small_edge_neg, .Lfunc_end3-ne_small_edge_neg
           ^
/build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll:129:18: error: RV32IFDC-NEXT: expected string not found in input
; RV32IFDC-NEXT: addi a0, zero, 42
                 ^
<stdin>:77:9: note: scanning from here
# %bb.1:
        ^
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 26, 2024

LLVM Buildbot has detected a new failure on builder llvm-x86_64-debian-dylib running on gribozavr4 while building llvm at step 7 "test-build-unified-tree-check-llvm".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/60/builds/13711

Here is the relevant piece of the build log for the reference
Step 7 (test-build-unified-tree-check-llvm) failure: test (failure)
******************** TEST 'LLVM :: CodeGen/RISCV/compress-opt-select.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: /b/1/llvm-x86_64-debian-dylib/build/bin/llc -mtriple=riscv32 -target-abi ilp32d -mattr=+c,+f,+d      -riscv-no-aliases < /b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll    | /b/1/llvm-x86_64-debian-dylib/build/bin/FileCheck -check-prefix=RV32IFDC /b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll
+ /b/1/llvm-x86_64-debian-dylib/build/bin/llc -mtriple=riscv32 -target-abi ilp32d -mattr=+c,+f,+d -riscv-no-aliases
+ /b/1/llvm-x86_64-debian-dylib/build/bin/FileCheck -check-prefix=RV32IFDC /b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll
/b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll:16:18: error: RV32IFDC-NEXT: expected string not found in input
; RV32IFDC-NEXT: addi a0, zero, 42
                 ^
<stdin>:13:9: note: scanning from here
# %bb.1:
        ^
<stdin>:18:13: note: possible intended match here
 .size ne_small_pos, .Lfunc_end0-ne_small_pos
            ^
/b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll:44:18: error: RV32IFDC-NEXT: expected string not found in input
; RV32IFDC-NEXT: addi a0, zero, 42
                 ^
<stdin>:29:9: note: scanning from here
# %bb.1:
        ^
<stdin>:34:8: note: possible intended match here
 .size ne_small_neg, .Lfunc_end1-ne_small_neg
       ^
/b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll:72:18: error: RV32IFDC-NEXT: expected string not found in input
; RV32IFDC-NEXT: addi a0, zero, 42
                 ^
<stdin>:45:9: note: scanning from here
# %bb.1:
        ^
<stdin>:51:2: note: possible intended match here
 .cfi_endproc
 ^
/b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll:100:18: error: RV32IFDC-NEXT: expected string not found in input
; RV32IFDC-NEXT: addi a0, zero, 42
                 ^
<stdin>:61:9: note: scanning from here
# %bb.1:
        ^
<stdin>:66:12: note: possible intended match here
 .size ne_small_edge_neg, .Lfunc_end3-ne_small_edge_neg
           ^
/b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll:129:18: error: RV32IFDC-NEXT: expected string not found in input
; RV32IFDC-NEXT: addi a0, zero, 42
                 ^
<stdin>:77:9: note: scanning from here
# %bb.1:
        ^
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 26, 2024

LLVM Buildbot has detected a new failure on builder llvm-clang-x86_64-expensive-checks-debian running on gribozavr4 while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/16/builds/9622

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: CodeGen/RISCV/compress-opt-select.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/llc -mtriple=riscv32 -target-abi ilp32d -mattr=+c,+f,+d      -riscv-no-aliases < /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll    | /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/FileCheck -check-prefix=RV32IFDC /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll
+ /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/llc -mtriple=riscv32 -target-abi ilp32d -mattr=+c,+f,+d -riscv-no-aliases
+ /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/FileCheck -check-prefix=RV32IFDC /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll
/b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll:16:18: error: RV32IFDC-NEXT: expected string not found in input
; RV32IFDC-NEXT: addi a0, zero, 42
                 ^
<stdin>:13:9: note: scanning from here
# %bb.1:
        ^
<stdin>:18:13: note: possible intended match here
 .size ne_small_pos, .Lfunc_end0-ne_small_pos
            ^
/b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll:44:18: error: RV32IFDC-NEXT: expected string not found in input
; RV32IFDC-NEXT: addi a0, zero, 42
                 ^
<stdin>:29:9: note: scanning from here
# %bb.1:
        ^
<stdin>:34:8: note: possible intended match here
 .size ne_small_neg, .Lfunc_end1-ne_small_neg
       ^
/b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll:72:18: error: RV32IFDC-NEXT: expected string not found in input
; RV32IFDC-NEXT: addi a0, zero, 42
                 ^
<stdin>:45:9: note: scanning from here
# %bb.1:
        ^
<stdin>:51:2: note: possible intended match here
 .cfi_endproc
 ^
/b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll:100:18: error: RV32IFDC-NEXT: expected string not found in input
; RV32IFDC-NEXT: addi a0, zero, 42
                 ^
<stdin>:61:9: note: scanning from here
# %bb.1:
        ^
<stdin>:66:12: note: possible intended match here
 .size ne_small_edge_neg, .Lfunc_end3-ne_small_edge_neg
           ^
/b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll:129:18: error: RV32IFDC-NEXT: expected string not found in input
; RV32IFDC-NEXT: addi a0, zero, 42
                 ^
<stdin>:77:9: note: scanning from here
# %bb.1:
        ^
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 26, 2024

LLVM Buildbot has detected a new failure on builder lld-x86_64-ubuntu-fast running on as-builder-4 while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/33/builds/7217

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: CodeGen/RISCV/compress-opt-select.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/bin/llc -mtriple=riscv32 -target-abi ilp32d -mattr=+c,+f,+d      -riscv-no-aliases < /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll    | /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/bin/FileCheck -check-prefix=RV32IFDC /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll
+ /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/bin/llc -mtriple=riscv32 -target-abi ilp32d -mattr=+c,+f,+d -riscv-no-aliases
+ /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/bin/FileCheck -check-prefix=RV32IFDC /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll
/home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll:16:18: error: RV32IFDC-NEXT: expected string not found in input
; RV32IFDC-NEXT: addi a0, zero, 42
                 ^
<stdin>:13:9: note: scanning from here
# %bb.1:
        ^
<stdin>:18:13: note: possible intended match here
 .size ne_small_pos, .Lfunc_end0-ne_small_pos
            ^
/home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll:44:18: error: RV32IFDC-NEXT: expected string not found in input
; RV32IFDC-NEXT: addi a0, zero, 42
                 ^
<stdin>:29:9: note: scanning from here
# %bb.1:
        ^
<stdin>:34:8: note: possible intended match here
 .size ne_small_neg, .Lfunc_end1-ne_small_neg
       ^
/home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll:72:18: error: RV32IFDC-NEXT: expected string not found in input
; RV32IFDC-NEXT: addi a0, zero, 42
                 ^
<stdin>:45:9: note: scanning from here
# %bb.1:
        ^
<stdin>:51:2: note: possible intended match here
 .cfi_endproc
 ^
/home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll:100:18: error: RV32IFDC-NEXT: expected string not found in input
; RV32IFDC-NEXT: addi a0, zero, 42
                 ^
<stdin>:61:9: note: scanning from here
# %bb.1:
        ^
<stdin>:66:12: note: possible intended match here
 .size ne_small_edge_neg, .Lfunc_end3-ne_small_edge_neg
           ^
/home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/llvm-project/llvm/test/CodeGen/RISCV/compress-opt-select.ll:129:18: error: RV32IFDC-NEXT: expected string not found in input
; RV32IFDC-NEXT: addi a0, zero, 42
                 ^
<stdin>:77:9: note: scanning from here
# %bb.1:
        ^
...

mga-sc added a commit to mga-sc/llvm-project that referenced this pull request Nov 26, 2024
This test has been failed after commit
[RISCV] Implement tail call optimization in machine outliner (PR llvm#115297).

Changes to the same file were merged today earlier
[TTI][RISCV] Unconditionally break critical edges to sink ADDI (PR llvm#108889).
joker-eph added a commit that referenced this pull request Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants