[all-commits] [llvm/llvm-project] 1295d2: [LLVM] Add IRNormalizer Pass (#68176)
Justin Fargnoli via All-commits
all-commits at lists.llvm.org
Mon Oct 21 18:11:33 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 1295d2e6da2fe90f3b770ab1d35bf5caecd38bed
https://github.com/llvm/llvm-project/commit/1295d2e6da2fe90f3b770ab1d35bf5caecd38bed
Author: Justin Fargnoli <justinfargnoli at gmail.com>
Date: 2024-10-21 (Mon, 21 Oct 2024)
Changed paths:
M llvm/docs/Passes.rst
M llvm/docs/ReleaseNotes.md
A llvm/include/llvm/Transforms/Utils/IRNormalizer.h
M llvm/lib/Passes/PassBuilder.cpp
M llvm/lib/Passes/PassRegistry.def
M llvm/lib/Transforms/Utils/CMakeLists.txt
A llvm/lib/Transforms/Utils/IRNormalizer.cpp
A llvm/test/Transforms/IRNormalizer/naming-args-instr-blocks.ll
A llvm/test/Transforms/IRNormalizer/naming-arguments.ll
A llvm/test/Transforms/IRNormalizer/naming.ll
A llvm/test/Transforms/IRNormalizer/regression-convergence-tokens.ll
A llvm/test/Transforms/IRNormalizer/regression-coro-elide-musttail.ll
A llvm/test/Transforms/IRNormalizer/regression-deoptimize.ll
A llvm/test/Transforms/IRNormalizer/regression-dont-hoist-deoptimize.ll
A llvm/test/Transforms/IRNormalizer/regression-infinite-loop.ll
A llvm/test/Transforms/IRNormalizer/reordering-basic.ll
A llvm/test/Transforms/IRNormalizer/reordering.ll
Log Message:
-----------
[LLVM] Add IRNormalizer Pass (#68176)
Add the llvm-canon tool. Description from the [original
PR](https://reviews.llvm.org/D66029#change-wZv3yOpDdxIu):
> Added a new llvm-canon tool which aims to transform LLVM Modules into
a canonical form by reordering and renaming instructions while
preserving the same semantics. This tool makes it easier to spot
semantic differences while diffing two modules which have undergone
different transformation passes.
The current version of this tool can:
- Reorder instructions within a function.
- Rename instructions based on the operands.
- Sort commutative operands.
This code was originally written by @michalpaszkowski and [submitted to
mainline
LLVM](https://github.com/llvm/llvm-project/commit/14d358537f124a732adad1ec6edf3981dc9baece).
However, it was quickly
[reverted](https://github.com/llvm/llvm-project/commit/335de55fa3384946f1e62050f2545c0966163236)
to do BuildBot errors.
Michal presented his version of the tool in [LLVM-Canon: Shooting for
Clear Diffs](https://www.youtube.com/watch?v=c9WMijSOEUg).
@AidanGoldfarb and I ported the code to the new pass manager, added more
tests, and fixed some bugs related to PHI nodes that may have been the
root cause of the BuildBot errors that caused the patch to be reverted.
Additionally, we rewrote the implementation of instruction reordering to
fix cases where the original algorithm would break use-def chains.
Note that this is @AidanGoldfarb and I's first time submitting to LLVM.
Please liberally critique the PR!
CC @plotfi for initial review.
---------
Co-authored-by: Aidan <aidan.goldfarb at mail.mcgill.ca>
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list