@@ -13408,10 +13408,6 @@ Value *BoUpSLP::vectorizeTree(
1340813408 const ExtraValueToDebugLocsMap &ExternallyUsedValues,
1340913409 SmallVectorImpl<std::pair<Value *, Value *>> &ReplacedExternals,
1341013410 Instruction *ReductionRoot) {
13411- // All blocks must be scheduled before any instructions are inserted.
13412- for (auto &BSIter : BlocksSchedules) {
13413- scheduleBlock(BSIter.second.get());
13414- }
1341513411 // Clean Entry-to-LastInstruction table. It can be affected after scheduling,
1341613412 // need to rebuild it.
1341713413 EntryToLastInstruction.clear();
@@ -15269,7 +15265,11 @@ bool SLPVectorizerPass::runImpl(Function &F, ScalarEvolution *SE_,
1526915265 R.clearReductionData();
1527015266
1527115267 // Vectorize trees that end at reductions.
15268+ // llvm::outs() << "BB befoer vectorize:\n" << *BB << "\n";
15269+ // llvm::outs().flush();
1527215270 Changed |= vectorizeChainsInBlock(BB, R);
15271+ // llvm::outs() << "BB after vectorize:\n" << *BB << "\n";
15272+ // llvm::outs().flush();
1527315273 }
1527415274
1527515275 if (Changed) {
@@ -15436,14 +15436,25 @@ bool SLPVectorizerPass::vectorizeInsertElementInst(InsertElementInst *IEI,
1543615436 return false;
1543715437
1543815438 LLVM_DEBUG(dbgs() << "SLP: array mappable to vector: " << *IEI << "\n");
15439- return tryToVectorizeList(BuildVectorInsts, R);
15439+ // llvm::outs() << "Before Vectorize the instruction Function:\n" <<
15440+ // *BB->getParent() << "\n";
15441+ auto changed = tryToVectorizeList(BuildVectorInsts, R);
15442+ // llvm::outs() << "After Vectorize the instruction BB:\n" <<
15443+ // *BB->getParent() << "\n"; llvm::outs().flush();
15444+
15445+ return changed;
1544015446}
1544115447
1544215448bool SLPVectorizerPass::vectorizeInserts(InstSetVector &Instructions,
1544315449 BasicBlock *BB, BoUpSLP &R) {
1544415450 assert(all_of(Instructions, IsaPred<InsertElementInst>) &&
1544515451 "This function only accepts Insert instructions");
1544615452 bool OpsChanged = false;
15453+
15454+ // for (auto *I : Instructions) {
15455+ // llvm::outs() << "Vectorize insert instructions: " << *I << "\n";
15456+ // llvm::outs().flush();
15457+ // }
1544715458 // Try to match and vectorize a buildvector sequence.
1544815459 for (auto *I : reverse(Instructions)) {
1544915460 if (R.isDeleted(I))
@@ -15545,8 +15556,11 @@ void mlir::triton::intel::SLPVectorizer(llvm::Module &mod, bool trace) {
1554515556 FunctionPassManager FPM;
1554615557 FPM.addPass(SLPVectorizerPass(trace));
1554715558
15559+ // ::llvm::setCurrentDebugType("SLP");
15560+ // ::llvm::DebugFlag = true;
1554815561 for (llvm::Function &function : mod.functions()) {
1554915562 if (isCandidate(function))
1555015563 FPM.run(function, FAM);
1555115564 }
15565+ // ::llvm::DebugFlag = false;
1555215566}
0 commit comments