Now that we don't have the PointeeStorage pointer anymore, it's simpler
to access the members of the anonymous union directly instead of using
asBlockPointer(), etc.
This PR adds lowering of workdistribute construct in flang to omp mlir dialect workdistribute op.
The work in this PR is c-p and updated from @ivanradanov commits from coexecute implementation:
flang_workdistribute_iwomp_2024
If the srl+shl have the same shift amount and the shl has the nuw flag,
we can remove both.
In the affected test, the InterleavedAccess pass will emit a udiv after
the `mul nuw`. We expect them to combine away. The remaining shifts on
the RV64 tests are because we didn't add the zeroext attribute to the
incoming evl operand.
This patch adds legalization and instruction selection support for the
`G_ATOMICRMW_ADD` opcode in the RISCV GlobalISel backend. Support for
other opcodes will be added in subsequent PRs.
Co-authored-by: Kane Wang <kanewang95@foxmail.com>
This fixes a bug in the fast path for the creation of TagTypes from
injected class names.
The creation of TagTypes has a fast path which, when there is no
elaboration, uses storage in the declaration itself for memoizing the
resuling type node, instead of using the folding set.
This memoizing would fail when the type was created from the injected
class name, as we would look for the node in the injected declaration
but store it in the non-injected one, so a different type would be
created each time.
This regression was reported here:
https://github.com/llvm/llvm-project/pull/147835#discussion_r2299248995
Since this regression was never released, there are no release notes.
This reverts commit 9642aadf7064192164d1687378d28d6bda1978c9.
Since elem() only works on primitive arrays anyway, we don't have to do
the isArrayRoot() check at all.
This makes sure NestedNameSpecifierLocs don't apply to the replacement
TemplateName of SubstTemplate* nodes.
Also removes improper name qualification over these Subst Nodes, causing
some canonical TemplateNames to not be fully qualified when printed.
Since this is a regression introduced in #147835, which was never
released, there are no release notes.
Fixes#155281
This patch registers and lowers the GNU extension intrinsic `SECNDS` in
Flang.
- Registration and lowering are wired through the intrinsic
infrastructure.
- genSecnds() currently emits a TODO fatal error, marking it as
unimplemented.
- Includes an XFAIL test to exercise the lowering path and reflect
current status.
Fixes https://github.com/llvm/llvm-project/issues/58728
---
CC @eugeneepshteyn @klausler
---------
Co-authored-by: Eugene Epshteyn <eepshteyn@nvidia.com>
This now applies to gfx90a+ and gfx1250, so add a dedicated feature
for it so the feature check can be composed correctly with unrelated
properties. Probably would be better to invert this, but that turns
out to be difficult given the current assumptions.
`-print-before` and `-print-after` support multiple passes as a list of
strings, so it makes sense that we also support
`-print-before-pass-number` and `-print-after-pass-number` taking a list
of pass numbers as input. This is useful if you want to print out the
IRs before/after specified passes with pass numbers reported by
print-pass-numbers in a single run.
This patch query `getAddressComputationCost()` with scalar type if the
address is uniform. This can help the cost for gather/scatter more
accurate.
In current LV, non consecutive VPWidenMemoryRecipe (gather/scatter) will
account the cost of address computation. But there are some cases that
the address is uniform across all lanes, that makes the address can be
calculated with scalar type and broadcast.
I have a followup optimization that tries to convert gather/scatter with
uniform memory access to scalar load/store + broadcast (and select if
needed). With this optimization, we can remove this temporary change.
This patch is preparation for #149955 to prevent regressions.
Extract ManualCodegen blocks from riscv_vector.td to dedicated helper
functions in RISCV.cpp to improve compilation times and code
organization.
This refactoring:
- Reduces riscv_vector_builtin_cg.inc from ~70,000 lines to ~30,000
lines
- Extracts lots of ManualCodegen blocks into helper functions in
RISCV.cpp
- Moves complex code generation logic from TableGen to C++
- Marks extracted functions with LLVM_ATTRIBUTE_NOINLINE to prevent
excessive inlining in EmitRISCVBuiltinExpr's large switch statement,
which would cause compilation time to increase significantly
Performance Impact on AMD Ryzen 9 3950X 16-Core with SSD (Release build)
with GCC 11:
Before: real 1m4.560s, user 0m0.529s, sys 0m0.175s
After: real 0m22.577s, user 0m0.498s, sys 0m0.152s
Which reduced around 65% of compilation time.
During this refactoring, I also found few more opportunities to optimize
and simplify the code generation logic, but I think leave to next PR
since it already change a lot of code.
Fix#88368
Increase promote-alloca-to-vector-max-regs to 32 from 16.
This restores default promotion of 16 x double which was disabled by
#127973.
Fixes SWDEV-525817.
…st class"
This reverts commit 234e075c1dbdaacd2e1b4199ae983f5c4439223c.
I'm reverting this because the ASAN build fails running the
TestMiniDumpUUID.py test. This happens because the pointer is already
freed before the call to `RemoveIfOrpahaned`. The ModuleList
implementation never actually dereferences the pointer, so it worked
correctly, but the new map implementation does dereference it, hence the
crash.
Jump tables may contain entries that point immediately past the end of
their parent function. Normally, such entries are generated by the
compiler as a result of builtin_unreachable() case. We used to replace
those entries with a label belonging to their parent function assuming
the destination doesn't matter if it's an undefined behavior.
However, if such entry is at the end of the jump table, it could be a
real function pointer, not a jump table entry. We rely on heuristics to
detect such cases and can drop the trailing function pointer entries
from the table.
The problem presents when the "unreachable" ambiguous entry is followed
by another ambiguous entry corresponding to the start of the parent
function. In this case we accept pointers as entries and may incorrectly
update the function pointer.
The solution is to keep ambiguous "unreachable" jump table entries
identical to the original input, i.e. point to the same function. This
change does not affect CFG, but results in the entries being updated
with the new function address if it gets relocated.
This changes a bunch of places which use getAs<TagType>, including
derived types, just to obtain the tag definition.
This is preparation for #155028, offloading all the changes that PR used
to introduce which don't depend on any new helpers.
This PR adopts JSONTransport in the MCP server implementation. It
required a slight change in design in the relationship between the two
server classes. Previously, these two had an "is-a" connection, while
now they have a "has-a" connection.
The "generic" protocol server in Protocol/MCP now operates using a
single connection (Transport). This matches the design in DAP where each
DAP instance has its own connection. The protocol server in Plugins
still supports multiple clients and creates a new server instance for
each connection.
I believe the new design makes sense in the long term (as proved by DAP)
and allows us to make the server stateful if we choose to do so. There's
no reason that multiple client support can't live in the generic
protocol library, but for now I kept it in ProtocolServerMCP to avoid
creating unnecessary abstractions.
This is a reland of #155034 but with significant changes to the tests.
The unit tests now test the generic server implementation, which matches
the original intent. This also means the test are now single threaded
and therefore fully deterministic using the MainLoop.
This pr implements the functionality of `rootsig-define` as described
[here](https://github.com/llvm/wg-hlsl/blob/main/proposals/0029-root-signature-driver-options.md#option--rootsig-define).
This is accomplished by:
- Defining the `fdx-rootsignature-define`, and `rootsig-define` alias,
driver options. It simply specifies the name of a macro that will expand
to a `LiteralString` to be interpreted as a root signature.
- Introduces a new general frontend action wrapper,
`HLSLFrontendAction`. This class allows us to introduce `HLSL` specific
behaviour on the underlying action (primarily `ASTFrontendAction`).
Which will be further extended, or modularly wrapped, when considering
future DXC options.
- Using `HLSLFrontendAction` we can add a new `PPCallback` that will
eagerly parse the root signature specified with `rootsig-define` and
push it as a `TopLevelDecl` to `Sema`. This occurs when the macro has
been lexed.
- Since the root signature is parsed early, before any function
declarations, we can then simply attach it to the entry function once it
is encountered. Overwriting any applicable root signature attrs.
Resolves https://github.com/llvm/llvm-project/issues/150274
##### Implementation considerations
To implement this feature, note that:
1. We need access to all defined macros. These are created as part of
the first `Lex` in `Parser::Initialize` after `PP->EnterMainSourceFile`
2. `RootSignatureDecl` must be added to `Sema` before
`Consumer->HandleTranslationUnit` is invoked in `ParseAST`
Therefore, we can't handle the root signature in
`HLSLFrontendAction::ExecuteAction` before (from 1.) or after (from 2.)
invoking the underlying `ASTFrontendAction`.
This means we could alternatively:
- Manually handle this case
[here](ac8f0bb070/clang/lib/Parse/ParseAST.cpp (L168))
before parsing the first top level decl.
- Hook into when we [return the entry function
decl](ac8f0bb070/clang/lib/Parse/Parser.cpp (L1190))
and then parse the root signature and override its `RootSignatureAttr`.
The proposed solution handles this in the most modular way which should
work on any `FrontendAction` that might use the `Parser` without
invoking `ParseAST`, and, is not subject to needing to call the hook in
multiple different places of function declarators.
This reverts commit 769155912787941edd32f91ef9acd7493ba64f14.
This took out at least three buildbots. Reverting until I can figure out what
is going on.
This pseudo-instruction emits a local `bl` writing LR, so that must be
saved and restored for the function to return to the right place. If
not, we'll return to the inline `.long` that the `bl` stepped over.
This fixes the `SIGILL` seen in rayon-rs/rayon#1268.
This test case matches against python traceback output, which seems to
vary slightly between versions. This relaxes the constraints a bit to
make the test pass on buildbots.
Given we are trying to deprecate %T and remove it, we also need to
remove it from the substitutions within compiler-rt. This is the last
remaining upstream user.
This slightly increases the complexity of using these substitutions
because now you need to create/cd into a %t.dir (specifically named
that) at the beginning of the directory, but I'm not sure that's more
knowledge than what was needed before to write a test using this
substitution. These tests also definitely were not race safe previously.
Most tests are either compfailing or runfailing.
They should start passing once we start using ATTACH map-type based
codegen. (#153683)
Even after they start passing, there are a few places where the EXPECTED
and actual CHECKs are different, due to two main issues:
* use_device_ptr translation on `&p[0]` is not succeeding in looking-up
a previously mapped `&p[1]`
* privatization of byref use_device_addr operands is not happening
correctly.
The above should be fixed as separate standalone changes.
This patch fixes:
clang/tools/libclang/CXIndexDataConsumer.cpp:1235:11: error:
enumeration value 'IncludeDirective' not handled in switch
[-Werror,-Wswitch]
The early exit we relied on to only invoke test updaters for failing
tests requires that there was no output to stdout or stderr, and that
timeouts weren't enabled. When these conditions weren't fulfilled, test
updaters would be invoked even on passing or XFAILed tests.
This patch is refactoring Root Parameter Header in DX Container backend
to remove the usage of `to_underlying`. This requires some changes:
first, MC Root Signature should not depend on Object/DXContainer.h;
Second, we need to assume data to be valid in scenarios where it was
originally not expected, this made some tests be removed.
The `getDefSrcRegIgnoringCopies` method in GlobalISel Utils crashed when
the first operand of the input instruction was not a register, e.g.,
the `INLINEASM` instruction has a non-register first operand.
---------
Co-authored-by: Matt Arsenault <arsenm2@gmail.com>
This is so that we don't expand to include unneeded 0 checks.
Also fix the logic error in LegalizerInfo so it is NOT legal on Thumb1
in Fast-ISEL.
Finally, Remove the README entry regarding this issue.