Skip to content

[OpClassifier](fix) propagate per-result core_type for multi-result s… - #1882

Open
245516766 wants to merge 1 commit into
triton-lang:main-devfrom
245516766:yeild
Open

[OpClassifier](fix) propagate per-result core_type for multi-result s…#1882
245516766 wants to merge 1 commit into
triton-lang:main-devfrom
245516766:yeild

Conversation

@245516766

Copy link
Copy Markdown
Contributor

…cf ops

New contributor declaration

  • I am not making a trivial change, such as fixing a typo in a comment.

  • I have written a PR description following these
    rules.

  • I have run pre-commit run --from-ref origin/main --to-ref HEAD.

  • Select one of the following.

    • I have added tests.
      • /test for lit tests
      • /unittest for C++ tests
      • /python/test for end-to-end tests
    • This PR does not need a test because FILL THIS IN.
  • Select one of the following.

    • I have not added any lit tests.
    • The lit tests I have added follow these best practices,
      including the "tests should be minimal" section. (Usually running Python code
      and using the instructions it generates is not minimal.)

@github-actions github-actions Bot added compiler Changes to C/C++ compiler backend (lib/, include/) python Changes to Python runtime or bindings ascend-backend Changes to the Ascend NPU backend labels Aug 31, 2026
if (!isa<scf::SCFDialect>(def->getDialect())) {
LLVM_DEBUG(DBGS() << "[handleSCFYield] ERROR: def has multiple "
"results but is not scf dialect: "
<< def->getName().getStringRef() << "\n");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

最好直接打印 op,而不是 op 名称,方便定位

Comment on lines +1436 to +1437
auto ctAttr = def->getAttr("ssbuffer.core_type");
if (auto ctStrAttr = dyn_cast<StringAttr>(ctAttr)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

用 getAttrOfType(kCoreType)

auto ctAttr = def->getAttr("ssbuffer.core_type");
if (auto ctStrAttr = dyn_cast<StringAttr>(ctAttr)) {
std::string ctStr = ctStrAttr.getValue().str();
coreTypes.push_back(parseCoreTypeFromString(ctStr, resultIdx));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

架构可以改进:把 Value 对应的 CoreType 记录下来,最终 stamp 到 ir

if (isa<scf::YieldOp>(elseYield)) {
processYieldOperation(elseYield, thenYield);
// Walk all scf.yield operations directly
getOperation().walk([&](scf::YieldOp yield) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

walkWalkOrder::PostOrder

// multi-value)
auto ctAttr = def->getAttr("ssbuffer.core_type");
if (auto ctStrAttr = dyn_cast<StringAttr>(ctAttr)) {
std::string ctStr = ctStrAttr.getValue().str();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里用 StringRef 编译效率会更高一些

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ascend-backend Changes to the Ascend NPU backend compiler Changes to C/C++ compiler backend (lib/, include/) python Changes to Python runtime or bindings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants