[docs] Migrate 20 LLVM docs to markdown (#201465)
An LLM assisted in the rewrite. I didn't use pandoc or any other tools,
and I think there are fewer artifacts. I validated these docs by opening
all 20 HTML files in my browser.
Files:
- DebuggingLLVM.md
- FAQ.md
- CompilerWriterInfo.md
- GettingStartedVS.md
- NewPassManager.md
- MemorySSA.md
- LoopTerminology.md
- Lexicon.md
- MIRLangRef.md
- CoverageMappingFormat.md
- InstrProfileFormat.md
- BitCodeFormat.md
[9 lines not shown]
[docs] Rename 20 key LLVM docs to Markdown (#201464)
This may break the docs build temporarily, but there will be a follow-up
PR that fixes it immediately after. The rename is being committed first
to aid review and source code archaelogy.
Tracking issue: #201242
[X86][GlobalISel] Adding missing Query to G_BUILD_VECTOR legalization (#199435)
Once G_BUILD_VECTOR was fixed, legalize-undef-vec-scaling.mir falled
into endless legalization loop as incoming MIR doesn't match correct
lowering of the type.
[SSAF][Extractor] Make hard errors in Extractors quiet
Hard errors were used in extractors during development to quickly
identify unsupported language constructs. This commit converts them to
DEBUG_WITH_TYPE so that these errors are silenced in release builds.
rdar://178747892
[clang][lex] Store `HeaderFileInfo` in a `MapVector` (#201936)
This is a re-commit of PR #200968 (f357a47) that was reverted by PR
#201702 (adaa9e0). One call-site of
`HeaderSearch::forEachExistingLocalFileInfo()` in `ASTWriter` relies on
stable order, which the `DenseMap` didn't provide. This PR switches to
`MapVector`, which has the same performance characteristics as the
original solution at the cost of a theoretical memory usage increase.
Original PR description:
Calling `FileManager::GetUniqueIDMapping()` during modular builds gets
very expensive if the `FileManager` has seen lots of files. This
function is used in two places in the `ASTWriter` to look up
`HeaderFileInfo` in `HeaderSearch`.
This PR changes the storage of `HeaderFileInfo` from
`FileEntry::getUID()`-indexed `std::vector<T>` to
`llvm::DenseMap<FileEntryRef, T>`, improving scanning performance by
~2.5%.
Reland "Remove the optional bitcast between a musttail call and its ret" (#201280) (#201642)
This relands #201280, which was reverted in #201479 because it broke the
sanitizer buildbot
The revert was caused by a heap-use-after-free in
`BitcodeReader::materialize`
Fix: The CallBase branch could have erased I before we read it in the
new conditional
[Flang][OpenMP] Support iterator modifiers in map and motion clauses
Support iterated array elements and array sections in map and motion clauses for
target data, target enter data, target exit data, and target update constructs.
Preserve mapper resolution for iterated entries, including explicit mappers,
user-defined default mappers, declare mapper entries, and implicit default
mappers.
This PR stacked on top of #197047 and #197752.
This patch is part of the feature work for #188061.
Assisted with copilot.
[SSAF] Let function parameters inherit linkage from their parent functions
SSAF treats parameters as entities and may not always associate them
back to their parent functions. Therefore, it needs to identify
parameters of functions with external linkage across different
TUs. Treating them as having no linkage (as in C++) causes the same
parameter in different TUs to be assigned different EntityIDs. As a
result, the behavior of the parameter across multiple TUs cannot be
correlated.
rdar://178844032
[DirectX][ObjectYAML] Add SRCI part support (#199446)
Add support for DXContainer SRCI in the ObjectYAML pipeline so it can be
represented in structured YAML and round-tripped through
yaml2obj/obj2yaml.
SRCI is emitted into shader PDB files. It stores shader source code that
is displayed in PIX, and shader compilation flags.
[flang][OpenMP][NFC] Share declare mapper helpers for iterator modifier lowering
Move mapper lookup and implicit default mapper creation into reusable
OpenMP lowering helpers so regular map lowering and iterator-generated
map entries can use the same resolution path.
This prepares Flang iterator modifier lowering for map and motion clauses
without changing the generated IR for existing non-iterator maps.
[DirectX] Rewrite DIGlobalVariableExpression to DXDIGlobalVariable (#199791)
DIGlobalVariable used to have an `expr` operand. Starting from
bceaaa964360 `expr` is now an operand of DIGlobalVariableExpression,
which references both the variable and the expression.
Before:
!0 = !DIGlobalVariable(expr: !1)
!1 = !DIExpression(DW_OP_plus, 4)
Now:
!2 = !DIGlobalVariableExpression(var: !3, expr: !4)
!3 = distinct !DIGlobalVariable(name: "a", scope: null, isLocal: false,
isDefinition: true, type: !6)
!4 = !DIExpression(DW_OP_plus, 4)
DXIL does not support DIGlobalVariableExpression, so we have to fold
`expr` back to DIGlobalVariable.
[2 lines not shown]
[lld-macho][LTO] Emit `__llvm_addrsig` for `--icf=safe_thunks` (#188486)
LTO was emitting `__llvm_addrsig` metadata when `--icf=safe` was
specified, but not for `--icf=safe_thunks`. After the recent PR
https://github.com/llvm/llvm-project/pull/188400 that makes safe ICF
conservative without `__llvm_addrsig` (marking all symbols as
address-significant when the section is absent), this omission caused
safe_thunks to silently degrade for all LTO-compiled objects: every
symbol became `keepUnique`, preventing body folding entirely.
Fix this by also enabling `EmitAddrsig` when `icfLevel` is
`safe_thunks`. This allows the LTO backend to emit precise
address-significance metadata, so that only truly address-significant
functions get thunk treatment while non-address-significant identical
functions can still be body-folded.
Add a regression test that verifies LTO + `--icf=safe_thunks` correctly
body-folds non-address-significant identical functions, which would fail
without this fix due to missing addrsig metadata.
Restore unnamed_addr on vtables in -fno-rtti builds (#201846)
This is a follow-up to #200108 which dropped unnamed_addr from vtables
since it can break dynamic_cast under some circumstances. However, that
caused significant binary size regressions due to preventing ICF of
vtables.
This patch restores unnamed_addr on vtables in -fno-rtti builds, since
those do not support dynamic_cast, recovering the binary size savings at
least for those using that configuration.
[flang][OpenMP] Implicit declarations of procedures in DECLARE_TARGET
This replaces commit 8f5df8891840b, since it was rejecting the following
case:
```
function baz(a)
!$omp declare target to(baz)
real, intent(in) :: a
baz = a
end
program main
real :: a
!$omp declare target(baz)
integer, save :: baz ! error: 'baz' is already declared
end
```
Instead of flagging an error, the 'baz' in the directive should be
resolved to the explicitly declared variable.
[24 lines not shown]
[SelectionDAG] Fix -Wunused-variable (#201932)
NumDstElts is only used in assertions so mark it [[maybe_unused]] to
prevent any issues with non-asserts builds and -Wunused-variable.
AMDGPU: fix assert when calling LiveRegUnits::stepBackward (#201887)
`stepBackward` assert added in
https://github.com/llvm/llvm-project/pull/193104.
Found while building `aqlprofile` as part of TheRock.