llvm-project/llvm/test/CodeGen/X86/inlineasm-sched-bug.ll
Nikita Popov c4721872af Revert "[Clang][inlineasm] Add special support for "rm" output constraints (#92040)"
This change landed without approval.

This reverts commit 45e666a8531c1148bdb170b9a120f99e1500c427.
This reverts commit a636dd4c37f12594275de2fe180ca35bc04d76ea.
2026-02-14 15:59:04 +01:00

27 lines
786 B
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3
; PR13504
; RUN: llc -mtriple=i686-- -mcpu=atom < %s | FileCheck %s
; Check that treemap is read before the asm statement.
define i32 @foo(i32 %treemap) nounwind {
; CHECK-LABEL: foo:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: pushl %eax
; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
; CHECK-NEXT: movl %eax, %ecx
; CHECK-NEXT: negl %ecx
; CHECK-NEXT: andl %eax, %ecx
; CHECK-NEXT: movl %ecx, (%esp)
; CHECK-NEXT: #APP
; CHECK-NEXT: bsfl (%esp), %eax
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: popl %ecx
; CHECK-NEXT: retl
entry:
%sub = sub i32 0, %treemap
%and = and i32 %treemap, %sub
%0 = call i32 asm "bsfl $1,$0", "=r,rm"(i32 %and)
ret i32 %0
}