aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/Utils.cpp
AgeCommit message (Collapse)AuthorFilesLines
2024-11-04[Utils] Remove unused includes (NFC) (#114748)Kazu Hirata1-1/+0
Identified with misc-include-cleaner.
2023-11-26[NewPM] Remove StripGCRelocatesLegacyPass (#73403)Aiden Grossman1-1/+0
This pass isn't used anywhere upstream and thus has no test coverage. For these reasons, remove it.
2023-11-25[NewPM] Remove PredicateInfoPrinterLegacyPass (#73407)Aiden Grossman1-1/+0
This pass isn't used anywhere upstream and thus has no test coverage. For these reasons, remove it.
2023-11-20[NewPM] Remove AssumeBundleBuilderPassLegacyPass (#72817)Aiden Grossman1-1/+0
This pass isn't used upstream anywhere and doesn't have have a create...() function, thus isn't tested anywhere. Because of this, remove it.
2023-11-20[NewPM] Remove UnifyFunctionExitNodesLegacyPass (#72816)Aiden Grossman1-1/+0
UnifyFunctionExitNodesLegacyPass isn't used anywhere in upstream and thus isn't tested at all. For these reasons, remove it.
2023-06-10[Transforms] Remove AddDiscriminatorsLegacyPassKazu Hirata1-1/+0
The last use was removed by: commit ae0987d242e266847f21f5fa1bffa97ce3eff586 Author: Kazu Hirata <kazu@google.com> Date: Sat Jun 10 13:51:35 2023 -0700 Differential Revision: https://reviews.llvm.org/D152636
2023-04-28Re-apply "[Passes] Remove legacy PM versions of InstructionNamer and ↵Bjorn Pettersson1-2/+0
MetaRenamer" A new attempt after removing uses of -instnamer in polly lit tests in D148530.
2023-04-25[LegacyPM] Remove InjectTLIMappings and AssumeSimplify passesArthur Eubanks1-2/+0
2023-04-17Revert "[Passes] Remove legacy PM versions of InstructionNamer and MetaRenamer"Bjorn Pettersson1-0/+2
This reverts commit 981ec1faeb508a364cc47c8246b72fc89dd8c1d8. It broke polly build bots. Polly still uses -instnamer with legacy PM.
2023-04-17[Passes] Remove legacy PM versions of InstructionNamer and MetaRenamerBjorn Pettersson1-2/+0
2023-04-14[llvm-c] Remove PassRegistry and initialization APIsNikita Popov1-6/+0
Remove C APIs for interacting with PassRegistry and pass initialization. These are legacy PM concepts, and are no longer relevant for the new pass manager. Calls to these initialization functions can simply be dropped. Differential Revision: https://reviews.llvm.org/D145043
2023-04-13[Transforms][LTO] Remove some redundant includes. NFCBjorn Pettersson1-1/+0
No need to include CallGraphSCCPass.h from the IPO/Inliner. Also removed the include of LegacyPassManager.h in a couple of files that do not really depend on that header file. Differential Revision: https://reviews.llvm.org/D148083
2023-03-10[Passes] Remove some legacy passesArthur Eubanks1-1/+0
DFAJumpThreading JumpThreading LibCallsShrink LoopVectorize SLPVectorizer DeadStoreElimination AggressiveDCE CorrelatedValuePropagation IndVarSimplify These are part of the optimization pipeline, of which the legacy version is deprecated and being removed.
2023-03-02[llvm-c] Remove bindings for creating legacy passesNikita Popov1-13/+0
Legacy passes are only supported for codegen, and I don't believe it's possible to write backends using the C API, so we should drop all of those. Reduces the number of places that need to be modified when removing legacy passes. Differential Revision: https://reviews.llvm.org/D144970
2023-02-07Reland [LegacyPM] Remove some legacy passesArthur Eubanks1-1/+0
These are part of the optimization pipeline, of which the legacy pass manager version is deprecated. Namely * Internalize * StripSymbols * StripNonDebugSymbols * StripDeadDebugInfo * StripDeadPrototypes * VectorCombine * WarnMissedTransformations Fixed previously failing ocaml tests (one of them seems to already be failing?)
2023-02-07Revert "[LegacyPM] Remove some legacy passes"Arthur Eubanks1-0/+1
This reverts commit a4b4f62beb0bf40123181e5f5bdf32ef54f87166. Ocaml bindings tests failing.
2023-02-07[LegacyPM] Remove some legacy passesArthur Eubanks1-1/+0
These are part of the optimization pipeline, of which the legacy pass manager version is deprecated. Namely * Internalize * StripSymbols * StripNonDebugSymbols * StripDeadDebugInfo * StripDeadPrototypes * VectorCombine * WarnMissedTransformations
2022-07-17[LegacyPM] Remove NameAnonGlobalLegacyPassFangrui Song1-1/+0
Unused after LTO removal from optimization passline.
2022-07-17[LegacyPM] Remove CanonicalizeAliasesLegacyPassFangrui Song1-1/+0
Unused after LTO removal from optimization passline.
2022-03-23Reland "Lower `@llvm.global_dtors` using `__cxa_atexit` on MachO"Julian Lettner1-0/+1
For MachO, lower `@llvm.global_dtors` into `@llvm_global_ctors` with `__cxa_atexit` calls to avoid emitting the deprecated `__mod_term_func`. Reuse the existing `WebAssemblyLowerGlobalDtors.cpp` to accomplish this. Enable fallback to the old behavior via Clang driver flag (`-fregister-global-dtors-with-atexit`) or llc / code generation flag (`-lower-global-dtors-via-cxa-atexit`). This escape hatch will be removed in the future. Differential Revision: https://reviews.llvm.org/D121736
2022-03-23Revert "Lower `@llvm.global_dtors` using `__cxa_atexit` on MachO"Zequan Wu1-1/+0
This reverts commit 22570bac694396514fff18dec926558951643fa6.
2022-03-17Lower `@llvm.global_dtors` using `__cxa_atexit` on MachOJulian Lettner1-0/+1
For MachO, lower `@llvm.global_dtors` into `@llvm_global_ctors` with `__cxa_atexit` calls to avoid emitting the deprecated `__mod_term_func`. Reuse the existing `WebAssemblyLowerGlobalDtors.cpp` to accomplish this. Enable fallback to the old behavior via Clang driver flag (`-fregister-global-dtors-with-atexit`) or llc / code generation flag (`-lower-global-dtors-via-cxa-atexit`). This escape hatch will be removed in the future. Differential Revision: https://reviews.llvm.org/D121736
2022-02-02Cleanup header dependencies in LLVMCoreserge-sans-paille1-0/+1
Based on the output of include-what-you-use. This is a big chunk of changes. It is very likely to break downstream code unless they took a lot of care in avoiding hidden ehader dependencies, something the LLVM codebase doesn't do that well :-/ I've tried to summarize the biggest change below: - llvm/include/llvm-c/Core.h: no longer includes llvm-c/ErrorHandling.h - llvm/IR/DIBuilder.h no longer includes llvm/IR/DebugInfo.h - llvm/IR/IRBuilder.h no longer includes llvm/IR/IntrinsicInst.h - llvm/IR/LLVMRemarkStreamer.h no longer includes llvm/Support/ToolOutputFile.h - llvm/IR/LegacyPassManager.h no longer include llvm/Pass.h - llvm/IR/Type.h no longer includes llvm/ADT/SmallPtrSet.h - llvm/IR/PassManager.h no longer includes llvm/Pass.h nor llvm/Support/Debug.h And the usual count of preprocessed lines: $ clang++ -E -Iinclude -I../llvm/include ../llvm/lib/IR/*.cpp -std=c++14 -fno-rtti -fno-exceptions | wc -l before: 6400831 after: 6189948 200k lines less to process is no that bad ;-) Discourse thread on the topic: https://llvm.discourse.group/t/include-what-you-use-include-cleanup Differential Revision: https://reviews.llvm.org/D118652
2021-03-30Revert "[Passes] Add relative lookup table converter pass"Krasimir Georgiev1-1/+0
This reverts commit 5178ffc7cf92527557ae16e86d0fa90d538c2a19. Compiling `llvm-profdata` with a compiler build from this produces a crashing binary.
2021-03-29[Passes] Add relative lookup table converter passGulfem Savrun Yeniceri1-0/+1
Lookup tables generate non PIC-friendly code, which requires dynamic relocation as described in: https://bugs.llvm.org/show_bug.cgi?id=45244 This patch adds a new pass that converts lookup tables to relative lookup tables to make them PIC-friendly. Differential Revision: https://reviews.llvm.org/D94355
2021-03-24Revert "[Passes] Add relative lookup table converter pass"Gulfem Savrun Yeniceri1-1/+0
This reverts commit 5fd001a5ffbad403053c4a06bf4b2b76dc52bba8 because it broke clang-with-thin-lto-ubuntu bot.
2021-03-24[Passes] Add relative lookup table converter passGulfem Savrun Yeniceri1-0/+1
Lookup tables generate non PIC-friendly code, which requires dynamic relocation as described in: https://bugs.llvm.org/show_bug.cgi?id=45244 This patch adds a new pass that converts lookup tables to relative lookup tables to make them PIC-friendly. Differential Revision: https://reviews.llvm.org/D94355
2021-03-23Revert "[Passes] Add relative lookup table converter pass"Gulfem Savrun Yeniceri1-1/+0
This reverts commit 78a65cd945d006ff02f9d24d9cc20a302ed93b08 which caused buildbot failures.
2021-03-22[Passes] Add relative lookup table converter passGulfem Savrun Yeniceri1-0/+1
Lookup tables generate non PIC-friendly code, which requires dynamic relocation as described in: https://bugs.llvm.org/show_bug.cgi?id=45244 This patch adds a new pass that converts lookup tables to relative lookup tables to make them PIC-friendly. Differential Revision: https://reviews.llvm.org/D94355
2021-03-10Remove original implementation of UniqueInternalLinkageNames pass.Sriraman Tallam1-1/+0
D96109 was recently submitted which contains the refactored implementation of -funique-internal-linakge-names by adding the unique suffixes in clang rather than as an LLVM pass. Deleting the former implementation in this change. Differential Revision: https://reviews.llvm.org/D98234
2020-10-20[NPM] port -unify-loop-exits to NPMTa-Wei Tu1-1/+1
Reviewed By: aeubanks Differential Revision: https://reviews.llvm.org/D89774
2020-10-20[NPM] Port -mergereturn to NPMTa-Wei Tu1-1/+1
Reviewed By: aeubanks Differential Revision: https://reviews.llvm.org/D89781
2020-10-07Port StripGCRelocates pass to NPMReid Kleckner1-1/+1
Fixes one test under NPM Differential Revision: https://reviews.llvm.org/D88766
2020-10-07[NPM] Port strip nonlinetable debuginfo pass to the new pass managerReid Kleckner1-1/+1
Fixes a few tests in llvm/test/Transforms/Utils. Differential Revision: https://reviews.llvm.org/D88762
2020-09-15[LowerSwitch][NewPM] Port lowerswitch to NPMArthur Eubanks1-1/+1
Reviewed By: ychen Differential Revision: https://reviews.llvm.org/D87726
2020-07-04[Utils] Make -assume-builder/-assume-simplify actually work on Old-PMRoman Lebedev1-0/+1
clang w/ old-pm currently would simply crash when -mllvm -enable-knowledge-retention=true is specified. Clearly, these two passes had no Old-PM test coverage, which would have shown the problem - not requiring AssumptionCacheTracker, but then trying to always get it. Also, why try to get domtree only if it's cached, but at the same time marking it as required?
2020-05-23Revert "Added a new IRCanonicalizer pass."Michal Paszkowski1-1/+0
This reverts commit 14d358537f124a732adad1ec6edf3981dc9baece.
2020-05-23Added a new IRCanonicalizer pass.Michal Paszkowski1-0/+1
Summary: Added a new IRCanonicalizer pass which aims to transform LLVM modules into a canonical form by reordering and renaming instructions while preserving the same semantics. The canonicalizer makes it easier to spot semantic differences when diffing two modules which have undergone different passes. Presentation: https://www.youtube.com/watch?v=c9WMijSOEUg Reviewed by: plotfi Differential Revision: https://reviews.llvm.org/D66029
2020-05-21Add CanonicalizeFreezeInLoops passJuneyoung Lee1-0/+1
Summary: If an induction variable is frozen and used, SCEV yields imprecise result because it doesn't say anything about frozen variables. Due to this reason, performance degradation happened after https://reviews.llvm.org/D76483 is merged, causing SCEV yield imprecise result and preventing LSR to optimize a loop. The suggested solution here is to add a pass which canonicalizes frozen variables inside a loop. To be specific, it pushes freezes out of the loop by freezing the initial value and step values instead & dropping nsw/nuw flags from instructions used by freeze. This solution was also mentioned at https://reviews.llvm.org/D70623 . Reviewers: spatel, efriedma, lebedev.ri, fhahn, jdoerfert Reviewed By: fhahn Subscribers: nikic, mgorny, hiraditya, javed.absar, llvm-commits, sanwou01, nlopes Tags: #llvm Differential Revision: https://reviews.llvm.org/D77523
2020-05-11[NFC][DwarfDebug] Add test for variables with a single location whichOCHyams1-0/+1
don't span their entire scope. The previous commit (6d1c40c171e) is an older version of the test. Reviewed By: aprantl, vsk Differential Revision: https://reviews.llvm.org/D79573
2020-04-20New pass to make internal linkage symbol names unique.Sriraman Tallam1-0/+1
With clang option -funique-internal-linkage-symbols, symbols with internal linkage get names with the module hash appended. Differential Revision: https://reviews.llvm.org/D78243
2020-04-15Introduce fix-irreducible passSameer Sahasrabuddhe1-0/+1
An irreducible SCC is one which has multiple "header" blocks, i.e., blocks with control-flow edges incident from outside the SCC. This pass converts an irreducible SCC into a natural loop by introducing a single new header block and redirecting all the edges on the original headers to this new block. This is a useful workaround for a limitation in the structurizer which, which produces incorrect control flow in the presence of irreducible regions. The AMDGPU backend provides an option to enable this pass before the structurizer, which may eventually be enabled by default. Reviewed By: nhaehnle Differential Revision: https://reviews.llvm.org/D77198 This restores commit 2ada8e2525dd2653f30c8696a27162a3b1647d66. Originally reverted with commit 44e09b59b869a91bf47d76e8bc569d9ee91ad145.
2020-04-15Revert "Introduce fix-irreducible pass"Sameer Sahasrabuddhe1-1/+0
This reverts commit 2ada8e2525dd2653f30c8696a27162a3b1647d66. Buildbots produced compilation errors which I was not able to quickly reproduce locally. Need more time to investigate.
2020-04-15Introduce fix-irreducible passSameer Sahasrabuddhe1-0/+1
An irreducible SCC is one which has multiple "header" blocks, i.e., blocks with control-flow edges incident from outside the SCC. This pass converts an irreducible SCC into a natural loop by introducing a single new header block and redirecting all the edges on the original headers to this new block. This is a useful workaround for a limitation in the structurizer which, which produces incorrect control flow in the presence of irreducible regions. The AMDGPU backend provides an option to enable this pass before the structurizer, which may eventually be enabled by default. Reviewed By: nhaehnle Differential Revision: https://reviews.llvm.org/D77198
2020-03-30Introduce unify-loop-exits pass.Sameer Sahasrabuddhe1-0/+1
For each natural loop with multiple exit blocks, this pass creates a new block N such that all exiting blocks now branch to N, and then control flow is redistributed to all the original exit blocks. The bulk of the tranformation is a new function introduced in BasicBlockUtils that an redirect control flow from a set of incoming blocks to a set of outgoing blocks via a common "hub". This is a useful workaround for a limitation in the structurizer which incorrectly orders blocks when processing a nest of loops. This pass bypasses that issue by ensuring that each natural loop is recognized as a separate region. Since the structurizer is a region pass, it no longer sees a nest of loops in a single region, and instead processes each "level" in the nesting as a separate region. The AMDGPU backend provides a new option to enable this pass before the structurizer, which may eventually be enabled by default. Reviewers: madhur13490, arsenm, nhaehnle Reviewed By: nhaehnle Differential Revision: https://reviews.llvm.org/D75865
2019-11-15[SVFS] Inject TLI Mappings in VFABI attribute.Francesco Petrogalli1-0/+1
This patch introduces a function pass to inject the scalar-to-vector mappings stored in the TargetLIbraryInfo (TLI) into the Vector Function ABI (VFABI) variants attribute. The test is testing the injection for three vector libraries supported by the TLI (Accelerate, SVML, MASSV). The pass does not change any of the analysis associated to the function. Differential Revision: https://reviews.llvm.org/D70107
2019-03-15[LLVM-C] Expose the "Add Discriminators" Pass To LLVM-CRobert Widmann1-0/+3
Summary: Add bindings to create a wrapped "Add Discriminators" pass. Now that we have debug info support, this is a handy transform to have. Reviewers: whitequark, deadalnix Reviewed By: whitequark Subscribers: dblaikie, aprantl, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D58624 llvm-svn: 356272
2019-01-19Update the file headers across all of the LLVM projects in the monorepoChandler Carruth1-4/+3
to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
2019-01-04[ThinLTO] Handle chains of aliasesTeresa Johnson1-0/+1
At -O0, globalopt is not run during the compile step, and we can have a chain of an alias having an immediate aliasee of another alias. The summaries are constructed assuming aliases in a canonical form (flattened chains), and as a result only the base object but no intermediate aliases were preserved. Fix by adding a pass that canonicalize aliases, which ensures each alias is a direct alias of the base object. Reviewers: pcc, davidxl Subscribers: mehdi_amini, inglorion, eraman, steven_wu, dexonsmith, arphaman, llvm-commits Differential Revision: https://reviews.llvm.org/D54507 llvm-svn: 350423
2018-06-29[instsimplify] Move the instsimplify pass to use more obvious file namesChandler Carruth1-1/+0
and diretory. Also cleans up all the associated naming to be consistent and removes the public access to the pass ID which was unused in LLVM. Also runs clang-format over parts that changed, which generally cleans up a bunch of formatting. This is in preparation for doing some internal cleanups to the pass. Differential Revision: https://reviews.llvm.org/D47352 llvm-svn: 336028