Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FunctionOpInterface is incompatible with SingleBlock trait #54807

Closed
stellaraccident opened this issue Apr 8, 2022 · 1 comment
Closed

FunctionOpInterface is incompatible with SingleBlock trait #54807

stellaraccident opened this issue Apr 8, 2022 · 1 comment
Labels
mlir:core MLIR Core Infrastructure

Comments

@stellaraccident
Copy link
Contributor

The default implementation of FunctionOpInterface::verifyBody() delegates to $_op.front(), but the interface methods of FunctionOpInterface may be shadowed in various ways making this illegal to assume. Concretely, the SingleBlock trait defines front() (and a number of other things) differently, resulting in ambiguous symbol resolution.

This can be pretty easily fixed locally by accessing generically in the generated code: Block &entryBlock = $_op->getRegion(0).front(); but it is a shame that these APIs shadow each other in this way.

@stellaraccident stellaraccident added the mlir:core MLIR Core Infrastructure label Apr 8, 2022
@llvmbot
Copy link
Collaborator

llvmbot commented Apr 8, 2022

@llvm/issue-subscribers-mlir-core

mem-frob pushed a commit to draperlaboratory/hope-llvm-project that referenced this issue Oct 7, 2022
Since the actual implementation class can arbitrarily shadow parts of the FunctionOpInterface exported API, access the body generically instead of via the use of the interface being defined.

Fixes llvm/llvm-project#54807

Differential Revision: https://reviews.llvm.org/D123757
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mlir:core MLIR Core Infrastructure
Projects
None yet
Development

No branches or pull requests

2 participants