Reapply "[TableGen] Reduce number of call to FactorNodes. NFC"
With more fixes to avoid deferencing a before_begin iterator.
Original commit message:
Previously we recursively called FactorNodes all the way down the
tree any time FactorNodes was called. Additionally, on returning
from the recursiion we would flatten any child ScopeMatchers into
the parent.
There are additional calls to FactorNodes every time a new ScopeMatcher
is created. These calls cause a lot of visiting of parts of the tree that
have already been factored as much as possible.
We can remove the primary recursion by ensuring we flatten
scopes when building a new ScopeMatcher. If the Matcher we are
going to insert into the new ScopeMatcher is itself a ScopeMatcher,
we add the children into the new ScopeMatcher instead. This makes
[2 lines not shown]
Revert "Reapply "[TableGen] Reduce number of call to FactorNodes. NFC""
This reverts commit 193c1f4af7f1bd9249c99bc3c0b7d9ebe4698d11.
Still failing on the bots, but it doesn't show up in my local
testing with multiple compilers.
[clang] Optimize Lexer hot path to reduce compile time (#177153)
This patch fix this compile time regression that introduced in
https://github.com/llvm/llvm-project/pull/173789.
- Introduce a `TokenFlag::PhysicalStartOfLine` flag to replace
`IsAtPhysicalStartOfLine` in a brunch of `Lexer` member functions and
remove `ExportContextualKeywordInfo` struct.
- Handle `import`, `module` and `export` keyword in `HandleIdentifier`
instead of in a `Lexer` hot path.
---------
Signed-off-by: yronglin <yronglin777 at gmail.com>
Reapply "[TableGen] Reduce number of call to FactorNodes. NFC"
With a fix to avoid deferencing a before_begin iterator.
Original commit message:
Previously we recursively called FactorNodes all the way down the
tree any time FactorNodes was called. Additionally, on returning
from the recursiion we would flatten any child ScopeMatchers into
the parent.
There are additional calls to FactorNodes every time a new ScopeMatcher
is created. These calls cause a lot of visiting of parts of the tree that
have already been factored as much as possible.
We can remove the primary recursion by ensuring we flatten
scopes when building a new ScopeMatcher. If the Matcher we are
going to insert into the new ScopeMatcher is itself a ScopeMatcher,
we add the children into the new ScopeMatcher instead. This makes
[2 lines not shown]
[Clang][AMDGPU][Docs] Add builtin documentation for AMDGPU builtins
Use the documentation generation infrastructure to document the AMDGPU builtins.
This PR starts with the ABI / Special Register builtins. Documentation for the
remaining builtin categories will be added incrementally in follow-up patches.
[Clang][TableGen] Add documentation generation infrastructure for builtins
Add a `-gen-builtin-docs` TableGen backend that generates RST
documentation from builtin definitions, modeled after the existing
attribute documentation system (`-gen-attr-docs`).
The emitter generates per-builtin RST sections grouped by category, including
prototype rendering with optional named parameters (via `ArgNames`), target
feature annotations, and documentation content. A mismatch between `ArgNames`
count and prototype parameter count is a fatal error.
[lldb/docs] Add Scripted Symbol Locator to website documentation (#181594)
This patch adds documentation for the Scripted Symbol Locator plugin
system, including tutorial (renamed to hunting-down-symbols.md to match
other tutorial naming conventions) and cleans up API reference for the
website.
Signed-off-by: Med Ismail Bennani <ismail at bennani.ma>
[NFC][X86] Pass ConstantInt for step size in createLoop
createLoop is always called with a constant step size. Propagate the
type information so that it can be used later when deriving profile
information when possible.
Reviewers: phoebewang, RKSimon, mtrofin
Pull Request: https://github.com/llvm/llvm-project/pull/181577
[ELF] Defer ctx.hasTlsIe assignment to postScanRelocations. NFC
Move ctx.hasTlsIe stores from the relocation scan phase to
postScanRelocations. The ctx.hasTlsIe value is ignored for
`!shared` case, so we can remove some redundant assignment.
Revert "[TableGen] Reduce number of call to FactorNodes. NFC"
This reverts commit 3ec6ca7d58c4a1a7ee68df41388d71c4e4b858d0.
Failing a couple bots even though it passed locally.
[TableGen] Reduce number of call to FactorNodes. NFC
Previously we recursively called FactorNodes all the way down the
tree any time FactorNodes was called. Additionally, on returning
from the recursiion we would flatten any child ScopeMatchers into
the parent.
There are additional calls to FactorNodes every time a new ScopeMatcher
is created. These calls cause a lot of visiting of parts of the tree that
have already been factored as much as possible.
We can remove the primary recursion by ensuring we flatten
scopes when building a new ScopeMatcher. If the Matcher we are
going to insert into the new ScopeMatcher is itself a ScopeMatcher,
we add the children into the new ScopeMatcher instead. This makes
the FactorNodes call for the newly created scope more powerful
eliminating the need for the recursion.
[mlir][Math] Fix math-expand-ops crash on math.ctlz with index type (#181539)
Fixes #179847
math.ctlz expansion called getIntOrFloatBitWidth() on the operand type
without checking. Index type has no fixed bitwidth and is not int/float,
so the assertion in Type::getIntOrFloatBitWidth() could fire.
- In convertCtlzOp, bail out with notifyMatchFailure when the element
type is not integer or float, so expansion is only applied to types with
a defined bitwidth.
- Add a test in expand-math.mlir that math.ctlz on index is left
unchanged by the pass (no crash, op preserved).
[InstCombine] Avoid invalid bitcast across address spaces in foldIntegerTypedPHI (#181064)
Only use a PtrToInt's source pointer as an available pointer value when
its pointer type exactly matches the inttoptr target type. This prevents
creating an invalid bitcast between differing address spaces during
foldIntegerTypedPHI.
[clang][ObjC][CodeComplete] Fix crash on C-Style cast with parenthesized operand in ObjC++ (#180343)
In ObjC++ mode, code-completion after a C-style cast like
`(int*)(0x200)` crashed because the inner parenthesized expression was
parsed as a `ParenListExpr` (null type) due to `AllowTypes` propagation.
Fixes https://github.com/llvm/llvm-project/issues/180125
[LifetimeSafety] 'erase' does not invaldiate node-based containers (#181216)
```cpp
// This pattern was previously flagged as a lifetime violation
for (auto it = my_map.begin(); it != my_map.end(); ) {
if (should_delete(*it)) {
my_map.erase(it++); // Safe in map, but flagged as invalidating 'it'
} else {
++it;
}
}
```
[Clang][AMDGPU][Docs] Add builtin documentation for AMDGPU builtins
Use the documentation generation infrastructure to document the AMDGPU builtins.
This PR starts with the ABI / Special Register builtins. Documentation for the
remaining builtin categories will be added incrementally in follow-up patches.