summaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/IPO/ExtractGV.cpp
AgeCommit message (Collapse)Author
2025-03-27[Transforms] Use range constructors of *Set (NFC) (#133203)Kazu Hirata
2024-11-03[IPO] Remove unused includes (NFC) (#114716)Kazu Hirata
Identified with misc-include-cleaner.
2023-06-06llvm-extract: Replace IFuncs with declarationsChristian Ulmann
This commit ensures that llvm-extract does not copy all IFuncs into the resulting modules. Before this change, ifuncs were not modified which could cause the emission unexpected IR files. Reviewed By: darthscsi Differential Revision: https://reviews.llvm.org/D152148
2022-12-20[llvm-extract] Use new pass manager instead of legacy pass managerArthur Eubanks
Removes some legacy passes specific to llvm-extract
2022-03-22Cleanup includes: Transforms/IPOserge-sans-paille
Preprocessor output diff: -238205 lines Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-cleanup Differential Revision: https://reviews.llvm.org/D122183
2021-11-07[Transforms] Use make_early_inc_range (NFC)Kazu Hirata
2021-02-08[Transforms] Use range-based for loops (NFC)Kazu Hirata
2020-02-03[llvm-extract] Add -keep-const-init commandline optionJuneyoung Lee
Summary: This adds -keep-const-init option to llvm-extract which preserves initializers of used global constants. For example: ``` $ cat a.ll @g = constant i32 0 define i32 @f() { %v = load i32, i32* @g ret i32 %v } $ llvm-extract --func=f a.ll -S -o - @g = external constant i32 define i32 @f() { .. } $ llvm-extract --func=f a.ll -keep-const-init -S -o - @g = constant i32 0 define i32 @f() { .. } ``` This option is useful in checking whether a function that uses a constant global is optimized correctly. Reviewers: jsji, MaskRay, david2050 Reviewed By: MaskRay Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D73833
2019-01-19Update the file headers across all of the LLVM projects in the monorepoChandler Carruth
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
2018-12-18[IPO][AVR] Create new Functions in the default address space specified in ↵Dylan McKay
the data layout This modifies the IPO pass so that it respects any explicit function address space specified in the data layout. In targets with nonzero program address spaces, all functions should, by default, be placed into the default program address space. This is required for Harvard architectures like AVR. Without this, the functions will be marked as residing in data space, and thus not be callable. This has no effect to any in-tree official backends, as none use an explicit program address space in their data layouts. Patch by Tim Neumann. llvm-svn: 349469
2018-05-01Remove @brief commands from doxygen comments, too.Adrian Prantl
This is a follow-up to r331272. We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\@brief'); do perl -pi -e 's/\@brief //g' $i & done https://reviews.llvm.org/D46290 llvm-svn: 331275
2017-12-13Remove redundant includes from lib/Transforms.Michael Zolotukhin
llvm-svn: 320628
2017-06-08[ExtractGV] Fix the doxygen comment on the constructor and the class to ↵Craig Topper
refer to global values instead of functions. While there fix an 80 column violation. NFC llvm-svn: 305030
2017-06-06Sort the remaining #include lines in include/... and lib/....Chandler Carruth
I did this a long time ago with a janky python script, but now clang-format has built-in support for this. I fed clang-format every line with a #include and let it re-sort things according to the precise LLVM rules for include ordering baked into clang-format these days. I've reverted a number of files where the results of sorting includes isn't healthy. Either places where we have legacy code relying on particular include ordering (where possible, I'll fix these separately) or where we have particular formatting around #include lines that I didn't want to disturb in this patch. This patch is *entirely* mechanical. If you get merge conflicts or anything, just ignore the changes in this patch and run clang-format over your #include lines in the files. Sorry for any noise here, but it is important to keep these things stable. I was seeing an increasing number of patches with irrelevant re-ordering of #include lines because clang-format was used. This patch at least isolates that churn, makes it easy to skip when resolving conflicts, and gets us to a clean baseline (again). llvm-svn: 304787
2016-06-26Apply clang-tidy's modernize-loop-convert to most of lib/Transforms.Benjamin Kramer
Only minor manual fixes. No functionality change intended. llvm-svn: 273808
2016-04-22Re-commit optimization bisect support (r267022) without new pass manager ↵Andrew Kaylor
support. The original commit was reverted because of a buildbot problem with LazyCallGraph::SCC handling (not related to the OptBisect handling). Differential Revision: http://reviews.llvm.org/D19172 llvm-svn: 267231
2016-04-22Revert "Initial implementation of optimization bisect support."Vedant Kumar
This reverts commit r267022, due to an ASan failure: http://lab.llvm.org:8080/green/job/clang-stage2-cmake-RgSan_check/1549 llvm-svn: 267115
2016-04-21Initial implementation of optimization bisect support.Andrew Kaylor
This patch implements a optimization bisect feature, which will allow optimizations to be selectively disabled at compile time in order to track down test failures that are caused by incorrect optimizations. The bisection is enabled using a new command line option (-opt-bisect-limit). Individual passes that may be skipped call the OptBisect object (via an LLVMContext) to see if they should be skipped based on the bisect limit. A finer level of control (disabling individual transformations) can be managed through an addition OptBisect method, but this is not yet used. The skip checking in this implementation is based on (and replaces) the skipOptnoneFunction check. Where that check was being called, a new call has been inserted in its place which checks the bisect limit and the optnone attribute. A new function call has been added for module and SCC passes that behaves in a similar way. Differential Revision: http://reviews.llvm.org/D19172 llvm-svn: 267022
2016-01-16GlobalValue: use getValueType() instead of getType()->getPointerElementType().Manuel Jacob
Reviewers: mjacob Subscribers: jholewinski, arsenm, dsanders, dblaikie Patch by Eduard Burtescu. Differential Revision: http://reviews.llvm.org/D16260 llvm-svn: 257999
2015-10-13IPO: Remove implicit ilist iterator conversions, NFCDuncan P. N. Exon Smith
llvm-svn: 250187
2015-07-06[llvm-extract] Drop comdats from declarationsReid Kleckner
The verifier rejects comdats on declarations. llvm-svn: 241483
2015-06-23Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC)Alexander Kornienko
Apparently, the style needs to be agreed upon first. llvm-svn: 240390
2015-06-19Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko
The patch is generated using this command: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ llvm/lib/ Thanks to Eugene Kosov for the original patch! llvm-svn: 240137
2014-10-28Reformat partially, where I touched for whitespace changes.NAKAMURA Takumi
llvm-svn: 220773
2014-10-28Untabify and whitespace cleanups.NAKAMURA Takumi
llvm-svn: 220771
2014-05-07GlobalValue: Assert symbols with local linkage have default visibilityDuncan P. N. Exon Smith
The change to ExtractGV.cpp has no functionality change except to avoid the asserts. Existing testcases already cover this, so I didn't add a new one. llvm-svn: 208264
2014-04-25[C++] Use 'nullptr'. Transforms edition.Craig Topper
llvm-svn: 207196
2014-03-05[C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper
class. llvm-svn: 202953
2013-11-22Add a fixed version of r195470 back.Rafael Espindola
The fix is simply to use CurI instead of I when handling aliases to avoid accessing a invalid iterator. original message: Convert linkonce* to weak* instead of strong. Also refactor the logic into a helper function. This is an important improve on mingw where the linker complains about mixed weak and strong symbols. Converting to weak ensures that the symbol is not dropped, but keeps in a comdat, making the linker happy. llvm-svn: 195477
2013-11-22Revert "Convert linkonce* to weak* instead of strong."Rafael Espindola
This reverts commit r195470. Debugging failure in some bots. llvm-svn: 195472
2013-11-22Convert linkonce* to weak* instead of strong.Rafael Espindola
Also refactor the logic into a helper function. This is an important improvement on mingw where the linker complains about mixed weak and strong symbols. Converting to weak ensures that the symbol is not dropped, but keeps in a comdat, making the linker happy. llvm-svn: 195470
2013-03-04Check isDiscardableIfUnused, rather than hasLocalLinkage, when bumpingLang Hames
GlobalValue linkage up to ExternalLinkage in the ExtractGV pass. This prevents linkonce and linkonce_odr symbols from being DCE'd. llvm-svn: 176459
2013-01-02Move all of the header files which are involved in modelling the LLVM IRChandler Carruth
into their new header subdirectory: include/llvm/IR. This matches the directory structure of lib, and begins to correct a long standing point of file layout clutter in LLVM. There are still more header files to move here, but I wanted to handle them in separate commits to make tracking what files make sense at each layer easier. The only really questionable files here are the target intrinsic tablegen files. But that's a battle I'd rather not fight today. I've updated both CMake and Makefile build systems (I think, and my tests think, but I may have missed something). I've also re-sorted the includes throughout the project. I'll be committing updates to Clang, DragonEgg, and Polly momentarily. llvm-svn: 171366
2012-12-03Use the new script to sort the includes of every file under lib.Chandler Carruth
Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
2012-10-29llvm-extract changes linkages so that functions on both sides of theRafael Espindola
split module can see each other. If it is keeping a symbol that already has a non local linkage, it doesn't need to change it. llvm-svn: 166908
2012-10-29llvm-extract was unable to handle aliases. It would leave a copy on theRafael Espindola
output of both llvm-extract foo.ll -func=bar and llvm-extract foo.ll -func=bar -delete so the two new files could not be linked together anymore. With this change alias are handled almost like functions and global variables. Almost because with alias we cannot just clear the initializer/body, we have to create a new declaration and replace the alias with it. The net result is that now the output of the above commands can be linked even if foo.ll has aliases. llvm-svn: 166907
2012-07-19Remove tabs.Bill Wendling
llvm-svn: 160477
2011-06-09Improve the handling of available_externally and llvm.global_ctors.Rafael Espindola
llvm-svn: 132775
2010-09-23Fix llvm-extract so that it changes the linkage of all GlobalValues toBob Wilson
"external" even when doing lazy bitcode loading. This was broken because a function that is not materialized fails the !isDeclaration() test. llvm-svn: 114666
2010-09-05Fix warning reported by MSVC++ builder.Nick Lewycky
llvm-svn: 113106
2010-08-26Rewrite ExtractGV, removing a bunch of stuff that didn't fully work,Dan Gohman
and was over-complicated, and replacing it with a simple implementation. llvm-svn: 112120
2010-08-06Reapply r110396, with fixes to appease the Linux buildbot gods.Owen Anderson
llvm-svn: 110460
2010-08-06Revert r110396 to fix buildbots.Owen Anderson
llvm-svn: 110410
2010-08-05Don't use PassInfo* as a type identifier for passes. Instead, use the ↵Owen Anderson
address of the static ID member as the sole unique type identifier. Clean up APIs related to this change. llvm-svn: 110396
2009-10-25Remove includes of Support/Compiler.h that are no longer needed after theNick Lewycky
VISIBILITY_HIDDEN removal. llvm-svn: 85043
2009-10-25Remove VISIBILITY_HIDDEN from class/struct found inside anonymous namespaces.Nick Lewycky
Chris claims we should never have visibility_hidden inside any .cpp file but that's still not true even after this commit. llvm-svn: 85042
2009-10-06Introduce and use convenience methods for getting pointer typesDuncan Sands
where the element is of a basic builtin type. For example, to get an i8* use getInt8PtrTy. llvm-svn: 83379
2009-08-13Push LLVMContexts through the IntegerType APIs.Owen Anderson
llvm-svn: 78948
2009-07-29Eliminate a few unused-variable warningsDouglas Gregor
llvm-svn: 77519
2009-07-29Move types back to the 2.5 API.Owen Anderson
llvm-svn: 77516