[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

llvm-svn: 357384
This commit is contained in:
Clement Courbet 2019-04-01 13:48:50 +00:00
parent bf55c4e3e3
commit 7e062c9b1f
3 changed files with 11 additions and 2 deletions

View File

@ -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::getRegBankInfo() const {
bool X86Subtarget::enableEarlyIfConversion() const {
return hasCMov() && X86EarlyIfConv;
}
void X86Subtarget::getPostRAMutations(
std::vector<std::unique_ptr<ScheduleDAGMutation>> &Mutations) const {
Mutations.push_back(createX86MacroFusionDAGMutation());
}

View File

@ -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;
}

View File

@ -45,8 +45,8 @@ define i32 @macrofuse_test_je(i32 %flags, i8* %p) nounwind {
; 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, i8* %p) nounwind {
;
; 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