aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/CMakeLists.txt
AgeCommit message (Collapse)AuthorFilesLines
2023-11-08Reapply 7d77bbef4ad92, adding new debug-info classesJeremy Morse1-0/+1
This reverts commit 957efa4ce4f0391147cec62746e997226ee2b836. Original commit message below -- in this follow up, I've shifted un-necessary inclusions of DebugProgramInstruction.h into being forward declarations (fixes clang-compile time I hope), and a memory leak in the DebugInfoTest.cpp IR unittests. I also tracked a compile-time regression in D154080, more explanation there, but the result of which is hiding some of the changes behind the EXPERIMENTAL_DEBUGINFO_ITERATORS compile-time flag. This is tested by the "new-debug-iterators" buildbot. [DebugInfo][RemoveDIs] Add prototype storage classes for "new" debug-info This patch adds a variety of classes needed to record variable location debug-info without using the existing intrinsic approach, see the rationale at [0]. The two added files and corresponding unit tests are the majority of the plumbing required for this, but at this point isn't accessible from the rest of LLVM as we need to stage it into the repo gently. An overview is that classes are added for recording variable information attached to Real (TM) instructions, in the form of DPValues and DPMarker objects. The metadata-uses of DPValues is plumbed into the metadata hierachy, and a field added to class Instruction, which are all stimulated in the unit tests. The next few patches in this series add utilities to convert to/from this new debug-info format and add instruction/block utilities to have debug-info automatically updated in the background when various operations occur. This patch was reviewed in Phab in D153990 and D154080, I've squashed them together into this commit as there are dependencies between the two patches, and there's little profit in landing them separately. [0] https://discourse.llvm.org/t/rfc-instruction-api-changes-needed-to-eliminate-debug-intrinsics-from-ir/68939
2023-11-02Revert "[DebugInfo][RemoveDIs] Add prototype storage classes for "new" ↵Jeremy Morse1-1/+0
debug-info" And some intervening fixups. There are two remaining problems: * A memory leak via https://lab.llvm.org/buildbot/#/builders/236/builds/7120/steps/10/logs/stdio * A performance slowdown with -g where I'm not completely sure what the cause it These might be fairly straightforwards to fix, but it's the end of the day hear, so I figure I'll clear the buildbots til tomorrow. This reverts commit 7d77bbef4ad9230f6f427649373fe46a668aa909. This reverts commit 9026f35afe6ffdc5e55b6615efcbd36f25b11558. This reverts commit d97b2b389a0e511c65af6845119eb08b8a2cb473.
2023-11-02[DebugInfo][RemoveDIs] Add prototype storage classes for "new" debug-infoJeremy Morse1-0/+1
This patch adds a variety of classes needed to record variable location debug-info without using the existing intrinsic approach, see the rationale at [0]. The two added files and corresponding unit tests are the majority of the plumbing required for this, but at this point isn't accessible from the rest of LLVM as we need to stage it into the repo gently. An overview is that classes are added for recording variable information attached to Real (TM) instructions, in the form of DPValues and DPMarker objects. The metadata-uses of DPValues is plumbed into the metadata hierachy, and a field added to class Instruction, which are all stimulated in the unit tests. The next few patches in this series add utilities to convert to/from this new debug-info format and add instruction/block utilities to have debug-info automatically updated in the background when various operations occur. This patch was reviewed in Phab in D153990 and D154080, I've squashed them together into this commit as there are dependencies between the two patches, and there's little profit in landing them separately. [0] https://discourse.llvm.org/t/rfc-instruction-api-changes-needed-to-eliminate-debug-intrinsics-from-ir/68939
2023-08-03Restore "[LLVM] move verification of convergence control to a class template""Sameer Sahasrabuddhe1-0/+1
The refactored template can now be used with MachineVerifier. Resubmitted after fixing build errors: - Shared libraries build failed with undefined references due to "extern template" declarations. - Modules build failed due to a cycle dependence between llvm/ADT and llvm/IR. The Generic*Impl.h files should be in llvm/IR to prevent this. Differential Revision: https://reviews.llvm.org/D156522 This restores commit 93a3706711fd46d4d487640d91b16c2eec747c9e. Originally reverted in 466bd9981150906552a1f2308e3c9065bfcb6741.
2023-08-01Revert "[LLVM] move verification of convergence control to a class template"Sameer Sahasrabuddhe1-1/+0
This reverts commit 93a3706711fd46d4d487640d91b16c2eec747c9e. The "extern template" declaration of CycleInfo caused problems in a shared build when CycleInfo was removed from Verifier.cpp. There needs to be an explicit instantiation corresponding to an extern template in every SO.
2023-08-01[LLVM] move verification of convergence control to a class templateSameer Sahasrabuddhe1-0/+1
The refactored template can now be used with MachineVerifier. Reviewed By: arsenm Differential Revision: https://reviews.llvm.org/D156522
2023-07-12[RFC] Introduce convergence control intrinsicsSameer Sahasrabuddhe1-0/+1
This is a reboot of the original design and implementation by Nicolai Haehnle <nicolai.haehnle@amd.com>: https://reviews.llvm.org/D85603 This change also obsoletes an earlier attempt at restarting the work on convergence tokens: https://reviews.llvm.org/D104504 Changes relative to D85603: 1. Clean up the definition of a "convergent operation", a convergent call and convergent function. 2. Clean up the relationship between dynamic instances, sets of threads and convergence tokens. 3. Redistribute the formal rules into the definitions of the convergence intrinsics. 4. Expand on the semantics of entering a function from outside LLVM, and the environment-defined outcome of the entry intrinsic. 5. Replace the term "cycle" with "closed path". The static rules are defined in terms of closed paths, and then a relation is established with cycles. 6. Specify that if a function contains a controlled convergent operation, then all convergent operations in that function must be controlled. 7. Describe an optional procedure to infer tokens for uncontrolled convergent operations. 8. Introduce controlled maximal convergence-before and controlled m-converged property as an update to the original properties in UniformityAnalysis. 9. Additional constraint that a cycle heart can only occur in the header of a reducible cycle (natural loop). Reviewed By: nhaehnle Differential Revision: https://reviews.llvm.org/D147116
2023-01-30Reland [LTO] Demangle the function name in DiagnosticInfoDontCall messageKyuwon Cho1-0/+1
Previously, dontcall attribute message on LTO prints the mangled function name. Fixes https://github.com/llvm/llvm-project/issues/58933 Relanded with proper IR -> Demangle dependency. Reviewed By: aeubanks Differential Revision: https://reviews.llvm.org/D142844
2023-01-27Lift EHPersonalities from Analysis to IR (NFC)Stefan Gränitz1-0/+1
Computing EH-related information was only relevant for analysis passes so far. Lifting it to IR will allow the IR Verifier to calculate EH funclet coloring and validate funclet operand bundles in a follow-up step. Reviewed By: rnk, compnerd Differential Revision: https://reviews.llvm.org/D138122
2022-12-20[Support] Move TargetParsers to new componentArchibald Elliott1-0/+1
This is a fairly large changeset, but it can be broken into a few pieces: - `llvm/Support/*TargetParser*` are all moved from the LLVM Support component into a new LLVM Component called "TargetParser". This potentially enables using tablegen to maintain this information, as is shown in https://reviews.llvm.org/D137517. This cannot currently be done, as llvm-tblgen relies on LLVM's Support component. - This also moves two files from Support which use and depend on information in the TargetParser: - `llvm/Support/Host.{h,cpp}` which contains functions for inspecting the current Host machine for info about it, primarily to support getting the host triple, but also for `-mcpu=native` support in e.g. Clang. This is fairly tightly intertwined with the information in `X86TargetParser.h`, so keeping them in the same component makes sense. - `llvm/ADT/Triple.h` and `llvm/Support/Triple.cpp`, which contains the target triple parser and representation. This is very intertwined with the Arm target parser, because the arm architecture version appears in canonical triples on arm platforms. - I moved the relevant unittests to their own directory. And so, we end up with a single component that has all the information about the following, which to me seems like a unified component: - Triples that LLVM Knows about - Architecture names and CPUs that LLVM knows about - CPU detection logic for LLVM Given this, I have also moved `RISCVISAInfo.h` into this component, as it seems to me to be part of that same set of functionality. If you get link errors in your components after this patch, you likely need to add TargetParser into LLVM_LINK_COMPONENTS in CMake. Differential Revision: https://reviews.llvm.org/D137838
2022-11-14Revert "[opt][clang] Enable using -module-summary/-flto=thin with -S/-emit-llvm"Alexander Shaposhnikov1-1/+0
This reverts commit ef9e624694c0f125c53f7d0d3472fd486bada57d for further investigation offline. It appears to break the buildbot llvm-clang-x86_64-sie-ubuntu-fast.
2022-11-14[opt][clang] Enable using -module-summary/-flto=thin with -S/-emit-llvmAlexander Shaposhnikov1-0/+1
Enable using -module-summary with -S (similarly to what currently can be achieved with opt <input> -o - | llvm-dis). Test plan: ninja check-all Differential revision: https://reviews.llvm.org/D137768
2022-08-04[IR] Move support for dxil::TypedPointerType to LLVM core IR.Joshua Cranmer1-0/+1
This allows the construct to be shared between different backends. However, it still remains illegal to use TypedPointerType in LLVM IR--the type is intended to remain an auxiliary type, not a real LLVM type. So no support is provided for LLVM-C, nor bitcode, nor LLVM assembly (besides the bare minimum needed to make Type->dump() work properly). Reviewed By: beanz, nikic, aeubanks Differential Revision: https://reviews.llvm.org/D130592
2022-07-27[llvm] Provide utility function for MD_profPaul Kirth1-0/+1
Currently, there is significant code duplication for dealing with MD_prof metadata throughout the compiler. These utility functions can improve code reuse and simplify boilerplate code when dealing with profiling metadata, such as branch weights. The inent is to provide a uniform set of APIs that allow common tasks, such as identifying specific types of MD_prof metadata and extracting branch weights. Future patches can build on this initial implementation and clean up the different implementations across the compiler. Reviewed By: bogner Differential Revision: https://reviews.llvm.org/D128858
2022-03-07[VP] Introducing VectorBuilder, the VP intrinsic builderSimon Moll1-0/+1
VectorBuilder wraps around an IRBuilder and VectorBuilder::createVectorInstructions emits VP intrinsics as if they were regular instructions. Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D105283
2022-03-03Revert "[VP] Introducing VectorBuilder, the VP intrinsic builder"Simon Moll1-1/+0
This reverts commit 8bcbfb50e8ea24998f9adf2f50b1f63b499299ed. Taking this patch offline to fix breakage: https://lab.llvm.org/buildbot/#/builders/110/builds/10912
2022-03-03[VP] Introducing VectorBuilder, the VP intrinsic builderSimon Moll1-0/+1
VectorBuilder wraps around an IRBuilder and VectorBuilder::createVectorInstructions emits VP intrinsics as if they were regular instructions. Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D105283
2021-12-10Reapply CycleInfo: Introduce cycles as a generalization of loopsSameer Sahasrabuddhe1-0/+1
Reverts 02940d6d2202. Fixes breakage in the modules build. LLVM loops cannot represent irreducible structures in the CFG. This change introduce the concept of cycles as a generalization of loops, along with a CycleInfo analysis that discovers a nested hierarchy of such cycles. This is based on Havlak (1997), Nesting of Reducible and Irreducible Loops. The cycle analysis is implemented as a generic template and then instatiated for LLVM IR and Machine IR. The template relies on a new GenericSSAContext template which must be specialized when used for each IR. This review is a restart of an older review request: https://reviews.llvm.org/D83094 Original implementation by Nicolai Hähnle <nicolai.haehnle@amd.com>, with recent refactoring by Sameer Sahasrabuddhe <sameer.sahasrabuddhe@amd.com> Differential Revision: https://reviews.llvm.org/D112696
2021-12-07Revert "CycleInfo: Introduce cycles as a generalization of loops"Jonas Devlieghere1-1/+0
This reverts commit 0fe61ecc2cef333250a152cd90d80d0b802b27db because it breaks the modules build. https://green.lab.llvm.org/green/job/clang-stage2-rthinlto/4858/ https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/39112/
2021-12-07CycleInfo: Introduce cycles as a generalization of loopsSameer Sahasrabuddhe1-0/+1
LLVM loops cannot represent irreducible structures in the CFG. This change introduce the concept of cycles as a generalization of loops, along with a CycleInfo analysis that discovers a nested hierarchy of such cycles. This is based on Havlak (1997), Nesting of Reducible and Irreducible Loops. The cycle analysis is implemented as a generic template and then instatiated for LLVM IR and Machine IR. The template relies on a new GenericSSAContext template which must be specialized when used for each IR. This review is a restart of an older review request: https://reviews.llvm.org/D83094 Original implementation by Nicolai Hähnle <nicolai.haehnle@amd.com>, with recent refactoring by Sameer Sahasrabuddhe <sameer.sahasrabuddhe@amd.com> Differential Revision: https://reviews.llvm.org/D112696
2021-05-13[GC][NFC] Move GCStrategy from CodeGen to IRMax Kazantsev1-0/+2
We want it to be available in analyzes so that we could use the CodeGen notion in middle-end passes (for example, to check if a GC may free some particular pointer). This is a preparatory patch that simply moves the files around. Note: if this causes some build issues, this patch must just be reverted. Differential Revision: https://reviews.llvm.org/D100557 Reviewed By: reames
2021-01-22[HIP] Support __managed__ attributeYaxun (Sam) Liu1-0/+1
This patch implements codegen for __managed__ variable attribute for HIP. Diagnostics will be added later. Differential Revision: https://reviews.llvm.org/D94814
2020-12-16[CSSPGO] Consume pseudo-probe-based AutoFDO profileHongtao Yu1-0/+1
This change enables pseudo-probe-based sample counts to be consumed by the sample profile loader under the regular `-fprofile-sample-use` switch with minimal adjustments to the existing sample file formats. After the counts are imported, a probe helper, aka, a `PseudoProbeManager` object, is automatically launched to verify the CFG checksum of every function in the current compilation against the corresponding checksum from the profile. Mismatched checksums will cause a function profile to be slipped. A `SampleProfileProber` pass is scheduled before any of the `SampleProfileLoader` instances so that the CFG checksums as well as probe mappings are available during the profile loading time. The `PseudoProbeManager` object is set up right after the profile reading is done. In the future a CFG-based fuzzy matching could be done in `PseudoProbeManager`. Samples will be applied only to pseudo probe instructions as well as probed callsites once the checksum verification goes through. Those instructions are processed in the same way that regular instructions would be processed in the line-number-based scenario. In other words, a function is processed in a regular way as if it was reduced to just containing pseudo probes (block probes and callsites). **Adjustment to profile format ** A CFG checksum field is being added to the existing AutoFDO profile formats. So far only the text format and the extended binary format are supported. For the text format, a new line like ``` !CFGChecksum: 12345 ``` is added to the end of the body sample lines. For the extended binary profile format, we introduce a metadata section to store the checksum map from function names to their CFG checksums. Differential Revision: https://reviews.llvm.org/D92347
2020-12-15[Clang][Attr] Introduce the `assume` function attributeJohannes Doerfert1-0/+1
The `assume` attribute is a way to provide additional, arbitrary information to the optimizer. For now, assumptions are restricted to strings which will be accumulated for a function and emitted as comma separated string function attribute. The key of the LLVM-IR function attribute is `llvm.assume`. Similar to `llvm.assume` and `__builtin_assume`, the `assume` attribute provides a user defined assumption to the compiler. A follow up patch will introduce an LLVM-core API to query the assumptions attached to a function. We also expect to add more options, e.g., expression arguments, to the `assume` attribute later on. The `omp [begin] asssumes` pragma will leverage this attribute and expose the functionality in the absence of OpenMP. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D91979
2020-12-03[NewPM] Support --print-before/after in NPMArthur Eubanks1-0/+1
This changes --print-before/after to be a list of strings rather than legacy passes. (this also has the effect of not showing the entire list of passes in --help-hidden after --print-before/after, which IMO is great for making it less verbose). Currently PrintIRInstrumentation passes the class name rather than pass name to llvm::shouldPrintBeforePass(), meaning llvm::shouldPrintBeforePass() never functions as intended in the NPM. There is no easy way of converting class names to pass names outside of within an instance of PassBuilder. This adds a map of pass class names to their short names in PassRegistry.def within PassInstrumentationCallbacks. It is populated inside the constructor of PassBuilder, which takes a PassInstrumentationCallbacks. Add a pointer to PassInstrumentationCallbacks inside PrintIRInstrumentation and use the newly created map. This is a bit hacky, but I can't think of a better way since the short id to class name only exists within PassRegistry.def. This also doesn't handle passes not in PassRegistry.def but rather added via PassBuilder::registerPipelineParsingCallback(). llvm/test/CodeGen/Generic/print-after.ll doesn't seem very useful now with this change. Reviewed By: ychen, jamieschmeiser Differential Revision: https://reviews.llvm.org/D87216
2020-11-13llvmbuildectomy - replace llvm-build by plain cmakeserge-sans-paille1-1/+7
No longer rely on an external tool to build the llvm component layout. Instead, leverage the existing `add_llvm_componentlibrary` cmake function and introduce `add_llvm_component_group` to accurately describe component behavior. These function store extra properties in the created targets. These properties are processed once all components are defined to resolve library dependencies and produce the header expected by llvm-config. Differential Revision: https://reviews.llvm.org/D90848
2020-10-27Revert multiple patches based on "Introduce CfgTraits abstraction"Nicolai Hähnle1-1/+0
These logically belong together since it's a base commit plus followup fixes to less common build configurations. The patches are: Revert "CfgInterface: rename interface() to getInterface()" This reverts commit a74fc481588fcea9317cbf1f6c5888a30c9edd2d. Revert "Wrap CfgTraitsFor in namespace llvm to please GCC 5" This reverts commit f2a06875b604c00cbe96e54363f4f5d28935d610. Revert "Try to make GCC5 happy about the CfgTraits thing" This reverts commit 03a5f7ce12e2111c8b7bc5a95cff4c51b516250f. Revert "Introduce CfgTraits abstraction" This reverts commit c0cdd22c72fab47a3c37b5a8401763995cadaa77.
2020-10-20Introduce CfgTraits abstractionNicolai Hähnle1-0/+1
The CfgTraits abstraction simplfies writing algorithms that are generic over the type of CFG, and enables writing such algorithms as regular non-template code that operates on opaque references to CFG blocks and values. Implementations of CfgTraits provide operations on the concrete CFG types, e.g. `IrCfgTraits::BlockRef` is `BasicBlock *`. CfgInterface is an abstract base class which provides operations on opaque types CfgBlockRef and CfgValueRef. Those opaque types encapsulate a `void *`, but the meaning depends on the concrete CFG type. For example, MachineCfgTraits -- for use with MachineIR in SSA form -- encodes a Register inside CfgValueRef. Converting between concrete references and opaque/generic ones is done by CfgTraits::{fromGeneric,toGeneric}. Convenience methods CfgTraits::{un}wrap{Iterator,Range} are available as well. Writing algorithms in terms of CfgInterface adds some overhead (virtual method calls, plus in same cases it removes the opportunity to inline iterators), but can be much more convenient since generic algorithms can be written as non-templates. This patch adds implementations of CfgTraits for all CFGs on which dominator trees are calculated, so that the dominator tree can be ported to this machinery. Only IrCfgTraits (LLVM IR) and MachineCfgTraits (Machine IR in SSA form) are complete, the other implementations are limited to the absolute minimum required to make the upcoming dominator tree changes work. v5: - fix MachineCfgTraits::blockdef_iterator and allow it to iterate over the instructions in a bundle - use MachineBasicBlock::printName v6: - implement predecessors/successors for all CfgTraits implementations - fix error in unwrapRange - rename toGeneric/fromGeneric into wrapRef/unwrapRef to have naming that is consistent with {wrap,unwrap}{Iterator,Range} - use getVRegDef instead of getUniqueVRegDef v7: - std::forward fix in wrapping_iterator - fix typos v8: - cleanup operators on CfgOpaqueType - address other review comments Change-Id: Ia75f4f268fded33fca11218a7d578c9aec1f3f4d Differential Revision: https://reviews.llvm.org/D83088
2020-09-02Revert "[NewPM][Lint] Port -lint to NewPM"Arthur Eubanks1-1/+0
This reverts commit 883399c8402188520870f99e7d8b3244f000e698.
2020-09-02[NewPM][Lint] Port -lint to NewPMArthur Eubanks1-0/+1
This also changes -lint from an analysis to a pass. It's similar to -verify, and that is a normal pass, and lives in llvm/IR. Reviewed By: ychen Differential Revision: https://reviews.llvm.org/D87057
2020-08-28(Expensive) Check for Loop, SCC and Region pass return statusserge-sans-paille1-0/+1
This generalizes the logic introduced in https://reviews.llvm.org/D80916 to other passes. It's needed by https://reviews.llvm.org/D86442 to assert passes correctly report their status. Differential Revision: https://reviews.llvm.org/D86589
2020-04-02[NFC] Split Knowledge retention and place it more appropriatlyTyker1-1/+0
Summary: Splitting Knowledge retention into Queries in Analysis and Builder into Transform/Utils allows Queries and Transform/Utils to use Analysis. Reviewers: jdoerfert, sstefan1 Reviewed By: jdoerfert Subscribers: mgorny, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D77171
2020-03-10Fixed [AssumeBundles] Move to IR so it can be used by AnalysisTyker1-0/+1
This is a recommit of 57c964aaa76bfaa908398fbd9d8c9d6d19856859 after fixing modules build.
2020-03-09Revert "[AssumeBundles] Move to IR so it can be used by Analysis"Jonas Devlieghere1-1/+0
This breaks the modules build: http://green.lab.llvm.org/green/job/clang-stage2-Rthinlto/ http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/ This reverts commit 57c964aaa76bfaa908398fbd9d8c9d6d19856859.
2020-03-08[AssumeBundles] Move to IR so it can be used by AnalysisTyker1-0/+1
Summary: Assume bundles need to be usable by Analysis and Transforms/Utils isn't. so this commit moves utilities to deal with asusme bundles to IR. Reviewers: jdoerfert Reviewed By: jdoerfert Subscribers: mgorny, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D75618
2020-02-04[Remarks] Extend the RemarkStreamer to support other emittersFrancis Visoiu Mistrih1-1/+1
This extends the RemarkStreamer to allow for other emitters (e.g. frontends, SIL, etc.) to emit remarks through a common interface. See changes in llvm/docs/Remarks.rst for motivation and design choices. Differential Revision: https://reviews.llvm.org/D73676
2020-02-02[NFC] Refactor TableGen for attributesTyker1-4/+0
Summary: this patch makes tablegen generate llvm attributes in a more generic and simpler (at least to me). changes: make tablegen generate ... ATTRIBUTE_ENUM(Alignment,align) ATTRIBUTE_ENUM(AllocSize,allocsize) ... which can be used to generate most of what was previously used and more. Tablegen was also generating attributes from 2 identical files leading to identical output. so I removed one of them and made user use the other. Reviewers: jdoerfert, thakis, aaron.ballman Reviewed By: aaron.ballman Subscribers: mgorny, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D72455
2020-02-02Revert "[NFC] Refactor TableGen for attributes"Tyker1-0/+4
This reverts commit 4dba14cf37abda16ab33cb748a5c762dae2e95e9.
2020-02-02[NFC] Refactor TableGen for attributesTyker1-4/+0
Summary: this patch makes tablegen generate llvm attributes in a more generic and simpler (at least to me). changes: make tablegen generate ... ATTRIBUTE_ENUM(Alignment,align) ATTRIBUTE_ENUM(AllocSize,allocsize) ... which can be used to generate most of what was previously used and more. Tablegen was also generating attributes from 2 identical files leading to identical output. so I removed one of them and made user use the other. Reviewers: jdoerfert, thakis, aaron.ballman Reviewed By: aaron.ballman Subscribers: mgorny, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D72455
2019-11-21[cmake] Explicitly mark libraries defined in lib/ as "Component Libraries"Tom Stellard1-1/+1
Summary: Most libraries are defined in the lib/ directory but there are also a few libraries defined in tools/ e.g. libLLVM, libLTO. I'm defining "Component Libraries" as libraries defined in lib/ that may be included in libLLVM.so. Explicitly marking the libraries in lib/ as component libraries allows us to remove some fragile checks that attempt to differentiate between lib/ libraries and tools/ libraires: 1. In tools/llvm-shlib, because llvm_map_components_to_libnames(LIB_NAMES "all") returned a list of all libraries defined in the whole project, there was custom code needed to filter out libraries defined in tools/, none of which should be included in libLLVM.so. This code assumed that any library defined as static was from lib/ and everything else should be excluded. With this change, llvm_map_components_to_libnames(LIB_NAMES, "all") only returns libraries that have been added to the LLVM_COMPONENT_LIBS global cmake property, so this custom filtering logic can be removed. Doing this also fixes the build with BUILD_SHARED_LIBS=ON and LLVM_BUILD_LLVM_DYLIB=ON. 2. There was some code in llvm_add_library that assumed that libraries defined in lib/ would not have LLVM_LINK_COMPONENTS or ARG_LINK_COMPONENTS set. This is only true because libraries defined lib lib/ use LLVMBuild.txt and don't set these values. This code has been fixed now to check if the library has been explicitly marked as a component library, which should now make it easier to remove LLVMBuild at some point in the future. I have tested this patch on Windows, MacOS and Linux with release builds and the following combinations of CMake options: - "" (No options) - -DLLVM_BUILD_LLVM_DYLIB=ON - -DLLVM_LINK_LLVM_DYLIB=ON - -DBUILD_SHARED_LIBS=ON - -DBUILD_SHARED_LIBS=ON -DLLVM_BUILD_LLVM_DYLIB=ON - -DBUILD_SHARED_LIBS=ON -DLLVM_LINK_LLVM_DYLIB=ON Reviewers: beanz, smeenai, compnerd, phosek Reviewed By: beanz Subscribers: wuzish, jholewinski, arsenm, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, nhaehnle, mgorny, mehdi_amini, sbc100, jgravelle-google, hiraditya, aheejin, fedor.sergeev, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, steven_wu, rogfer01, MartinMosbeck, brucehoult, the_o, dexonsmith, PkmX, jocewei, jsji, dang, Jim, lenary, s.egerton, pzheng, sameer.abuasal, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70179
2019-11-20Move floating point related entities to namespace levelSerge Pavlov1-0/+1
This is recommit of commit e6584b2b7b2d, which was reverted in 30e7ee3c4bac together with af57dbf12e54. Original message is below. Enumerations that describe rounding mode and exception behavior were defined inside ConstrainedFPIntrinsic. It makes sense to use the same definitions to represent the same properties in other cases, not only in constrained intrinsics. It was however inconvenient as required to include constrained intrinsics definitions even if they were not needed. Also using long scope prefix reduced readability. This change moves these definitioins to the namespace llvm::fp. No functional changes. Differential Revision: https://reviews.llvm.org/D69552
2019-11-18Temporarily Revert "Add support for options -frounding-math, ftrapping-math, ↵Eric Christopher1-1/+0
-ffp-model=, and -ffp-exception-behavior=" and a follow-up NFC rearrangement as it's causing a crash on valid. Testcase is on the original review thread. This reverts commits af57dbf12e54f3a8ff48534bf1078f4de104c1cd and e6584b2b7b2de06f1e59aac41971760cac1e1b79
2019-11-15Move floating point related entities to namespace levelSerge Pavlov1-0/+1
Enumerations that describe rounding mode and exception behavior were defined inside ConstrainedFPIntrinsic. It makes sense to use the same definitions to represent the same properties in other cases, not only in constrained intrinsics. It was however inconvenient as required to include constrained intrinsics definitions even if they were not needed. Also using long scope prefix reduced readability. This change moves these definitioins to the namespace llvm::fp. No functional changes. Differential Revision: https://reviews.llvm.org/D69552
2019-08-15Link libpthread into LLVMCore.soBenjamin Kramer1-0/+2
After r369018 the compiler can inline pthread calls into users of RWMutex. llvm-svn: 369029
2019-03-06Reland "[Remarks] Refactor remark diagnostic emission in a RemarkStreamer"Francis Visoiu Mistrih1-0/+1
This allows us to store more info about where we're emitting the remarks without cluttering LLVMContext. This is needed for future support for the remark section. Differential Revision: https://reviews.llvm.org/D58996 Original llvm-svn: 355507 llvm-svn: 355514
2019-03-06Revert "[Remarks] Refactor remark diagnostic emission in a RemarkStreamer"Francis Visoiu Mistrih1-1/+0
This reverts commit 2e8c4997a2089f8228c843fd81b148d903472e02. Breaks bots. llvm-svn: 355511
2019-03-06[Remarks] Refactor remark diagnostic emission in a RemarkStreamerFrancis Visoiu Mistrih1-0/+1
This allows us to store more info about where we're emitting the remarks without cluttering LLVMContext. This is needed for future support for the remark section. Differential Revision: https://reviews.llvm.org/D58996 llvm-svn: 355507
2019-02-06Move DomTreeUpdater from IR to AnalysisRichard Trieu1-1/+0
DomTreeUpdater depends on headers from Analysis, but is in IR. This is a layering violation since Analysis depends on IR. Relocate this code from IR to Analysis to fix the layering violation. llvm-svn: 353265
2019-01-19AbstractCallSite -- A unified interface for (in)direct and callback callsJohannes Doerfert1-0/+1
An abstract call site is a wrapper that allows to treat direct, indirect, and callback calls the same. If an abstract call site represents a direct or indirect call site it behaves like a stripped down version of a normal call site object. The abstract call site can also represent a callback call, thus the fact that the initially called function (=broker) may invoke a third one (=callback callee). In this case, the abstract call side hides the middle man, hence the broker function. The result is a representation of the callback call, inside the broker, but in the context of the original instruction that invoked the broker. Again, there are up to three functions involved when we talk about callback call sites. The caller (1), which invokes the broker function. The broker function (2), that may or may not invoke the callback callee. And finally the callback callee (3), which is the target of the callback call. The abstract call site will handle the mapping from parameters to arguments depending on the semantic of the broker function. However, it is important to note that the mapping is often partial. Thus, some arguments of the call/invoke instruction are mapped to parameters of the callee while others are not. At the same time, arguments of the callback callee might be unknown, thus "null" if queried. This patch introduces also !callback metadata which describe how a callback broker maps from parameters to arguments. This metadata is directly created by clang for known broker functions, provided through source code attributes by the user, or later deduced by analyses. For motivation and additional information please see the corresponding talk (slides/video) https://llvm.org/devmtg/2018-10/talk-abstracts.html#talk20 as well as the LCPC paper http://compilers.cs.uni-saarland.de/people/doerfert/par_opt_lcpc18.pdf Differential Revision: https://reviews.llvm.org/D54498 llvm-svn: 351627
2018-09-20[New PM] Introducing PassInstrumentation frameworkFedor Sergeev1-0/+1
Pass Execution Instrumentation interface enables customizable instrumentation of pass execution, as per "RFC: Pass Execution Instrumentation interface" posted 06/07/2018 on llvm-dev@ The intent is to provide a common machinery to implement all the pass-execution-debugging features like print-before/after, opt-bisect, time-passes etc. Here we get a basic implementation consisting of: * PassInstrumentationCallbacks class that handles registration of callbacks and access to them. * PassInstrumentation class that handles instrumentation-point interfaces that call into PassInstrumentationCallbacks. * Callbacks accept StringRef which is just a name of the Pass right now. There were some ideas to pass an opaque wrapper for the pointer to pass instance, however it appears that pointer does not actually identify the instance (adaptors and managers might have the same address with the pass they govern). Hence it was decided to go simple for now and then later decide on what the proper mental model of identifying a "pass in a phase of pipeline" is. * Callbacks accept llvm::Any serving as a wrapper for const IRUnit*, to remove direct dependencies on different IRUnits (e.g. Analyses). * PassInstrumentationAnalysis analysis is explicitly requested from PassManager through usual AnalysisManager::getResult. All pass managers were updated to run that to get PassInstrumentation object for instrumentation calls. * Using tuples/index_sequence getAnalysisResult helper to extract generic AnalysisManager's extra args out of a generic PassManager's extra args. This is the only way I was able to explicitly run getResult for PassInstrumentationAnalysis out of a generic code like PassManager::run or RepeatedPass::run. TODO: Upon lengthy discussions we agreed to accept this as an initial implementation and then get rid of getAnalysisResult by improving RepeatedPass implementation. * PassBuilder takes PassInstrumentationCallbacks object to pass it further into PassInstrumentationAnalysis. Callbacks registration should be performed directly through PassInstrumentationCallbacks. * new-pm tests updated to account for PassInstrumentationAnalysis being run * Added PassInstrumentation tests to PassBuilderCallbacks unit tests. Other unit tests updated with registration of the now-required PassInstrumentationAnalysis. Made getName helper to return std::string (instead of StringRef initially) to fix asan builtbot failures on CGSCC tests. Reviewers: chandlerc, philip.pfaffe Differential Revision: https://reviews.llvm.org/D47858 llvm-svn: 342664