[llvm] r302307 - [Hexagon] Disable predicated calls by default
Krzysztof Parzyszek via llvm-commits
llvm-commits at lists.llvm.org
Fri May 5 15:13:58 PDT 2017
Author: kparzysz
Date: Fri May 5 17:13:57 2017
New Revision: 302307
URL: http://llvm.org/viewvc/llvm-project?rev=302307&view=rev
Log:
[Hexagon] Disable predicated calls by default
Modified:
llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.cpp
llvm/trunk/lib/Target/Hexagon/HexagonSubtarget.cpp
llvm/trunk/lib/Target/Hexagon/HexagonSubtarget.h
Modified: llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.cpp?rev=302307&r1=302306&r2=302307&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.cpp Fri May 5 17:13:57 2017
@@ -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,
Modified: llvm/trunk/lib/Target/Hexagon/HexagonSubtarget.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonSubtarget.cpp?rev=302307&r1=302306&r2=302307&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonSubtarget.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonSubtarget.cpp Fri May 5 17:13:57 2017
@@ -73,6 +73,10 @@ static cl::opt<bool> OverrideLongCalls("
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::enableMachineSche
return true;
}
+bool HexagonSubtarget::usePredicatedCalls() const {
+ return EnablePredicatedCalls;
+}
+
void HexagonSubtarget::updateLatency(MachineInstr &SrcInst,
MachineInstr &DstInst, SDep &Dep) const {
if (Dep.isArtificial()) {
Modified: llvm/trunk/lib/Target/Hexagon/HexagonSubtarget.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonSubtarget.h?rev=302307&r1=302306&r2=302307&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonSubtarget.h (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonSubtarget.h Fri May 5 17:13:57 2017
@@ -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;
More information about the llvm-commits
mailing list