Page MenuHomePhabricator

[mlir] Fix a build error and a warning in mlir

Authored by isuruf on Jun 5 2020, 10:49 AM.



Diff Detail

Event Timeline

isuruf created this revision.Jun 5 2020, 10:49 AM
Herald added a project: Restricted Project. · View Herald Transcript
silvas requested changes to this revision.Jun 5 2020, 11:00 AM
silvas added inline comments.

Why is this needed?

This revision now requires changes to proceed.Jun 5 2020, 11:00 AM
isuruf marked an inline comment as done.Jun 5 2020, 11:03 AM
isuruf added inline comments.

Because mlir_tablegen call in Line 3 will try to create the IR/ file without creating the IR directory.

@tpopp can you PTAL at this? Surely we aren't the first using DRR inside mlir core, and I didn't find evidence that this CMakeLists.txt annotation was needed for them. Wild guess, but perhaps we can put the in lib/ ?

mlir/Dialect/Vector/CMakeLists.txt doesn't seem to need this?

If this is critically breaking bots then we should revert the original patch. We should take some time to get to the bottom of this specific issue. I don't think that MAKE_DIRECTORY is the right solution here.

isuruf added a comment.Jun 5 2020, 1:35 PM

@silvas, mlir_tablegen(IR/ -gen-rewriters) is the only call in the MLIR project with a folder (IR) in it. Others look like mlir_tablegen( -gen-enum-decls)

Maybe you could move to a slightly different directory structure and follow what other dialects are doing. Using a top-level CMakeLists.txt like

# lib/Dialect/Shape/CMakeLists.txt

and then add the dialect library generation directives in lib/Dialect/Shape/IR?
I think it would make sense to follow the same conventions as, say, the Linalg dialect.

tpopp added a comment.Jun 6 2020, 1:24 AM

First, sorry for the breakage.

If you want to revert the changes, for now you would need to revert both and

I'm not able to reproduce it myself and don't see it in the buildbots, but assuming this works, sounds like a good final end state like Kayjukh suggested, but I could do this and undo the reverts after also.

(I'm not commenting on the DRR because I'm not sure what that stands for).

tpopp added a comment.Jun 6 2020, 2:08 AM

As more people are complaining, I'm going ahead and reverting the CLs that added and rely on this new file.