[deploy]暂时禁用-O1

This commit is contained in:
Lixuanwang
2025-08-20 09:46:38 +08:00
parent 7d732f0512
commit 8ba2e8397c
2 changed files with 5 additions and 2 deletions

View File

@@ -256,7 +256,7 @@ std::string RISCv64CodeGen::function_gen(Function* func) {
<< ss_after_eli.str();
}
if (optLevel > 0) {
if (optLevel == 0) {
// 阶段 2.1: 除法强度削弱优化 (Division Strength Reduction)
DivStrengthReduction div_strength_reduction;
div_strength_reduction.runOnMachineFunction(mfunc.get());
@@ -372,7 +372,7 @@ std::string RISCv64CodeGen::function_gen(Function* func) {
mfunc->dumpStackFrameInfo(std::cerr);
}
if (optLevel > 0) {
if (optLevel == 0) {
// 阶段 4: 窥孔优化 (Peephole Optimization)
PeepholeOptimizer peephole;
peephole.runOnMachineFunction(mfunc.get());

View File

@@ -70,6 +70,9 @@ void parseArgs(int argc, char **argv) {
if (optLevel < 0) {
cerr << "Error: Optimization level must be non-negative." << endl;
usage(EXIT_FAILURE);
} else if (optLevel > 0) {
cerr << "Debugging, set optLevel to 0...\n";
optLevel = 0;
}
} catch (const std::invalid_argument& ia) {
cerr << "Error: Invalid argument for -O: " << optarg << endl;