User Details
- User Since
- Jan 13 2022, 8:53 AM (88 w, 3 d)
Aug 3 2023
Thanks for the patch. I am away from home though, I will try giving a look next week!
Sep 28 2022
LGTM. What about doing this also for the definitions?
Sep 27 2022
Easier constructor inheritance
Sep 26 2022
Sep 25 2022
Sep 7 2022
Thanks for addressing the issue
Sep 6 2022
Sep 2 2022
Sep 1 2022
@jpienaar when you are back, please accept the review so that I can then hopefully close it (no hurry, take your time :))
Part of the non-auto-closing issue is that I wrongly put by hand "Differential Review" instead of "Differential Revision", but still I have no option to close it manually
Aug 31 2022
Patch landed, all builds seem fine.
As I have interest in some specific passes for my projects, I will upload additional revisions updating their code to be coherent with what explained in the docs (that is, they need naming change and options usage).
What should I do for the remaining ones (basically, all)? @rriddle was mentioning to open bugs and delegate them, but how should I proceed? One bug for each pass seems a lot to be done manually and would clutter the github issue page. Maybe we should let people discover the change and wait for a volunteer to fix his area of interest? (joking, but not too much :D)
Fix formatting
More conservative patch. Individual pass improvements are going to be handled by additional
patches.
Aug 30 2022
Well, build bots are complaining about some problems.
https://lab.llvm.org/buildbot/#/builders/220/builds/4537
https://lab.llvm.org/buildbot/#/builders/61/builds/31581
Patch seems good from the build bots perspective. I've also dropped the old declarations, as they would not be needed anymore after this patch.
A lot of passes can be further updated to take advantage of the new infra (i.e. inheriting constructors, accepting options, removing redundant option structures), but I would like to separate this into additional and more self-contained patches, and possibly delegate them to more people as they need them to be implemented. My idea behind this patch is to just drop the old autogenerated files and adopt the new ones (patching the whole codebase to reflect the best practices is too much for a single person and sometimes would require discussing names, code organization, etc. which seems out of scope now).
Fix formatting. Still I have to understand why clang-format doesn't run on some apparently random files.
- Drop old declarations
- Fix some tests expecting the old pass names
- Convert missing flang passes
- Rebase to current upstream code
Fix formatting
Fix formatting
Aug 29 2022
Right. I will land D132572, open a new review to merge .cpp.inc into .h.inc (just for passes, fixing all the infra also for types, etc. is a bit too much for me) and then update this patch.
Update flang passes
I've updated the docs. Feel free to comment on them if you feel them not to be clear enough.
In the meanwhile, I've uploaded a first draft regarding the patches to the pass declarations, so we can start discussing about them: D132838
Update docs
Aug 27 2022
@rriddle I'm sorry for the early ping, but I'm fixing the big patch regarding all the passes and I would like to know if the current namespace separation looks good. I'd like to avoid reiterating over all the passes just for this :D
Aug 26 2022
impl namespace for pass base class and friend create constructors
@rriddle thanks for the suggestion, working flawlessly. I have uploaded your fix and removed the changes I was doing to the passes, which I will instead upload in a separate patch in order to avoid a single commit mixing different stuff.
Add createPassNameImpl methods
Aug 25 2022
Aug 24 2022
Wrapping the base class in mlir namespace. It is indeed the correct way to go, but still the
problem persists.
Compilation log (a bit trimmed, for clearness):
@rriddle @mehdi_amini I'm updating my previous modifications to the existing passes but I've realized that the friend trick is not going to work, leading to undefined symbols at link time for what regard the createPassName methods. I suspect that the only solution is to split the GEN_PASS_DEF macro into something like GEN_PASS_DEF_BASECLASS_PASSNAME and GEN_PASS_DEF_CONSTRUCTOR_PASSNAME and include the .cpp.inc autogenerated file both before and after the actual class definition.
If that's ok, I will open a new review for this.
Aug 23 2022
Address comments
Aug 18 2022
Closed by commit 8a10ee7590a91c9b2e5c80b52822a3a4c3af1a15
Forgot to add the review link this time :(
Removed wrong and useless explicit copy constructor from DynamicMemRefType
I've updated the documentation. Please give it a read and tell if it's not clear enough or if I missed something.
Also, I realized that the list options were not handled correctly. Now they generate an ArrayRef variable within the options struct. I've also added a list option within the test pass to check for the correct behaviour.
Handle list option & Update documentation & Remove generated 'Pass' suffix
Aug 17 2022
Address comments
@tjoerg Can you please explain how to reproduce the problem? Running the tests with the following cmake configuration doesn't make them failing: cmake -DENABLE_PROJECTS="clang;mlir;compiler-rt" -DLLVM_USE_SANITIZER="Undefined"
Formatting fix. Somehow, this time git-clang-format didn't warn me (!?).
The old pass base class declarations are emitted in order to preserve backward compatibility.
The test reflects the usage of the patched infrastructure.
Aug 16 2022
I've introduced what we have been discussing yesterday. The flang build still needs to be fixed, but I would like to first reach consensus on the design.
An update wrt one of my previous answers: the definition of struct containing a pass options can now be obtained by including the header of the pass (e.g ConvertMemRefToLLVMPassOptions can be obtained by including mlir/Conversion/MemRefToLLVM/MemRefToLLVM.h)
Introduced both the PASS_GEN_DECL_PassName and PASS_GEN_DEF_PassName. The former allows to import the options struct and the constructors (createPassNamePass() and createPassNamePass(const PassNamePassOptions &options)); these two methods are automatically declared in case of a missing constructor inside the pass TableGen. The latter allows to import the definition of the pass base class.
The declarations can be emitted through the option -gen-pass-decls, like it was before, while the definitions can be generated with the new option -gen-pass-defs.
Aug 15 2022
The options structs are declared inside the mlir/Conversion/Passes.h header. PassDetails.h includes only the pass base classes.
So, just to confirm, do we want a GEN_PASS_PassName define that enables both the options struct and the pass base class? Shouldn't the base class be available only in the PassDetails.h header? With a single define we either miss the public visibility of options (which makes all this useless) or have to accept the base classes having public visibility.