llvm-project/llvm/test/CodeGen/X86/twoaddr-dbg-value.mir
Shengchen Kan c81a121f3f Revert "Revert "[X86] Remove patterns for ADC/SBB with immediate 8 and optimize during MC lowering, NFCI""
This reverts commit cb16b33a03aff70b2499c3452f2f817f3f92d20d.

In fact, the test https://bugs.chromium.org/p/chromium/issues/detail?id=1446973#c2
already passed after 5586bc539acb26cb94e461438de01a5080513401
2023-05-19 22:21:56 +08:00

28 lines
808 B
YAML

# RUN: llc -run-pass=livevars,twoaddressinstruction -mtriple=x86_64-- -o - %s | FileCheck %s
---
name: foo
tracksRegLiveness: true
body: |
bb.0:
liveins: $edi
%0:gr32 = COPY killed $edi
%1:gr32 = COPY killed %0
%4:gr32 = XOR32ri %1, 1, implicit-def dead $eflags
DBG_VALUE %4
%5:gr32 = COPY %4
PUSH32r killed %1, implicit-def $esp, implicit $esp
$eax = COPY killed %5
RET64 implicit killed $eax
...
# Verify that the DBG_VALUE instruction does not inhibit
# TwoAddressInstructionPass::rescheduleMIBelowKill optimization
# CHECK: PUSH32r %1, implicit-def $esp, implicit $esp
# CHECK-NEXT: %2:gr32 = COPY killed %1
# CHECK-NEXT: %2:gr32 = XOR32ri %2, 1, implicit-def dead $eflags
# CHECK-NEXT: DBG_VALUE %2
# CHECK-NEXT: %3:gr32 = COPY killed %2