#
f7dffc28 |
| 10-Dec-2022 |
Kazu Hirata <kazu@google.com> |
Don't include None.h (NFC)
I've converted all known uses of None to std::nullopt, so we no longer need to include None.h.
This is part of an effort to migrate from llvm::Optional to std::optional:
Don't include None.h (NFC)
I've converted all known uses of None to std::nullopt, so we no longer need to include None.h.
This is part of an effort to migrate from llvm::Optional to std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
show more ...
|
#
247ecc99 |
| 09-Dec-2022 |
Luke Lau <luke@igalia.com> |
[AsmParser] Check that addrspace fits within 24 bits
Address spaces equal or larger than 1 << 24 don't fit and produce an assertion during debug builds, or worse in release. This causes an error to
[AsmParser] Check that addrspace fits within 24 bits
Address spaces equal or larger than 1 << 24 don't fit and produce an assertion during debug builds, or worse in release. This causes an error to be reported during parsing instead.
Differential Revision: https://reviews.llvm.org/D139528
show more ...
|
#
f8500354 |
| 08-Dec-2022 |
Alex Richardson <alexrichardson@google.com> |
[LLParser] Support symbolic address space numbers
This allows the LLParser to also accept "A", "G", and "P" in `addrspace` usages. "A" will be replaced by the alloca address space defined in the glo
[LLParser] Support symbolic address space numbers
This allows the LLParser to also accept "A", "G", and "P" in `addrspace` usages. "A" will be replaced by the alloca address space defined in the globals, "G" by the default globals address space and "P" by the program address space. This makes it easier to write tests that use different address space and only only vary the RUN: lines. Currently, the only alternative is to pre-process the sources with a tool such as `sed`
Importantly, these new string values are only accepted in .ll files and not stored in the bitcode format, so it does not round-trip via llvm-as and llvm-dis (see newly added test).
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D138789
show more ...
|
#
c9cb4fc7 |
| 01-Dec-2022 |
Jonas Hahnfeld <jonas.hahnfeld@cern.ch> |
[DebugInfo] Store optional DIFile::Source as pointer
getCanonicalMDString() also returns a nullptr for empty strings, which tripped over the getSource() method. Solve the ambiguity of no source vers
[DebugInfo] Store optional DIFile::Source as pointer
getCanonicalMDString() also returns a nullptr for empty strings, which tripped over the getSource() method. Solve the ambiguity of no source versus an optional containing a nullptr by simply storing a pointer.
Differential Revision: https://reviews.llvm.org/D138658
show more ...
|
#
89fae41e |
| 05-Dec-2022 |
Fangrui Song <i@maskray.me> |
[IR] llvm::Optional => std::optional
Many llvm/IR/* files have been migrated by other contributors. This migrates most remaining files.
|
#
0ca43d44 |
| 03-Dec-2022 |
Krzysztof Parzyszek <kparzysz@quicinc.com> |
DebugInfoMetadata: convert Optional to std::optional
|
#
aadaafac |
| 03-Dec-2022 |
Kazu Hirata <kazu@google.com> |
[llvm] Use std::nullopt instead of None (NFC)
This patch mechanically replaces None with std::nullopt where the compiler would warn if None were deprecated. The intent is to reduce the amount of ma
[llvm] Use std::nullopt instead of None (NFC)
This patch mechanically replaces None with std::nullopt where the compiler would warn if None were deprecated. The intent is to reduce the amount of manual work required in migrating from Optional to std::optional.
This is part of an effort to migrate from llvm::Optional to std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
show more ...
|
#
abf0c6c0 |
| 02-Dec-2022 |
Jan Svoboda <jan_svoboda@apple.com> |
Use CTAD on llvm::SaveAndRestore
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D139229
|
#
26424c96 |
| 02-Dec-2022 |
Krzysztof Parzyszek <kparzysz@quicinc.com> |
Attributes: convert Optional to std::optional
|
#
9eacbba2 |
| 16-Nov-2022 |
Teresa Johnson <tejohnson@google.com> |
Restore "[MemProf] ThinLTO summary support" with more fixes
This restores commit 98ed423361de2f9dc0113a31be2aa04524489ca9 and follow on fix 00c22351ba697dbddb4b5bf0ad94e4bcea4b316b, which were rever
Restore "[MemProf] ThinLTO summary support" with more fixes
This restores commit 98ed423361de2f9dc0113a31be2aa04524489ca9 and follow on fix 00c22351ba697dbddb4b5bf0ad94e4bcea4b316b, which were reverted in 5d938eb6f79b16f55266dd23d5df831f552ea082 due to an MSVC bot failure. I've included a fix for that failure.
Differential Revision: https://reviews.llvm.org/D135714
show more ...
|
#
5d938eb6 |
| 16-Nov-2022 |
Jeremy Morse <jeremy.morse@sony.com> |
Revert "Restore "[MemProf] ThinLTO summary support" with fixes"
This reverts commit 00c22351ba697dbddb4b5bf0ad94e4bcea4b316b. This reverts commit 98ed423361de2f9dc0113a31be2aa04524489ca9.
Seemingly
Revert "Restore "[MemProf] ThinLTO summary support" with fixes"
This reverts commit 00c22351ba697dbddb4b5bf0ad94e4bcea4b316b. This reverts commit 98ed423361de2f9dc0113a31be2aa04524489ca9.
Seemingly MSVC has some kind of issue with this patch, in terms of linking:
https://lab.llvm.org/buildbot/#/builders/123/builds/14137
I'll post more detail on D135714 momentarily.
show more ...
|
#
98ed4233 |
| 15-Nov-2022 |
Teresa Johnson <tejohnson@google.com> |
Restore "[MemProf] ThinLTO summary support" with fixes
This restores 47459455009db4790ffc3765a2ec0f8b4934c2a4, which was reverted in commit 452a14efc84edf808d1e2953dad2c694972b312f, along with fixes
Restore "[MemProf] ThinLTO summary support" with fixes
This restores 47459455009db4790ffc3765a2ec0f8b4934c2a4, which was reverted in commit 452a14efc84edf808d1e2953dad2c694972b312f, along with fixes for a couple of bot failures.
show more ...
|
#
452a14ef |
| 15-Nov-2022 |
Teresa Johnson <tejohnson@google.com> |
Revert "[MemProf] ThinLTO summary support"
This reverts commit 47459455009db4790ffc3765a2ec0f8b4934c2a4.
Revert while I try to fix a couple of non-Linux build failures.
|
Revision tags: llvmorg-15.0.4, llvmorg-15.0.3 |
|
#
47459455 |
| 11-Oct-2022 |
Teresa Johnson <tejohnson@google.com> |
[MemProf] ThinLTO summary support
Implements the ThinLTO summary support for memprof related metadata.
This includes support for the assembly format, and for building the summary from IR during Mod
[MemProf] ThinLTO summary support
Implements the ThinLTO summary support for memprof related metadata.
This includes support for the assembly format, and for building the summary from IR during ModuleSummaryAnalysis.
To reduce space in both the bitcode format and the in memory index, we do 2 things: 1. We keep a single vector of all uniq stack id hashes, and record the index into this vector in the callsite and allocation memprof summaries. 2. When building the combined index during the LTO link, the callsite and allocation memprof summaries are only kept on the FunctionSummary of the prevailing copy.
Differential Revision: https://reviews.llvm.org/D135714
show more ...
|
#
feda983f |
| 08-Nov-2022 |
Nikita Popov <npopov@redhat.com> |
[TableGen] Use MemoryEffects to represent intrinsic memory effects (NFCI)
The TableGen implementation was using a homegrown implementation of FunctionModRefInfo. This switches it to use MemoryEffect
[TableGen] Use MemoryEffects to represent intrinsic memory effects (NFCI)
The TableGen implementation was using a homegrown implementation of FunctionModRefInfo. This switches it to use MemoryEffects instead. This makes the code simpler, and will allow exposing the full representational power of MemoryEffects in the future. Among other things, this will allow us to map IntrHasSideEffects to an inaccessiblemem readwrite, rather than just ignoring it entirely in most cases.
To avoid layering issues, this moves the ModRef.h header from IR to Support, so that it can be included in the TableGen layer.
Differential Revision: https://reviews.llvm.org/D137641
show more ...
|
#
26382a44 |
| 07-Nov-2022 |
OCHyams <orlando.hyams@sony.com> |
Reapply [Assignment Tracking][5/*] Add core infrastructure for instruction reference
Previously reverted in 41f5a0004e442ae71c8e754fdadb4bd1e172fb2d. Fold in D133576 previously reverted in d29d5ffb6
Reapply [Assignment Tracking][5/*] Add core infrastructure for instruction reference
Previously reverted in 41f5a0004e442ae71c8e754fdadb4bd1e172fb2d. Fold in D133576 previously reverted in d29d5ffb6332569e85d5eda5130603bbd8664635.
---
The Assignment Tracking debug-info feature is outlined in this RFC:
https://discourse.llvm.org/t/ rfc-assignment-tracking-a-better-way-of-specifying-variable-locations-in-ir
Overview It's possible to find intrinsics linked to an instruction by looking at the MetadataAsValue uses of the attached DIAssignID. That covers instruction -> intrinsic(s) lookup. Add a global DIAssignID -> instruction(s) map which gives us the ability to perform intrinsic -> instruction(s) lookup. Add plumbing to keep the map up to date through optimisations and add utility functions including two that perform those lookups. Finally, add a unittest.
Details In llvm/lib/IR/LLVMContextImpl.h add AssignmentIDToInstrs which maps DIAssignID * attachments to Instruction *s. Because the DIAssignID * is the key we can't use a TrackingMDNodeRef for it, and therefore cannot easily update the mapping when a temporary DIAssignID is replaced.
Temporary DIAssignID's are only used in IR parsing to deal with metadata forward references. Update llvm/lib/AsmParser/LLParser.cpp to avoid using temporary DIAssignID's for attachments.
In llvm/lib/IR/Metadata.cpp add Instruction::updateDIAssignIDMapping which is called to remove or add an entry (or both) to AssignmentIDToInstrs. Call this from Instruction::setMetadata and add a call to setMetadata in Intruction's dtor that explicitly unsets the DIAssignID so that the mappging gets updated.
In llvm/lib/IR/DebugInfo.cpp and DebugInfo.h add utility functions:
getAssignmentInsts(const DbgAssignIntrinsic *DAI) getAssignmentMarkers(const Instruction *Inst) RAUW(DIAssignID *Old, DIAssignID *New) deleteAll(Function *F) deleteAssignmentMarkers(const Instruction *Inst)
These core utils are tested in llvm/unittests/IR/DebugInfoTest.cpp.
Reviewed By: jmorse
Differential Revision: https://reviews.llvm.org/D132224
show more ...
|
#
41f5a000 |
| 07-Nov-2022 |
Shubham Sandeep Rastogi <srastogi22@apple.com> |
Revert "[Assignment Tracking][5/*] Add core infrastructure for instruction reference"
This reverts commit 171f7024cc82e8702abebdedb699d37b50574be7.
Reverting this patch because it causes a cyclic d
Revert "[Assignment Tracking][5/*] Add core infrastructure for instruction reference"
This reverts commit 171f7024cc82e8702abebdedb699d37b50574be7.
Reverting this patch because it causes a cyclic dependency in the module build
https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/48197/consoleFull#-69937453049ba4694-19c4-4d7e-bec5-911270d8a58c
In file included from <module-includes>:1: /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/include/llvm/IR/Argument.h:18:10: fatal error: cyclic dependency in module 'LLVM_IR': LLVM_IR -> LLVM_intrinsic_gen -> LLVM_IR ^ While building module 'LLVM_MC' imported from /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/lib/MC/MCAsmInfoCOFF.cpp:14: While building module 'LLVM_IR' imported from /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/include/llvm/MC/MCPseudoProbe.h:57: In file included from <module-includes>:12: /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/include/llvm/IR/DebugInfo.h:24:10: fatal error: could not build module 'LLVM_intrinsic_gen' ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ While building module 'LLVM_MC' imported from /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/lib/MC/MCAsmInfoCOFF.cpp:14: In file included from <module-includes>:15: In file included from /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/include/llvm/MC/MCContext.h:23: /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/include/llvm/MC/MCPseudoProbe.h:57:10: fatal error: could not build module 'LLVM_IR' ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~ /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/lib/MC/MCAsmInfoCOFF.cpp:14:10: fatal error: could not build module 'LLVM_MC' ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ 4 errors generated.
show more ...
|
#
171f7024 |
| 07-Nov-2022 |
OCHyams <orlando.hyams@sony.com> |
[Assignment Tracking][5/*] Add core infrastructure for instruction reference
The Assignment Tracking debug-info feature is outlined in this RFC:
https://discourse.llvm.org/t/ rfc-assignment-trackin
[Assignment Tracking][5/*] Add core infrastructure for instruction reference
The Assignment Tracking debug-info feature is outlined in this RFC:
https://discourse.llvm.org/t/ rfc-assignment-tracking-a-better-way-of-specifying-variable-locations-in-ir
Overview It's possible to find intrinsics linked to an instruction by looking at the MetadataAsValue uses of the attached DIAssignID. That covers instruction -> intrinsic(s) lookup. Add a global DIAssignID -> instruction(s) map which gives us the ability to perform intrinsic -> instruction(s) lookup. Add plumbing to keep the map up to date through optimisations and add utility functions including two that perform those lookups. Finally, add a unittest.
Details In llvm/lib/IR/LLVMContextImpl.h add AssignmentIDToInstrs which maps DIAssignID * attachments to Instruction *s. Because the DIAssignID * is the key we can't use a TrackingMDNodeRef for it, and therefore cannot easily update the mapping when a temporary DIAssignID is replaced.
Temporary DIAssignID's are only used in IR parsing to deal with metadata forward references. Update llvm/lib/AsmParser/LLParser.cpp to avoid using temporary DIAssignID's for attachments.
In llvm/lib/IR/Metadata.cpp add Instruction::updateDIAssignIDMapping which is called to remove or add an entry (or both) to AssignmentIDToInstrs. Call this from Instruction::setMetadata and add a call to setMetadata in Intruction's dtor that explicitly unsets the DIAssignID so that the mappging gets updated.
In llvm/lib/IR/DebugInfo.cpp and DebugInfo.h add utility functions:
getAssignmentInsts(const DbgAssignIntrinsic *DAI) getAssignmentMarkers(const Instruction *Inst) RAUW(DIAssignID *Old, DIAssignID *New) deleteAll(Function *F)
These core utils are tested in llvm/unittests/IR/DebugInfoTest.cpp.
Reviewed By: jmorse
Differential Revision: https://reviews.llvm.org/D132224
show more ...
|
#
a2620e00 |
| 03-Nov-2022 |
OCHyams <orlando.hyams@sony.com> |
[Assignment Tracking][3/*] Add DIAssignID metadata boilerplate
The Assignment Tracking debug-info feature is outlined in this RFC:
https://discourse.llvm.org/t/ rfc-assignment-tracking-a-better-way
[Assignment Tracking][3/*] Add DIAssignID metadata boilerplate
The Assignment Tracking debug-info feature is outlined in this RFC:
https://discourse.llvm.org/t/ rfc-assignment-tracking-a-better-way-of-specifying-variable-locations-in-ir
Add the DIAssignID metadata attachment boilerplate. Includes a textual-bitcode roundtrip test and tests that the verifier and parser catch badly formed IR.
This piece of metadata links together stores (used as an attachment) and the yet-to-be-added llvm.dbg.assign debug intrinsic (used as an operand).
Reviewed By: jmorse
Differential Revision: https://reviews.llvm.org/D132222
show more ...
|
#
304f1d59 |
| 02-Nov-2022 |
Nikita Popov <npopov@redhat.com> |
[IR] Switch everything to use memory attribute
This switches everything to use the memory attribute proposed in https://discourse.llvm.org/t/rfc-unify-memory-effect-attributes/65579. The old argmemo
[IR] Switch everything to use memory attribute
This switches everything to use the memory attribute proposed in https://discourse.llvm.org/t/rfc-unify-memory-effect-attributes/65579. The old argmemonly, inaccessiblememonly and inaccessiblemem_or_argmemonly attributes are dropped. The readnone, readonly and writeonly attributes are restricted to parameters only.
The old attributes are auto-upgraded both in bitcode and IR. The bitcode upgrade is a policy requirement that has to be retained indefinitely. The IR upgrade is mainly there so it's not necessary to update all tests using memory attributes in this patch, which is already large enough. We could drop that part after migrating tests, or retain it longer term, to make it easier to import IR from older LLVM versions.
High-level Function/CallBase APIs like doesNotAccessMemory() or setDoesNotAccessMemory() are mapped transparently to the memory attribute. Code that directly manipulates attributes (e.g. via AttributeList) on the other hand needs to switch to working with the memory attribute instead.
Differential Revision: https://reviews.llvm.org/D135780
show more ...
|
#
fac26eda |
| 03-Nov-2022 |
OCHyams <orlando.hyams@sony.com> |
Revert "[Assignment Tracking][3/*] Add DIAssignID metadata boilerplate"
This reverts commit c285df77e9b78f971f9cd9d025248c20b030cc2a.
A sanitizer bot found an issue: https://lab.llvm.org/buildbot/#
Revert "[Assignment Tracking][3/*] Add DIAssignID metadata boilerplate"
This reverts commit c285df77e9b78f971f9cd9d025248c20b030cc2a.
A sanitizer bot found an issue: https://lab.llvm.org/buildbot/#/builders/5/builds/28809/steps/13/logs/stdio
show more ...
|
#
e53c4c6d |
| 03-Nov-2022 |
OCHyams <orlando.hyams@sony.com> |
[Assignment Tracking][3/*] Add DIAssignID metadata boilerplate
The Assignment Tracking debug-info feature is outlined in this RFC:
https://discourse.llvm.org/t/ rfc-assignment-tracking-a-better-way
[Assignment Tracking][3/*] Add DIAssignID metadata boilerplate
The Assignment Tracking debug-info feature is outlined in this RFC:
https://discourse.llvm.org/t/ rfc-assignment-tracking-a-better-way-of-specifying-variable-locations-in-ir
Add the DIAssignID metadata attachment boilerplate. Includes a textual-bitcode roundtrip test and tests that the verifier and parser catch badly formed IR.
This piece of metadata links together stores (used as an attachment) and the yet-to-be-added llvm.dbg.assign debug intrinsic (used as an operand).
Reviewed By: jmorse
Differential Revision: https://reviews.llvm.org/D132222
show more ...
|
#
e9754f02 |
| 10-Oct-2022 |
Nikita Popov <npopov@redhat.com> |
[IR] Add support for memory attribute
This implements IR and bitcode support for the memory attribute, as specified in https://reviews.llvm.org/D135597.
The new attribute is not used for anything y
[IR] Add support for memory attribute
This implements IR and bitcode support for the memory attribute, as specified in https://reviews.llvm.org/D135597.
The new attribute is not used for anything yet (and as such, the old memory attributes are unaffected).
Differential Revision: https://reviews.llvm.org/D135592
show more ...
|
#
befb731b |
| 21-Oct-2022 |
Nikita Popov <npopov@redhat.com> |
[LLParser] Remove redundant remangling (NFCI)
UpgradeCallsToIntrinsic() is already intended to perform remangling in case no other upgrades are necessary. The additional remangleIntrinsicFunction()
[LLParser] Remove redundant remangling (NFCI)
UpgradeCallsToIntrinsic() is already intended to perform remangling in case no other upgrades are necessary. The additional remangleIntrinsicFunction() calls are not needed and can hide bugs in the UpgradeCallsToIntrinsic() implementation.
show more ...
|
#
45472274 |
| 11-Oct-2022 |
Nikita Popov <npopov@redhat.com> |
[Attributes] Remove AttrBuilder::hasAlignmentAttr() method (NFC)
This was the odd one out, with similar methods not existing for any other attributes. In the places where it is used, it is best repl
[Attributes] Remove AttrBuilder::hasAlignmentAttr() method (NFC)
This was the odd one out, with similar methods not existing for any other attributes. In the places where it is used, it is best replaced by AttrBuilder::getAttribute(), which allows us to both test for presence of the attribute and retrieve its value at the same time. (To just check for presence, contains() could be used.)
show more ...
|