[PowerPC] Do not emit dssall on AIX

This instruction is a nop on all server cores (certainly on all
cores that AIX supports) so it is fine to emit a nop instead of it.
In fact, that is exactly what XL emits. So we emit a nop on AIX
and we leave the codegen as is on other platforms since there may
indeed be cores out there for which this actually does some prefetching.
This commit is contained in:
Nemanja Ivanovic 2021-05-17 06:05:36 -05:00
parent e827d74a97
commit 74ae778176
3 changed files with 31 additions and 1 deletions

View File

@ -347,7 +347,7 @@ def DSS : DSS_Form<0, 822, (outs), (ins u5imm:$STRM),
} }
def DSSALL : DSS_Form<1, 822, (outs), (ins), def DSSALL : DSS_Form<1, 822, (outs), (ins),
"dssall", IIC_LdStLoad /*FIXME*/, [(int_ppc_altivec_dssall)]>, "dssall", IIC_LdStLoad /*FIXME*/, []>,
Deprecated<DeprecatedDST> { Deprecated<DeprecatedDST> {
let STRM = 0; let STRM = 0;
let A = 0; let A = 0;
@ -865,6 +865,13 @@ def V_SETALLONES : VXForm_3<908, (outs vrrc:$vD), (ins),
def : InstAlias<"vmr $vD, $vA", (VOR vrrc:$vD, vrrc:$vA, vrrc:$vA)>; def : InstAlias<"vmr $vD, $vA", (VOR vrrc:$vD, vrrc:$vA, vrrc:$vA)>;
def : InstAlias<"vnot $vD, $vA", (VNOR vrrc:$vD, vrrc:$vA, vrrc:$vA)>; def : InstAlias<"vnot $vD, $vA", (VNOR vrrc:$vD, vrrc:$vA, vrrc:$vA)>;
// This is a nop on all supported architectures and the AIX assembler
// doesn't support it (and will not be updated to support it).
let Predicates = [IsAIX] in
def : Pat<(int_ppc_altivec_dssall), (NOP)>;
let Predicates = [NotAIX] in
def : Pat<(int_ppc_altivec_dssall), (DSSALL)>;
// Rotates. // Rotates.
def : Pat<(v16i8 (rotl v16i8:$vA, v16i8:$vB)), def : Pat<(v16i8 (rotl v16i8:$vA, v16i8:$vB)),
(v16i8 (VRLB v16i8:$vA, v16i8:$vB))>; (v16i8 (VRLB v16i8:$vA, v16i8:$vB))>;

View File

@ -1178,6 +1178,8 @@ def IsNotISA3_1 : Predicate<"!Subtarget->isISA3_1()">;
// AIX assembler may not be modern enough to support some extended mne. // AIX assembler may not be modern enough to support some extended mne.
def ModernAs: Predicate<"!Subtarget->isAIXABI() || Subtarget->HasModernAIXAs">, def ModernAs: Predicate<"!Subtarget->isAIXABI() || Subtarget->HasModernAIXAs">,
AssemblerPredicate<(any_of (not AIXOS), FeatureModernAIXAs)>; AssemblerPredicate<(any_of (not AIXOS), FeatureModernAIXAs)>;
def IsAIX : Predicate<"Subtarget->isAIXABI()">;
def NotAIX : Predicate<"!Subtarget->isAIXABI()">;
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// PowerPC Multiclass Definitions. // PowerPC Multiclass Definitions.

View File

@ -0,0 +1,21 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc-ibm-aix-xcoff | \
; RUN: FileCheck %s
; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64le-- | \
; RUN: FileCheck %s --check-prefix=NOTAIX
define dso_local void @test() local_unnamed_addr {
; CHECK-LABEL: test:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: nop
; CHECK-NEXT: blr
;
; NOTAIX-LABEL: test:
; NOTAIX: # %bb.0: # %entry
; NOTAIX-NEXT: dssall
; NOTAIX-NEXT: blr
entry:
tail call void @llvm.ppc.altivec.dssall()
ret void
}
declare void @llvm.ppc.altivec.dssall()