llvm-project/llvm/test/CodeGen/X86/GlobalISel/select-intrinsic-x86-flags-...

28 lines
914 B
YAML

# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple=i386-- -run-pass=instruction-select -verify-machineinstrs -global-isel %s -o - | FileCheck %s
--- |
define void @read_flags() { ret void }
...
---
# Check that we select a the x86.flags.read.u32 intrinsic into a RDFLAGS
# instruction. Also check that we constrain the register class of the COPY to
# gr32.
name: read_flags
legalized: true
regBankSelected: true
registers:
- { id: 0, class: gpr }
body: |
bb.0:
; CHECK-LABEL: name: read_flags
; CHECK: [[RDFLAGS32_:%[0-9]+]]:gr32 = RDFLAGS32 implicit-def %esp, implicit %esp
; CHECK: [[SUBREG_TO_REG:%[0-9]+]]:gr64 = SUBREG_TO_REG 0, [[RDFLAGS32_]], %subreg.sub_32bit
; CHECK: %rax = COPY [[SUBREG_TO_REG]]
%0(s32) = G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.x86.flags.read.u32)
%rax = COPY %0(s32)
...