[llvm] 3e3acc1 - [PowerPC][MachinePipeliner] Enable pipeliner if hasInstrSchedModel

Jinsong Ji via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 10 19:34:48 PDT 2020


Author: Jinsong Ji
Date: 2020-07-11T02:24:12Z
New Revision: 3e3acc1cc773f61470d815165704288118cb27e1

URL: https://github.com/llvm/llvm-project/commit/3e3acc1cc773f61470d815165704288118cb27e1
DIFF: https://github.com/llvm/llvm-project/commit/3e3acc1cc773f61470d815165704288118cb27e1.diff

LOG: [PowerPC][MachinePipeliner] Enable pipeliner if hasInstrSchedModel

P9 is the only one with InstrSchedModel, but we may have more in the
future, we should not hardcoded it to P9, check hasInstrSchedModel
instead.

Reviewed By: hfinkel

Differential Revision: https://reviews.llvm.org/D83590

Added: 
    

Modified: 
    llvm/lib/Target/PowerPC/PPCSubtarget.cpp
    llvm/test/CodeGen/PowerPC/sms-remark.ll

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
index 2acff5d11ce0..3836cc960394 100644
--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
@@ -180,7 +180,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
 bool PPCSubtarget::enableMachineScheduler() const { return true; }
 
 bool PPCSubtarget::enableMachinePipeliner() const {
-  return (CPUDirective == PPC::DIR_PWR9) && EnableMachinePipeliner;
+  return getSchedModel().hasInstrSchedModel() && EnableMachinePipeliner;
 }
 
 bool PPCSubtarget::useDFAforSMS() const { return false; }

diff  --git a/llvm/test/CodeGen/PowerPC/sms-remark.ll b/llvm/test/CodeGen/PowerPC/sms-remark.ll
index 647b56fa7fcd..e68eb5631df4 100644
--- a/llvm/test/CodeGen/PowerPC/sms-remark.ll
+++ b/llvm/test/CodeGen/PowerPC/sms-remark.ll
@@ -1,14 +1,19 @@
 ; RUN: llc < %s -ppc-vsr-nums-as-vr -mtriple=powerpc64-unknown-linux-gnu \
 ; RUN:       -verify-machineinstrs -ppc-asm-full-reg-names -mcpu=pwr9 --ppc-enable-pipeliner \
 ; RUN:       -pass-remarks-analysis=pipeliner -pass-remarks=pipeliner -o /dev/null 2>&1 \
-; RUN:       | FileCheck %s
+; RUN:       | FileCheck %s --check-prefix=ENABLED
+; RUN: llc < %s -ppc-vsr-nums-as-vr -mtriple=powerpc64-unknown-linux-gnu \
+; RUN:       -verify-machineinstrs -ppc-asm-full-reg-names -mcpu=pwr8 --ppc-enable-pipeliner \
+; RUN:       -pass-remarks-analysis=pipeliner -pass-remarks=pipeliner -o /dev/null 2>&1 \
+; RUN:       | FileCheck %s --allow-empty --check-prefix=DISABLED
 
 @x = dso_local local_unnamed_addr global <{ i32, i32, i32, i32, [1020 x i32] }> <{ i32 1, i32 2, i32 3, i32 4, [1020 x i32] zeroinitializer }>, align 4
 @y = dso_local global [1024 x i32] zeroinitializer, align 4
 
 define dso_local i32* @foo() local_unnamed_addr {
-;CHECK: Schedule found with Initiation Interval
-;CHECK: Pipelined succesfully!
+;ENABLED: Schedule found with Initiation Interval
+;ENABLED: Pipelined succesfully!
+;DISABLED-NOT: remark
 entry:
   %.pre = load i32, i32* getelementptr inbounds ([1024 x i32], [1024 x i32]* @y, i64 0, i64 0), align 4
   br label %for.body


        


More information about the llvm-commits mailing list