[llvm] 786b8fc - [X86] Add vcmpsh/vcmpph to X86InstrInfo::commuteInstructionImpl.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 15 11:39:30 PDT 2021
Author: Craig Topper
Date: 2021-08-15T11:36:13-07:00
New Revision: 786b8fcc9b1eed093926e6d9c36891ab72b7bde3
URL: https://github.com/llvm/llvm-project/commit/786b8fcc9b1eed093926e6d9c36891ab72b7bde3
DIFF: https://github.com/llvm/llvm-project/commit/786b8fcc9b1eed093926e6d9c36891ab72b7bde3.diff
LOG: [X86] Add vcmpsh/vcmpph to X86InstrInfo::commuteInstructionImpl.
They were already added to findCommuteOpIndices, but they also
need to be in X86InstrInfo::commuteInstructionImpl in order
to adjust the immediate control.
Added:
Modified:
llvm/lib/Target/X86/X86InstrInfo.cpp
llvm/test/CodeGen/X86/select-of-half-constants.ll
Removed:
################################################################################
diff --git a/llvm/lib/Target/X86/X86InstrInfo.cpp b/llvm/lib/Target/X86/X86InstrInfo.cpp
index 38a18fddac0b..ab5a34181cc3 100644
--- a/llvm/lib/Target/X86/X86InstrInfo.cpp
+++ b/llvm/lib/Target/X86/X86InstrInfo.cpp
@@ -2241,6 +2241,10 @@ MachineInstr *X86InstrInfo::commuteInstructionImpl(MachineInstr &MI, bool NewMI,
case X86::VCMPSSZrr:
case X86::VCMPPDZrri:
case X86::VCMPPSZrri:
+ case X86::VCMPSHZrr:
+ case X86::VCMPPHZrri:
+ case X86::VCMPPHZ128rri:
+ case X86::VCMPPHZ256rri:
case X86::VCMPPDZ128rri:
case X86::VCMPPSZ128rri:
case X86::VCMPPDZ256rri:
diff --git a/llvm/test/CodeGen/X86/select-of-half-constants.ll b/llvm/test/CodeGen/X86/select-of-half-constants.ll
index e2a2190a1b72..e74e083f8cfe 100644
--- a/llvm/test/CodeGen/X86/select-of-half-constants.ll
+++ b/llvm/test/CodeGen/X86/select-of-half-constants.ll
@@ -16,11 +16,10 @@ define half @fcmp_select_fp_constants_olt(half %x) nounwind readnone {
ret half %r
}
-; FIXME: This should be vcmpgtsh not vcmpltsh.
define half @fcmp_select_fp_constants_ogt(half %x) nounwind readnone {
; X64-AVX512FP16-LABEL: fcmp_select_fp_constants_ogt:
; X64-AVX512FP16: # %bb.0:
-; X64-AVX512FP16-NEXT: vcmpltsh {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %k1
+; X64-AVX512FP16-NEXT: vcmpgtsh {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %k1
; X64-AVX512FP16-NEXT: vmovsh {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
; X64-AVX512FP16-NEXT: vmovsh {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
; X64-AVX512FP16-NEXT: vmovsh %xmm1, %xmm0, %xmm0 {%k1}
More information about the llvm-commits
mailing list