deploy-20250820-3 #1

Merged
gh0s7 merged 352 commits from deploy-20250820-3 into master 2025-08-20 21:20:33 +08:00
Showing only changes of commit 06a368db39 - Show all commits

View File

@@ -614,12 +614,9 @@ bool StrengthReductionContext::createNewInductionVariable(StrengthReductionCandi
return false;
}
// 1. 在循环头创建新的 phi 指令
builder->setPosition(header, header->begin());
candidate->newPhi = builder->createPhiInst(originalPhi->getType());
candidate->newPhi->setName(originalPhi->getName() + "_sr");
// 2. 找到原始归纳变量的初始值和步长
// 1. 找到原始归纳变量的初始值和步长
Value* initialValue = nullptr;
Value* stepValue = nullptr;
BasicBlock* latchBlock = nullptr;
@@ -651,6 +648,11 @@ bool StrengthReductionContext::createNewInductionVariable(StrengthReductionCandi
return false;
}
// 2. 在循环头创建新的 phi 指令
builder->setPosition(header, header->begin());
candidate->newPhi = builder->createPhiInst(originalPhi->getType());
candidate->newPhi->setName(originalPhi->getName() + "_sr");
// 3. 计算新归纳变量的初始值和步长
// 新IV的初始值 = 原IV初始值 * multiplier
Value* newInitialValue;