llvm-project/llvm/test/CodeGen/SystemZ/fake-use-size.ll
Stephen Tozer 757a0e6d3b
[SystemZ] Treat FAKE_USE instructions as instructions without a size (#144390)
This patch fixes an error in which `FAKE_USE` instructions would trigger
an assertion in SystemZLongBranch due to them having a size of 0 without
being excepted in the assertion that each instruction, other than a set
of known 0-size instruction types, should have a non-0 size.

`FAKE_USE` instructions are no-op instructions that are emitted into
LLVM by the `-fextend-variable-liveness` clang flag to help preserve the
liveness of source variables in optimized code, and therefore they
should be understood as being valid size 0 instructions.
2025-06-18 10:29:23 +01:00

15 lines
370 B
LLVM

; RUN: llc -O0 < %s -mtriple=s390x-linux-gnu 2>&1 | FileCheck %s
;; Tests that we can handle FAKE_USE instructions, emitting a comment for them
;; in the resulting assembly.
; CHECK: .type idd,@function
; CHECK: # %bb.0:
; CHECK-NEXT: # fake_use:
define double @idd(double %d) {
entry:
notail call void (...) @llvm.fake.use(double %d)
ret double %d
}