summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwanglei <wanglei@loongson.cn>2025-10-13 16:55:51 +0800
committerwanglei <wanglei@loongson.cn>2025-10-13 16:55:51 +0800
commit71b16387b0884ab5e24aada5dbebf2a584f6cfe5 (patch)
tree7126f25ce646fb1c1501d5b40649981bc869b0b1
parentcdc8e8d092619b318d69c61a941246a31c8cd26f (diff)
Created using spr 1.3.7
-rw-r--r--llvm/lib/Target/LoongArch/LoongArchSubtarget.cpp10
-rw-r--r--llvm/lib/Target/LoongArch/LoongArchSubtarget.h2
2 files changed, 11 insertions, 1 deletions
diff --git a/llvm/lib/Target/LoongArch/LoongArchSubtarget.cpp b/llvm/lib/Target/LoongArch/LoongArchSubtarget.cpp
index 3acbe4992273..6463fbb6922f 100644
--- a/llvm/lib/Target/LoongArch/LoongArchSubtarget.cpp
+++ b/llvm/lib/Target/LoongArch/LoongArchSubtarget.cpp
@@ -22,11 +22,21 @@ using namespace llvm;
#define GET_SUBTARGETINFO_CTOR
#include "LoongArchGenSubtargetInfo.inc"
+static cl::opt<bool>
+ DisableMISched("loongarch-disable-misched", cl::Hidden,
+ cl::desc("Disable LoongArch MI Scheduling"));
+
static cl::opt<bool> UseAA("loongarch-use-aa", cl::init(true),
cl::desc("Enable the use of AA during codegen."));
void LoongArchSubtarget::anchor() {}
+bool LoongArchSubtarget::enableMachineScheduler() const {
+ if (DisableMISched.getNumOccurrences())
+ return !DisableMISched;
+ return true;
+}
+
// Enable use of alias analysis during code generation (during MI scheduling,
// DAGCombine, etc.).
bool LoongArchSubtarget::useAA() const { return UseAA; }
diff --git a/llvm/lib/Target/LoongArch/LoongArchSubtarget.h b/llvm/lib/Target/LoongArch/LoongArchSubtarget.h
index 5e12bafebb0d..10266e93ee5d 100644
--- a/llvm/lib/Target/LoongArch/LoongArchSubtarget.h
+++ b/llvm/lib/Target/LoongArch/LoongArchSubtarget.h
@@ -104,7 +104,7 @@ public:
Align getPrefLoopAlignment() const { return PrefLoopAlignment; }
unsigned getMaxBytesForAlignment() const { return MaxBytesForAlignment; }
unsigned getMaxInterleaveFactor() const { return MaxInterleaveFactor; }
- bool enableMachineScheduler() const override { return true; }
+ bool enableMachineScheduler() const override;
bool useAA() const override;
};
} // end namespace llvm