[Hexagon] Disable predicated calls by default

llvm-svn: 302307
This commit is contained in:
Krzysztof Parzyszek
2017-05-05 22:13:57 +00:00
parent e260332838
commit ee93e009c8
3 changed files with 18 additions and 1 deletions

View File

@@ -1467,7 +1467,15 @@ bool HexagonInstrInfo::DefinesPredicate(
}
bool HexagonInstrInfo::isPredicable(const MachineInstr &MI) const {
return MI.getDesc().isPredicable();
if (!MI.getDesc().isPredicable())
return false;
if (MI.isCall() || isTailCall(MI)) {
const MachineFunction &MF = *MI.getParent()->getParent();
if (!MF.getSubtarget<HexagonSubtarget>().usePredicatedCalls())
return false;
}
return true;
}
bool HexagonInstrInfo::isSchedulingBoundary(const MachineInstr &MI,

View File

@@ -73,6 +73,10 @@ static cl::opt<bool> OverrideLongCalls("hexagon-long-calls",
cl::Hidden, cl::ZeroOrMore, cl::init(false),
cl::desc("If present, forces/disables the use of long calls"));
static cl::opt<bool> EnablePredicatedCalls("hexagon-pred-calls",
cl::Hidden, cl::ZeroOrMore, cl::init(false),
cl::desc("Consider calls to be predicable"));
void HexagonSubtarget::initializeEnvironment() {
UseMemOps = false;
ModeIEEERndNear = false;
@@ -257,6 +261,10 @@ bool HexagonSubtarget::enableMachineScheduler() const {
return true;
}
bool HexagonSubtarget::usePredicatedCalls() const {
return EnablePredicatedCalls;
}
void HexagonSubtarget::updateLatency(MachineInstr &SrcInst,
MachineInstr &DstInst, SDep &Dep) const {
if (Dep.isArtificial()) {

View File

@@ -104,6 +104,7 @@ public:
bool useHVXDblOps() const { return UseHVXOps && UseHVXDblOps; }
bool useHVXSglOps() const { return UseHVXOps && !UseHVXDblOps; }
bool useLongCalls() const { return UseLongCalls; }
bool usePredicatedCalls() const;
bool useBSBScheduling() const { return UseBSBScheduling; }
bool enableMachineScheduler() const override;