Currently the pattern would crash for rank 0 operand as it decides the
padding based on affine results, but for rank 0 there are no affine
results in the operand affine map
Signed-off-by: Nirvedh Meshram <nirvedh@gmail.com>
Without this patch, NumTagBits and MinTag use a recursive template Min
to compute Min.
This patch replaces Min with variadic std::min.
While I'm at it, this patch changes the type of NumTagBits to static
constexpr int.
Attempt to fix the Flang test target-private-implicit-scalar-map-2.f90 for SLES builds
as it is currently failing on the openmp-offload-sles-build-only bot, but seems fine
everywhere else so far.
As preparation for making lit use the internal shell by default in
clang-tools-extra (with significant expected performance gains), this
removes 'REQUIRES: shell' from the clang-tools-extra lit tests that have
it, and updates the one test that was not passing with
'LIT_USE_INTERNAL_SHELL=1' to now pass with the internal shell.
GCC defines these macros for both userspace and kernel address
sanitizers:
$ gcc -E -dM -fsanitize=address -x c /dev/null &| string match -er
SANITIZE
#define __SANITIZE_ADDRESS__ 1
$ gcc -E -dM -fsanitize=kernel-address -x c /dev/null &| string match
-er SANITIZE
#define __SANITIZE_ADDRESS__ 1
$ gcc -E -dM -fsanitize=hwaddress -x c /dev/null &| string match -er
SANITIZE
#define __SANITIZE_HWADDRESS__ 1
$ gcc -E -dM -fsanitize=kernel-hwaddress -x c /dev/null &| string match
-er SANITIZE
#define __SANITIZE_HWADDRESS__ 1
PR #153888 added these same defines for clang but only for the userspace
address sanitizers:
$ clang -E -dM -fsanitize=address -x c /dev/null &| string match -er
SANITIZE
#define __SANITIZE_ADDRESS__ 1
$ clang -E -dM -fsanitize=kernel-address -x c /dev/null &| string match
-er SANITIZE
$ clang -E -dM -fsanitize=hwaddress -x c /dev/null &| string match -er
SANITIZE
#define __SANITIZE_HWADDRESS__ 1
$ clang -E -dM -fsanitize=kernel-hwaddress -x c /dev/null &| string
match -er SANITIZE
Match GCC's behavior so that the Linux kernel can eventually drop its
own internal defines.
This is a step towards being able to easily report benchmark results to
a LNT instance. The LNT format can also be the basis for other tools to
perform A/B comparisons when doing experiments.
Tests can be at top-level or inside an anonymous namespace,
doesn't matter. But putting their helper code inside anonymous
namespaces both makes the code compatible with compiling using
-Wmissing-declarations and might let the compiler optimize the
test good a bit better.
Tests can be at top-level or inside an anonymous namespace,
doesn't matter. But putting their helper code inside anonymous
namespaces both makes the code compatible with compiling using
-Wmissing-declarations and might let the compiler optimize the
test good a bit better.
Since a temporary object lives until the end of the statement, it's safe
to pass such an object as a function argument without explicitly
creating a CheckedRef/CheckedPtr in stack.
Most of the unit tests don't (or don't need to) read/write libc_errno
code directly - it's cleared by the ErrnoCheckingTest harness, and is
verified by framework-provided scripts such as EXPECT_MATH_ERRNO.
Use the following rule of thumb for header inclusion:
* if you use libc_errno in code literally, include
src/__support/libc_errno.h
* if you only rely on errno constants, include hdr/errno_macros.h
This PR only updates a few tests for acos/asin variants, as a
proof-of-concept. If it goes in, a follow-up PR would update the rest.
The two API tests I converted to use yaml2macho-core were failing
on windows. I was writing the output corefile with fopen(filename,
"w"), and it turns out there was some newline conversion happening
on Windows if a linefeed character was present. Charles Zablit
helped to identify the issue and confirm the fix. Re-enabling the
two tests on all platforms.
https://github.com/llvm/llvm-project/pull/153911
When hitting a sanitizer breakpoint, LLDB currently displays the frame
in the sanitizer dylib (which we usually don't have debug-info for),
which isn't very helpful to the user. A more helpful frame to display
would be the first frame not in the sanitizer library (we have a
[similar heuristic when we trap inside
libc++](https://github.com/llvm/llvm-project/pull/108825)). This patch
does just that, by implementing the `GetSuggestedStackFrameIndex` API
Depends on https://github.com/llvm/llvm-project/pull/133078
In at least certain cases, notably when equivalence is used (at least
for the example this showed up as a problem in) we currently
miscategorize symbols as firstprivate when they may not be, as they can
throw a false positive when a use symbol from a mod file is picked up.
The fix to this is to chase up the appropriate symbol to access the
correct details.
The motivation for this patch is that
`StopInfo::GetSuggestedStackFrameIndex` would not take effect for
`InstrumentationRuntimeStopInfo` (which we plan to implement in
https://github.com/llvm/llvm-project/pull/133079). This was happening
because the instrumentation runtime plugins would run utility
expressions as part of the stop that would set the
`m_selected_frame_idx`. This means `SelectMostRelevantFrame` was never
called, and we would not be able to report the selected frame via the
`StopInfo` object.
This patch makes sure we clear the `m_selected_frame_idx` to allow
`GetSuggestedStackFrameIndex` to take effect, regardless of what the
frame recognizers choose to do.
Here is an example of TBAA attributes generated by Flang:
```
#tbaa_root = #llvm.tbaa_root<id = "Flang function root _QPtest6">
#tbaa_type_desc = #llvm.tbaa_type_desc<id = "any access", members = {<#tbaa_root, 0>}>
```
We have to process the text after `=` to replace the attribute
references with proper check variables.
In https://github.com/llvm/llvm-project/pull/94714, we add a python
function `apply_patterns_and_fold_greedily` which accepts an
`MlirModule` as the argument type. However, sometimes we want to apply
patterns with an `MlirOperation` argument, and there is currently no
python API to convert an `MlirOperation` to `MlirModule`.
So here we overload this function `apply_patterns_and_fold_greedily` to
do this (also a corresponding new C API
`mlirApplyPatternsAndFoldGreedilyWithOp`)
This patch adds support for atomic compare-and-swap operations,
including the following C/C++ instrinsics:
- `__atomic_compare_exchange`
- `__atomic_compare_exchange_n`
- `__c11_atomic_compare_exchange_strong`
- `__c11_atomic_compare_exchange_weak`
Some comments were "suffixed" to member variable declarations; these are
moved to before the variable.
Some constructors and operators were just defaulted and not necessary.
Some comments dividing the class into logical sections, like "//
constructors and destructors", were not applied everywhere. These were
removed. They are used in some parts of LLDB, but are the exception.
An include was not needed.
The operator != can be defined in terms of ==.
This pr implements the `only-section` option for a `DXContainer` object
in `llvm-objcopy`.
It extends the base `removeParts` of the minimal object representation
of a `DXContainerObject`.
This a pre-requisite step to implement
https://github.com/llvm/llvm-project/issues/150286 as a way to strip all
other information away.
Replace the existing `f16` test with the version that is uses for other
architectures (typically as `half.ll`). This still covers the
conversions from the existing test, but also adds checks for most simple
ops.
Additionally, rename `half-precision.ll` to `fp-intrinsics.ll` to keep
the name similar to this test.
Summary:
- `NoLintBlockToken` is too big: it stores a whole `NoLintToken` inside
itself, when all it needs from that `NoLintToken` is its `Pos` and
`ChecksGlob`.
- `formNoLintBlocks` builds up a vector of unmatched tokens, which are
later transformed into errors. We can skip the middle step and make
`formNoLintBlocks` create errors directly.
- In `generateCache`, the line `Cache[FileName] = ...;`
default-constructs a cache entry only to immediately overwrite it. We
can avoid that by using `Cache.try_emplace(FileName, ...);` instead.
- `NoLintToken`'s constructor takes `const std::optional<std::string>&`
when all it needs is `const std::optional<StringRef>&`. This forces its
caller, `getNoLints`, to create temporary strings.
- `NoLintToken::checks` returns `std::optional<std::string>` by value,
creating unnecessary copies in `formNoLintBlocks`.
Checking if trip-count exceeds 256 is no longer necessary, as we have
moved away from KnownBits computations to pattern-matching, which is
very cheap and independent of TC.
TargetRewrite is doing a shallow rewrite of function signatures. It is
only rewriting function definitions (FuncOp), calls (CallOp) and
AddressOfOp. It is not trying to visit each operations that may have an
operand with a function type.
It therefore needs function signature casts around the operations it is
rewriting.
Currently, these casts were not inserted after AddressOfOp rewrites
because lowering tends to always insert function cast after generating
AddressOfOp to the void type so the pass relied on implicitly updating
this cast operand type to get the required cast. This is brittle because
there is no guarantee such convert must be here and canonicalization and
passes may remove them.
Insert a cast after on the result of rewritten operations. If it is
redundant, it will be canonicalized away later.
Flakey on our Windows on Arm bot:
https://lab.llvm.org/buildbot/#/builders/141/builds/11378
======================================================================
ERROR: test_supported_capability_other_archs (TestDAP_stepInTargets.TestDAP_stepInTargets.test_supported_capability_other_archs)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\packages\Python\lldbsuite\test\lldbtest.py", line 2090, in tearDown
Base.tearDown(self)
File "C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\packages\Python\lldbsuite\test\lldbtest.py", line 1105, in tearDown
hook() # try the plain call and hope it works
^^^^^^
File "C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\packages\Python\lldbsuite\test\tools\lldb-dap\lldbdap_testcase.py", line 521, in cleanup
self.dap_server.terminate()
File "C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\packages\Python\lldbsuite\test\tools\lldb-dap\dap_server.py", line 1602, in terminate
raise DebugAdapterProcessError(process.returncode)
dap_server.DebugAdapterProcessError: lldb-dap returned non-zero exit status 1.
Config=aarch64-C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\bin\clang.exe
----------------------------------------------------------------------
See #137660
We need to account for AVX1 targets splitting 256-bit PMULUDQ style
patterns - we included a AVX2 cost, but missed out AVX1 despite v4i64
being a legal type
Noticed while working on #156568
We are checking the 'type' of 'pointer' before we are checking whether
it is null or not! This is clearly incorrect, so this patch reorders the
asserts.
If the user node of the SExt/ZExt node is a bitcast to a float point
type, the node itself should not be considered legal to demote, since
still the casting is required to match the size of the float point type.
Fixes#157277
Summary:
This operation is done every time we load a binary, this behavior should
be moved into OpenMP since it concerns an OpenMP specific data struct.
This is a little messy, because ideally we should only be using public
APIs, but more can be extracted later.