Files
clang-p2996/llvm/lib/Transforms/Utils/CMakeLists.txt
Justin Fargnoli 2e9f8696e9 Reland "[LLVM] Add IRNormalizer Pass" (#113780)
`IRNormalizer` will reorder instructions. Thus, we need to invalidate
analyses. Done in cd500d28cba3177c213f2f2faf50f14ea56e230b. This should
resolve the [BuildBot
failure](https://github.com/llvm/llvm-project/pull/68176#issuecomment-2428243474).

---

Original PR: #68176
Original commit: 1295d2e6da
Reverted with: 8a12e0131f

---

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](14d358537f).
However, it was quickly
[reverted](335de55fa3)
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@mail.mcgill.ca>
2024-11-14 09:56:22 -08:00

105 lines
2.1 KiB
CMake

add_llvm_component_library(LLVMTransformUtils
AddDiscriminators.cpp
AMDGPUEmitPrintf.cpp
ASanStackFrameLayout.cpp
AssumeBundleBuilder.cpp
BasicBlockUtils.cpp
BreakCriticalEdges.cpp
BuildLibCalls.cpp
BypassSlowDivision.cpp
CallPromotionUtils.cpp
CallGraphUpdater.cpp
CanonicalizeAliases.cpp
CanonicalizeFreezeInLoops.cpp
CloneFunction.cpp
CloneModule.cpp
CodeExtractor.cpp
CodeLayout.cpp
CodeMoverUtils.cpp
ControlFlowUtils.cpp
CtorUtils.cpp
CountVisits.cpp
Debugify.cpp
DemoteRegToStack.cpp
DXILUpgrade.cpp
EntryExitInstrumenter.cpp
EscapeEnumerator.cpp
Evaluator.cpp
FixIrreducible.cpp
FlattenCFG.cpp
FunctionComparator.cpp
FunctionImportUtils.cpp
GlobalStatus.cpp
GuardUtils.cpp
HelloWorld.cpp
InlineFunction.cpp
InjectTLIMappings.cpp
InstructionNamer.cpp
Instrumentation.cpp
IntegerDivision.cpp
IRNormalizer.cpp
LCSSA.cpp
LibCallsShrinkWrap.cpp
Local.cpp
LoopConstrainer.cpp
LoopPeel.cpp
LoopRotationUtils.cpp
LoopSimplify.cpp
LoopUnroll.cpp
LoopUnrollAndJam.cpp
LoopUnrollRuntime.cpp
LoopUtils.cpp
LoopVersioning.cpp
LowerAtomic.cpp
LowerGlobalDtors.cpp
LowerIFunc.cpp
LowerInvoke.cpp
LowerMemIntrinsics.cpp
LowerSwitch.cpp
MatrixUtils.cpp
MemoryOpRemark.cpp
MemoryTaggingSupport.cpp
Mem2Reg.cpp
MetaRenamer.cpp
MisExpect.cpp
ModuleUtils.cpp
MoveAutoInit.cpp
NameAnonGlobals.cpp
PredicateInfo.cpp
PromoteMemoryToRegister.cpp
RelLookupTableConverter.cpp
ScalarEvolutionExpander.cpp
SCCPSolver.cpp
StripGCRelocates.cpp
SSAUpdater.cpp
SSAUpdaterBulk.cpp
SampleProfileInference.cpp
SampleProfileLoaderBaseUtil.cpp
SanitizerStats.cpp
SimplifyCFG.cpp
SimplifyIndVar.cpp
SimplifyLibCalls.cpp
SizeOpts.cpp
SplitModule.cpp
StripNonLineTableDebugInfo.cpp
SymbolRewriter.cpp
UnifyFunctionExitNodes.cpp
UnifyLoopExits.cpp
Utils.cpp
ValueMapper.cpp
VNCoercion.cpp
ADDITIONAL_HEADER_DIRS
${LLVM_MAIN_INCLUDE_DIR}/llvm/Transforms
${LLVM_MAIN_INCLUDE_DIR}/llvm/Transforms/Utils
DEPENDS
intrinsics_gen
LINK_COMPONENTS
Analysis
Core
Support
TargetParser
)