1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 05:01:59 +01:00
llvm-mirror/test/CodeGen/X86/peephole.mir
Craig Topper f90261141b Revert r359392 and r358887
Reverts "[X86] Remove (V)MOV64toSDrr/m and (V)MOVDI2SSrr/m. Use 128-bit result MOVD/MOVQ and COPY_TO_REGCLASS instead"
Reverts "[TargetLowering][AMDGPU][X86] Improve SimplifyDemandedBits bitcast handling"

Eric Christopher and Jorge Gorbe Moya reported some issues with these patches to me off list.

Removing the CodeGenOnly instructions has changed how fneg is handled during fast-isel with sse/sse2. We're now emitting fsub -0.0, x instead
moving to the integer domain(in a GPR), xoring the sign bit, and then moving back to xmm. This is because the fast isel table no longer
contains an entry for (f32/f64 bitcast (i32/i64)) so the target independent fneg code fails. The use of fsub changes the behavior of nan with
respect to -O2 codegen which will always use a pxor. NOTE: We still have a difference with double with -m32 since the move to GPR doesn't work
there. I'll file a separate PR for that and add test cases.

Since removing the CodeGenOnly instructions was fixing PR41619, I'm reverting r358887 which exposed that PR. Though I wouldn't be surprised
if that bug can still be hit independent of that.

This should hopefully get Google back to green. I'll work with Simon and other X86 folks to figure out how to move forward again.

llvm-svn: 360066
2019-05-06 19:29:24 +00:00

41 lines
988 B
YAML

# RUN: llc -mtriple=x86_64-- -run-pass=peephole-opt %s -o - | FileCheck %s
--- |
define void @func() { ret void }
...
---
# Check that instructions with MI.isBitcast() are only replaced by COPY if there
# are no SUBREG_TO_REG users.
# CHECK-LABEL: name: func
name: func
registers:
- { id: 0, class: gr32 }
- { id: 1, class: fr32 }
- { id: 2, class: gr32 }
- { id: 3, class: gr32 }
- { id: 4, class: fr32 }
- { id: 5, class: gr32 }
- { id: 6, class: gr64 }
body: |
bb.0:
; CHECK: %1:fr32 = VMOVDI2SSrr %0
; CHECK: %7:gr32 = COPY %0
; CHECK: NOOP implicit %7
%0 = MOV32ri 42
%1 = VMOVDI2SSrr %0
%2 = MOVSS2DIrr %1
NOOP implicit %2
; CHECK: %4:fr32 = VMOVDI2SSrr %3
; CHECK-NOT: COPY
; CHECK: %5:gr32 = MOVSS2DIrr %4
; CHECK: %6:gr64 = SUBREG_TO_REG %5, 0
; CHECK: NOOP implicit %6
%3 = MOV32ri 42
%4 = VMOVDI2SSrr %3
%5 = MOVSS2DIrr %4
%6 = SUBREG_TO_REG %5, 0, %subreg.sub_32bit
NOOP implicit %6
...