File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33#include " mlir/Target/LLVMIR/ModuleTranslation.h"
44#include " triton/Tools/Sys/GetEnv.hpp"
55#include " llvm/ADT/SmallVector.h"
6+ #include " llvm/Analysis/ScopedNoAliasAA.h"
67#include " llvm/CodeGen/MIRParser/MIRParser.h"
78#include " llvm/CodeGen/MachineModuleInfo.h"
89#include " llvm/CodeGen/MachineRegisterInfo.h"
@@ -466,6 +467,16 @@ std::string translateMIRToASM(const std::string &mirPath,
466467 // Create PassManager
467468 llvm::legacy::PassManager pass;
468469
470+ // IMPORTANT: Add ScopedNoAliasAAWrapperPass to ensure alias analysis
471+ // understands !alias.scope and !noalias metadata during machine scheduling.
472+ //
473+ // When loading MIR directly (swap path), we skip the normal IR optimization
474+ // passes that would register ScopedNoAliasAA. Without this, the machine
475+ // scheduler cannot prove that async buffer loads (BUFFER_LOAD_DWORDX4_LDS)
476+ // don't alias with LDS reads (DS_READ), resulting in unnecessary memory
477+ // dependencies and ~30% performance regression.
478+ pass.add (llvm::createScopedNoAliasAAWrapperPass ());
479+
469480 // Emit code from MIR
470481 std::string result;
471482 {
You can’t perform that action at this time.
0 commit comments