Files
llvm-project/llvm/test/CodeGen/RISCV/rv64-stackmap-nops.ll
Jim Lin 3d7eedce56 [RISCV] Fix stackmap shadow trimming NOP size for compressed targets (#189774)
The shadow trimming loop in LowerSTACKMAP hardcoded a 4-byte decrement
per instruction, but when Zca is enabled NOPs are 2 bytes. Use NOPBytes
instead of the hardcoded 4 so the shadow is correctly trimmed on
compressed targets.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-02 08:21:33 +08:00

29 lines
791 B
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=riscv64 | FileCheck %s --check-prefix=CHECK
; RUN: llc < %s -mtriple=riscv64 -mattr=+c | FileCheck %s --check-prefix=RVC
define void @test_shadow_optimization() {
; CHECK-LABEL: test_shadow_optimization:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: .Ltmp0:
; CHECK-NEXT: nop
; CHECK-NEXT: nop
; CHECK-NEXT: nop
; CHECK-NEXT: ret
;
; RVC-LABEL: test_shadow_optimization:
; RVC: # %bb.0: # %entry
; RVC-NEXT: .Ltmp0:
; RVC-NEXT: nop
; RVC-NEXT: nop
; RVC-NEXT: nop
; RVC-NEXT: nop
; RVC-NEXT: nop
; RVC-NEXT: nop
; RVC-NEXT: nop
; RVC-NEXT: ret
entry:
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 0, i32 16)
ret void
}