[libcxx] Fix xsgetn in basic_filebuf (#167779)
The optimized version of xsgetn for basic_filebuf added in #165223 has
an issue where if the reads come from both the buffer and the
filesystem it returns the wrong number of characters. This patch should
address the issue.
[lldb] Add a gtest matcher for lldb_private::Value (#167427)
This commit adds a new `ValueMatcher` class that can be used in gtest
matching contexts to match against `lldb_private::Value` objects. We
always match against the values `value_type` and `context_type`. For
HostAddress values we will also match against the expected host buffer
contents. For Scalar, FileAddress, and LoadAddress values we match
against an expected Scalar value.
The matcher is used to improve the quality of the tests in the
`DwarfExpressionTest.cpp` file. Previously, the local `Evaluate`
function would return an `Expected<Scalar>` value which makes it hard to
verify that we actually get a Value of the expected type without adding
custom evaluation code. Now we return an `Expected<Value>` so that we
can match against the full value contents.
The resulting change improves the quality of the existing checks and in
some cases eliminates the need for special code to explicitly check
value types.
[3 lines not shown]
[GISel][AArch64] Create emitCMP instead of cloning a virtual register (NFC) (#155262)
CMN also has a function like this, we should do the same with CMP.
[InstrRef] Consistently use MLocTracker::getLocID() before calling lookupOrTrackRegister (#167841)
The LocID for registers is just the register ID. The getLocID function
is supposed to hide this detail, but it wasn't being used consistently.
This avoids a bunch of implicit casts from Register or MCRegister to
unsigned.
[ADT] Simplify SmallDenseMap::grow (NFC) (#167829)
Without this patch, SmallDenseMap::grow has two separate code paths to
grow the bucket array. The code path to handle the small mode has its
own traversal over the bucket array. This patch simplifies this logic
as follows:
1. Allocate a temporary instance of SmallDenseMap.
2. Move valid key/value pairs to the temporary instance.
3. Move LargeRep to *this.
Remarks:
- This patch adds moveFromImpl to move key/value pairs.
moveFromOldBuckets is updated to use the new helper function.
- This patch adds a private constructor to SmallDenseMap that takes an
exact number of buckets, accompanied by tag ExactBucketCount.
[6 lines not shown]
[AArch64][SVE] Allow basic use of `target("aarch64.svcount")` with +sve (#167875)
This prevents the backend from crashing for basic uses of __SVCount_t
type (e.g., as function arguments), without +sve2p1 or +sme2.
Fixes #167462
[compiler-rt][ARM] Optimized mulsf3 and divsf3 (#161546)
This commit adds optimized assembly versions of single-precision float
multiplication and division. Both functions are implemented in a style
that can be assembled as either of Arm and Thumb2; for multiplication, a
separate implementation is provided for Thumb1. Also, extensive new
tests are added for multiplication and division.
These implementations can be removed from the build by defining the
cmake variable COMPILER_RT_ARM_OPTIMIZED_FP=OFF.
Outlying parts of the functionality which are not on the fast path, such
as NaN handling and underflow, are handled in helper functions written
in C. These can be shared between the Arm/Thumb2 and Thumb1
implementations, and also reused by other optimized assembly functions
we hope to add in future.
[LV] Update LoopVectorizationPlanner::emitInvalidCostRemarks to handle reduction plans (#165913)
The TypeSwitch for extracting the Opcode now handles the `VPReductionRecipe` case.
Fixes #165359.
[NFC][TableGen] Adopt CodeGenHelpers in SubtargetEmitter (#163820)
- Adopt ifdef and namespace emitters in SubtargeEmitter.
- To aid that, factor out emission of different sections of the code
into individual helper functions.
[flang][NFC] Strip trailing whitespace from tests (4 of N)
Only the fortran source files in flang/test/Intrinsics have been modified. The
other files in flang/test will be cleaned up in subsequent commits
[offload] defer "---> olInit" trace message (#167893)
Tracing requires liboffload to be initialized, so calling
isTracingEnabled() before olInit always returns false. This caused the
first trace log to look like:
```
-> OL_SUCCESS
```
instead of:
```
---> olInit() -> OL_SUCCESS
```
This patch moves the pre-call trace print for olInit so it is emitted
only after initialization.
It would be possible to add extra logic to detect whether liboffload is
already initialized and only postpone the first pre-call print, but this
would add unnecessary complexity, especially since this is tablegen
code. The difference would matter only in the unlikely case of a crash
[4 lines not shown]
Reapply "[X86] Remove Redundant memset Calls"
This reverts commit acb798eb5108f838f5beb1eae5a3738c53599a8a.
It turns out the memset calls were papering over the fact that the
arrays being used were not initialized rather than papering over a
valgrind issue. Move the initialization to the actual member to keep
things simpler and to be more consistent with the rest of LLVM.
[mlir] Use llvm::make_pointer_range (NFC) (#167833)
llvm::map_range(..., [](OpOperand &o) { return &o; })
is equivalent to llvm::make_pointer_range, and the latter is shorter.
[Flang][OpenMP] Update declare mapper lookup via use-module (#163860)
- Implemented semantic TODO to catch undeclared mappers.
- Fix mapper lookup to include modules imported through USE.
- Update and add tests.
Fixes #163385.
[PowerPC] fold i128 equality/inequality compares of two loads into a vectorized compare using vcmpequb.p when Altivec is available (#158657)
The patch add 16 bytes load size for function
PPCTTIImpl::enableMemCmpExpansion and fold i128 equality/inequality
compares of two loads into a vectorized compare using vcmpequb.p when
Altivec is available.
Rationale:
A scalar i128 SETCC (eq/ne) normally lowers to multiple scalar ops. On
VSX-capable subtargets, we can instead reinterpret the i128 loads as
v16i8 vectors and use the Altive vcmpequb.p instruction to perform a
full 128-bit equality check in a single vector compare.
Example Result:
This transformation replaces memcmp(a, b, 16) with two vector loads and
one vector compare instruction.
Revert "[lldb][NFC] Mark ValueObject library with NO_PLUGIN_DEPENDENCIES" (#167886)
Reverts llvm/llvm-project#167794
This breaks a build with BUILD_SHARED_LIBS=ON:
/usr/bin/ld: lib/liblldbCommands.a(CommandObjectTarget.cpp.o): undefined
reference to symbol '_ZN5clang22PCHContainerOperationsC1Ev
Fixing that issue leads to similar failures due to different symbols.
[Scalar] Fix warnings
This patch fixes:
llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp:689:45:
error: lambda capture 'DT' is not used
[-Werror,-Wunused-lambda-capture]
llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp:584:1:
error: unused function 'operator<<' [-Werror,-Wunused-function]
[lldb] Add libstdcpp initializer_list formatter (#167515)
Make the existing libc++ formatter generic
Add initializer_list summary provider.
Add test for `libstdcpp`
[TableGen][NFCI] Change TableGenMain() to take function_ref.
It was switched from a function pointer to std::function in
TableGen: Make 2nd arg MainFn of TableGenMain(argv0, MainFn) optional.
f675ec6165ab6add5e57cd43a2e9fa1a9bc21d81
but there's no mention of any particular reason for that.