[llvm] r357384 - [X86] Make post-ra scheduling macrofusion-aware.
Clement Courbet via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 1 06:48:51 PDT 2019
Author: courbet
Date: Mon Apr 1 06:48:50 2019
New Revision: 357384
URL: http://llvm.org/viewvc/llvm-project?rev=357384&view=rev
Log:
[X86] Make post-ra scheduling macrofusion-aware.
Subscribers: MatzeB, arsenm, jvesely, nhaehnle, hiraditya, javed.absar, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59688
Modified:
llvm/trunk/lib/Target/X86/X86Subtarget.cpp
llvm/trunk/lib/Target/X86/X86Subtarget.h
llvm/trunk/test/CodeGen/X86/testb-je-fusion.ll
Modified: llvm/trunk/lib/Target/X86/X86Subtarget.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Subtarget.cpp?rev=357384&r1=357383&r2=357384&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86Subtarget.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86Subtarget.cpp Mon Apr 1 06:48:50 2019
@@ -14,6 +14,7 @@
#include "X86CallLowering.h"
#include "X86LegalizerInfo.h"
+#include "X86MacroFusion.h"
#include "X86RegisterBankInfo.h"
#include "X86Subtarget.h"
#include "MCTargetDesc/X86BaseInfo.h"
@@ -366,3 +367,8 @@ const RegisterBankInfo *X86Subtarget::ge
bool X86Subtarget::enableEarlyIfConversion() const {
return hasCMov() && X86EarlyIfConv;
}
+
+void X86Subtarget::getPostRAMutations(
+ std::vector<std::unique_ptr<ScheduleDAGMutation>> &Mutations) const {
+ Mutations.push_back(createX86MacroFusionDAGMutation());
+}
Modified: llvm/trunk/lib/Target/X86/X86Subtarget.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Subtarget.h?rev=357384&r1=357383&r2=357384&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86Subtarget.h (original)
+++ llvm/trunk/lib/Target/X86/X86Subtarget.h Mon Apr 1 06:48:50 2019
@@ -843,6 +843,9 @@ public:
bool enableEarlyIfConversion() const override;
+ void getPostRAMutations(
+ std::vector<std::unique_ptr<ScheduleDAGMutation>> &Mutations) const;
+
AntiDepBreakMode getAntiDepBreakMode() const override {
return TargetSubtargetInfo::ANTIDEP_CRITICAL;
}
Modified: llvm/trunk/test/CodeGen/X86/testb-je-fusion.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/testb-je-fusion.ll?rev=357384&r1=357383&r2=357384&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/testb-je-fusion.ll (original)
+++ llvm/trunk/test/CodeGen/X86/testb-je-fusion.ll Mon Apr 1 06:48:50 2019
@@ -45,8 +45,8 @@ define i32 @macrofuse_test_je(i32 %flags
; BRANCHFUSION_POSTRA-LABEL: macrofuse_test_je:
; BRANCHFUSION_POSTRA: # %bb.0: # %entry
; BRANCHFUSION_POSTRA-NEXT: xorl %eax, %eax
-; BRANCHFUSION_POSTRA-NEXT: testl $512, %edi # imm = 0x200
; BRANCHFUSION_POSTRA-NEXT: movb $1, (%rsi)
+; BRANCHFUSION_POSTRA-NEXT: testl $512, %edi # imm = 0x200
; BRANCHFUSION_POSTRA-NEXT: je .LBB0_2
; BRANCHFUSION_POSTRA-NEXT: # %bb.1: # %if.then
; BRANCHFUSION_POSTRA-NEXT: movl $1, %eax
@@ -105,8 +105,8 @@ define i32 @macrofuse_cmp_je(i32 %flags,
;
; BRANCHFUSION_POSTRA-LABEL: macrofuse_cmp_je:
; BRANCHFUSION_POSTRA: # %bb.0: # %entry
-; BRANCHFUSION_POSTRA-NEXT: cmpl $512, %edi # imm = 0x200
; BRANCHFUSION_POSTRA-NEXT: movb $1, (%rsi)
+; BRANCHFUSION_POSTRA-NEXT: cmpl $512, %edi # imm = 0x200
; BRANCHFUSION_POSTRA-NEXT: je .LBB1_1
; BRANCHFUSION_POSTRA-NEXT: # %bb.2: # %if.then
; BRANCHFUSION_POSTRA-NEXT: movl $1, %eax
More information about the llvm-commits
mailing list