platform/upstream/llvm.git
22 months ago[mlir][llvm] Modernize LLVM instruction and global import (NFC).
Tobias Gysi [Fri, 9 Dec 2022 10:31:53 +0000 (11:31 +0100)]
[mlir][llvm] Modernize LLVM instruction and global import (NFC).

Modernize the import of LLVMIR instructions and global variables.
Use longer variable names, factor out code used to import call or
invoke instructions, use the CPP builders for importing branch
instructions, etc. The revision is a preparation for a follow up
revision that moves the import code to implement improved error
handling.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D139404

22 months ago[SimplifyCFG] Prohibit hoisting of llvm.deoptimize calls
Dmitry Makogon [Tue, 6 Dec 2022 16:18:48 +0000 (23:18 +0700)]
[SimplifyCFG] Prohibit hoisting of llvm.deoptimize calls

This prohibits hoisiting identical llvm.deoptimize calls
from 'then' and 'else' blocks of a conditional branch.
This fixes a crash that happened because we didn't hoist
the return instructions together with the llvm.deoptimize calls,
so the verifier would crash.

Differential Revision: https://reviews.llvm.org/D139437

22 months ago[Test] Reduce deopt bundle in test with hoisted llvm.deoptimize call
Dmitry Makogon [Fri, 9 Dec 2022 10:36:03 +0000 (17:36 +0700)]
[Test] Reduce deopt bundle in test with hoisted llvm.deoptimize call

22 months ago[X86] Regenerate fastcc-byval.ll with visible stack math
Simon Pilgrim [Fri, 9 Dec 2022 10:40:49 +0000 (10:40 +0000)]
[X86] Regenerate fastcc-byval.ll with visible stack math

Allows us to truly see the diff in D138899

22 months ago[X86] Regenerate fastcc-byval.ll
Simon Pilgrim [Fri, 9 Dec 2022 10:37:03 +0000 (10:37 +0000)]
[X86] Regenerate fastcc-byval.ll

Allows us to truly see the diff in D138899

22 months ago[AArch64] Lower READCYCLECOUNTER using MRS CNTVCT_EL0
Salvatore Dipietro [Fri, 9 Dec 2022 10:36:16 +0000 (10:36 +0000)]
[AArch64] Lower READCYCLECOUNTER using MRS CNTVCT_EL0

As suggested in D12425 it would be better for the readcyclecounter
function on ARM architecture to use the CNTVCT_EL0 register
(Counter-timer Virtual Count register) instead of the PMCCNTR_EL0
(Performance Monitors Cycle Count Register) because the PMCCNTR_EL0 is a
PMU register which, depending on the configuration, it might always
return zeroes and it doesn't guaranteed to always be increased.

Differential Revision: https://reviews.llvm.org/D136999

22 months ago[MemoryBuiltins] Drop ReallocLike type (NFC)
Nikita Popov [Fri, 9 Dec 2022 10:35:20 +0000 (11:35 +0100)]
[MemoryBuiltins] Drop ReallocLike type (NFC)

All realloc style functions have been migrated to use allocator
attributes, so we no longer need to check for this.

22 months ago[MemoryBuiltins] Remove some hardcoded builtins
Nikita Popov [Fri, 9 Dec 2022 10:28:11 +0000 (11:28 +0100)]
[MemoryBuiltins] Remove some hardcoded builtins

For all of these we already infer the new memory attributes, so
they don't need to be explicitly listed.

22 months agoAdapt lldb to use StringRef for option storage
serge-sans-paille [Fri, 9 Dec 2022 10:20:37 +0000 (11:20 +0100)]
Adapt lldb to use StringRef for option storage

As a consequence to 138942c833b3baa12d19216797efca6d4dd010d2
This fixes lldb build https://lab.llvm.org/buildbot/#/builders/83/builds/26991

22 months ago[Alignment] Use Align in MCStreamer::emitCommonSymbol
Guillaume Chatelet [Thu, 8 Dec 2022 09:53:35 +0000 (09:53 +0000)]
[Alignment] Use Align in MCStreamer::emitCommonSymbol

Next patch after D139548 and D139439. Same expectations, the change seems safe with as far as llvm goes, we cannot check downstream implementations.

Differential Revision: https://reviews.llvm.org/D139614

22 months ago[IndVars] Use symbolic max block exit count to handle the last iter
Max Kazantsev [Fri, 9 Dec 2022 10:05:33 +0000 (17:05 +0700)]
[IndVars] Use symbolic max block exit count to handle the last iter

Old logic: when loop symbolic max exit count matched *exact* block exit count,
assume that all subsequent blocks will do 1 iteration less.

New logic: when loop symbolic max exit count matched *symbolic max* block exit count,
assume that all subsequent blocks will do 1 iteration less.

The new logic is still legal and is more permissive in situations when exact
block exit count is not known.

Differential Revision: https://reviews.llvm.org/D139692
Reviewed By: nikic

22 months ago[Docs] Update PatFrag definition in documentation
Luke Lau [Fri, 9 Dec 2022 09:55:35 +0000 (09:55 +0000)]
[Docs] Update PatFrag definition in documentation

The old definition for store was outdated.

Differential Revision: https://reviews.llvm.org/D139531

22 months ago[AsmParser] Check that addrspace fits within 24 bits
Luke Lau [Fri, 9 Dec 2022 09:52:31 +0000 (09:52 +0000)]
[AsmParser] Check that addrspace fits within 24 bits

Address spaces equal or larger than 1 << 24 don't fit and produce an
assertion during debug builds, or worse in release. This causes an error
to be reported during parsing instead.

Differential Revision: https://reviews.llvm.org/D139528

22 months ago[Clang] improve grammar in warn_utf8_symbol_homoglyph diagnostic
Corentin Jabot [Fri, 9 Dec 2022 09:42:43 +0000 (10:42 +0100)]
[Clang] improve grammar in warn_utf8_symbol_homoglyph diagnostic

22 months ago[NFC] Rename variables in optimizeLoopExits
Max Kazantsev [Fri, 9 Dec 2022 09:14:19 +0000 (16:14 +0700)]
[NFC] Rename variables in optimizeLoopExits

22 months ago[GISel] Rework trunc/shl combine in a generic trunc/shift combine
Pierre van Houtryve [Mon, 24 Oct 2022 08:48:57 +0000 (08:48 +0000)]
[GISel] Rework trunc/shl combine in a generic trunc/shift combine

This combine only handled left shifts, but now it can handle right shifts as well. It handles right shifts conservatively and only truncates them to the size returned by TLI.

AMDGPU benefits from always lowering shifts to 32 bits for instance, but AArch64 would rather keep them at 64 bits.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D136319

22 months agoRevert D139098 "[Alignment] Use Align for ObjectFile::getSectionAlignment"
Guillaume Chatelet [Fri, 9 Dec 2022 09:44:01 +0000 (09:44 +0000)]
Revert D139098 "[Alignment] Use Align for ObjectFile::getSectionAlignment"

This breaks lld.

This reverts commit 10c47465e2505ddfee4e62a2ab2e535abea3ec56.

22 months agoRecommit of 8ae18303f97d5dcfaecc90b4d87effb2011ed82e - part 2
serge-sans-paille [Sun, 4 Dec 2022 08:33:14 +0000 (09:33 +0100)]
Recommit of 8ae18303f97d5dcfaecc90b4d87effb2011ed82e - part 2

Differential Revision: https://reviews.llvm.org/D139274

22 months ago[PtrAuth] Use default attributes for some ptrauth intrinsics
Nikita Popov [Mon, 7 Nov 2022 16:22:14 +0000 (17:22 +0100)]
[PtrAuth] Use default attributes for some ptrauth intrinsics

This uses the default intrinsic attributes (nofree, nosync,
nocallback, willreturn) for a subset of the ptrauth intrinsics.
Notably, this does not use them for auth and resign, because these
intrinsics are specified to trap and as such are not willreturn.
As far as I understood, the remaining intrinsics may not trap
(or can only trap in cases where behavior is undefined).

Differential Revision: https://reviews.llvm.org/D137557

22 months ago[mlir] Support llvm.readonly attribute on llvm pointers
Guray Ozen [Thu, 8 Dec 2022 16:59:22 +0000 (17:59 +0100)]
[mlir] Support llvm.readonly attribute on llvm pointers

The attribute is translated into LLVM's function attribute 'readonly'. The attribute can be only used for pointers.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D139641

22 months ago[Alignment] Use Align for ObjectFile::getSectionAlignment
Guillaume Chatelet [Thu, 1 Dec 2022 12:34:21 +0000 (12:34 +0000)]
[Alignment] Use Align for ObjectFile::getSectionAlignment

Differential Revision: https://reviews.llvm.org/D139098

22 months ago[BOLT] Fix blocks layout reverse iterators
Vladislav Khmelevsky [Thu, 8 Dec 2022 10:06:39 +0000 (14:06 +0400)]
[BOLT] Fix blocks layout reverse iterators

Use container's reverse iterators, fix iterators types.

Reviewed By: Amir

Differential Revision: https://reviews.llvm.org/D139335

22 months agoImplement CWG2631
Corentin Jabot [Sun, 23 Oct 2022 15:32:58 +0000 (17:32 +0200)]
Implement CWG2631

Implement https://cplusplus.github.io/CWG/issues/2631.html.

Immediate calls in default arguments and defaults members
are not evaluated.

Instead, we evaluate them when constructing a
`CXXDefaultArgExpr`/`BuildCXXDefaultInitExpr`.

The immediate calls are executed by doing a
transform on the initializing expression.

Note that lambdas are not considering subexpressions so
we do not need to transform them.

As a result of this patch, unused default member
initializers are not considered odr-used, and
errors about members binding to local variables
in an outer scope only surface at the point
where a constructor is defined.

Reviewed By: aaron.ballman, #clang-language-wg

Differential Revision: https://reviews.llvm.org/D136554

22 months ago[Precommit][RISCV] Test for unsupported extensions in llvm-objdump
Elena Lepilkina [Wed, 7 Dec 2022 06:42:24 +0000 (09:42 +0300)]
[Precommit][RISCV] Test for unsupported extensions in llvm-objdump

Precommit for https://reviews.llvm.org/D139553

22 months agoRevert "Recommit of 8ae18303f97d5dcfaecc90b4d87effb2011ed82e - part 2"
serge-sans-paille [Fri, 9 Dec 2022 09:15:41 +0000 (10:15 +0100)]
Revert "Recommit of 8ae18303f97d5dcfaecc90b4d87effb2011ed82e - part 2"

This reverts commit 4faf00006cf989f3ae212912994022c0486a2dc4.

22 months ago[flang] Lower intrinsics to HLFIR part 1
Jean Perier [Fri, 9 Dec 2022 09:09:35 +0000 (10:09 +0100)]
[flang] Lower intrinsics to HLFIR part 1

This patch adds support for lowering intrinsics that have no dynamic
optionality aspects to handle and that requires argument to be lowered
to value, addr, or box.

It uses the current intrinsic lowering framework that can be re-used in
HLFIR to start with. HLFIR operations for charater/transformational
intrinsics will be added as needed from an optimization point of view.
The current approach will still create temporary variables for their
value directly in lowering.

Later patch will still need to add:
- support for dynamically optional arguments
- inquires
- "moving" the in memory computation of character and transformational
intrinsics to hlfir.expr. This is not needed from a semantic point of
view, but will help optimizing and will probably be required inside
hlfir.elemental returning characters so that the returned element
type is an hlfir.expr and match the result type of later hlfir.apply.

Differential Revision: https://reviews.llvm.org/D139613

22 months agoRecommit of 8ae18303f97d5dcfaecc90b4d87effb2011ed82e - part 2
serge-sans-paille [Thu, 8 Dec 2022 21:04:39 +0000 (22:04 +0100)]
Recommit of 8ae18303f97d5dcfaecc90b4d87effb2011ed82e - part 2

Differential Revision: https://reviews.llvm.org/D139274

22 months ago[AArch64] Extending lowering of 'zext <Y x i8> %x to <Y x i8X>' to use tbl instructions
Nilanjana Basu [Mon, 28 Nov 2022 03:45:34 +0000 (09:15 +0530)]
[AArch64] Extending lowering of 'zext <Y x i8> %x to <Y x i8X>' to use tbl instructions

Adding support for ZExt lowering for destination types beyond the existing support for (8|16) x i32

Patch for lowering zext instructions to 'tbl' for (8|16)xi8 -> (8|16)xi32 conversions in https://reviews.llvm.org/D120571 is extended to support zext to 'tbl' lowering for Y x i8 to Y x i8X where X > 2 and X < 8, that is, any number of vector elements & any destination element type whose size is a multiple of 8 and lies between 16 & 64 is allowed for this transformation.

Related microbenchmarks are in https://reviews.llvm.org/D136274 & https://reviews.llvm.org/D138059

Differential Revision: https://reviews.llvm.org/D136722

22 months ago[AArch64] Unit test for zext lowering for different types of vectors
Nilanjana Basu [Fri, 2 Dec 2022 18:45:57 +0000 (00:15 +0530)]
[AArch64] Unit test for zext lowering for different types of vectors

These are unit tests for code generated for zext lowering of vectors.
There are tests for different types of vectors, as well as cases where multiple 'zext' instructions of same type occur back-to-back.
Testing of Global-ISel path is added.
This will help in comparing changes in zext lowering in https://reviews.llvm.org/D136722.

Reviewed By: fhahn

Differential Revision: https://reviews.llvm.org/D137993

22 months ago[flang] Generate iteration shape from passed object
Valentin Clement [Fri, 9 Dec 2022 08:18:14 +0000 (09:18 +0100)]
[flang] Generate iteration shape from passed object

When call an elemental subroutine with a monomorphic or polymorphic
passed object, the iteration shape could not be computed. Use the
passed object to infer the implicit iteration shape so the loop
can be constructed.

Reviewed By: PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D139635

22 months ago[LangRef] Fix typo (NFC)
Nikita Popov [Fri, 9 Dec 2022 07:47:00 +0000 (08:47 +0100)]
[LangRef] Fix typo (NFC)

22 months ago[clang] Don't including None.h (NFC)
Kazu Hirata [Fri, 9 Dec 2022 07:36:50 +0000 (23:36 -0800)]
[clang] Don't including None.h (NFC)

These source files no longer use None, so they do not need to include
None.h.

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

22 months ago[llvm] Use std::nullopt instead of None in comments (NFC)
Kazu Hirata [Fri, 9 Dec 2022 07:21:59 +0000 (23:21 -0800)]
[llvm] Use std::nullopt instead of None in comments (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

22 months agoMark test lld/test/MachO/fat-arch.s updated in e54cfa4 to require aarch64.
Douglas Yung [Fri, 9 Dec 2022 06:41:45 +0000 (22:41 -0800)]
Mark test lld/test/MachO/fat-arch.s updated in e54cfa4 to require aarch64.

22 months ago[clang] Use std::nullopt instead of None in comments (NFC)
Kazu Hirata [Fri, 9 Dec 2022 06:43:11 +0000 (22:43 -0800)]
[clang] Use std::nullopt instead of None in comments (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

22 months ago[AARCH64][CostModel] Modified the cost of mask vector load/store
liqinweng [Fri, 9 Dec 2022 04:45:42 +0000 (12:45 +0800)]
[AARCH64][CostModel] Modified the cost of mask vector load/store

Reviewed By: david-arm

Differential Revision: https://reviews.llvm.org/D134413

22 months ago[mlir] Fix examples build
Jeff Niu [Fri, 9 Dec 2022 05:32:26 +0000 (21:32 -0800)]
[mlir] Fix examples build

Missing two extra parameters.

22 months ago[AAPointerInfo] rearrange code in preparation for further changes
Sameer Sahasrabuddhe [Fri, 9 Dec 2022 05:28:28 +0000 (10:58 +0530)]
[AAPointerInfo] rearrange code in preparation for further changes

AAPointerInfoFloating::updateImpl
  Move the member function definition out of its class before modifying it.

translateAndAddState
  Split the function definition into two along the FromCallee boolean argument.

handleAccess
  This should only be called when Size is not known. In other cases, replaced
  with a direct call to addAccess.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D138645

22 months ago[mlir][ods] Add I8 and I16 cases to BitEnumAttr
Jeff Niu [Thu, 8 Dec 2022 19:51:36 +0000 (11:51 -0800)]
[mlir][ods] Add I8 and I16 cases to BitEnumAttr

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D139664

22 months agoRevert "Reland "[pgo] Avoid introducing relocations by using private alias""
Paul Kirth [Fri, 9 Dec 2022 04:28:43 +0000 (04:28 +0000)]
Revert "Reland "[pgo] Avoid introducing relocations by using private alias""

This reverts commit e89e8dcfad364d23515de25ac87d26dfe25badbb.

Some configurations still have references to discarded sections. I'm
reverting until these can be addressed.

22 months ago[libTooling] Add flag to getRangeForEdit to ignore macro expansions
Eric Li [Thu, 8 Dec 2022 22:01:53 +0000 (17:01 -0500)]
[libTooling] Add flag to getRangeForEdit to ignore macro expansions

This commit resolves the FIXME around the behavior of
`Lexer::makeFileCharRange` that `getRangeForEdit` inherits around
source locations in macro expansions.

We add a flag to `getRangeForEdit` that allows a caller to disable the
behavior, and instead uses the spelling location instead, with checks
to ensure that the source locations are not within a macro definition.

Differential Revision: https://reviews.llvm.org/D139676

22 months ago[InstCombine] Add tests for udiv with shl-mul; NFC
Chenbing Zheng [Fri, 9 Dec 2022 03:18:31 +0000 (11:18 +0800)]
[InstCombine] Add tests for udiv with shl-mul; NFC

22 months ago[lld-macho] Fix bug in reading cpuSubType field.
Vy Nguyen [Wed, 7 Dec 2022 20:54:48 +0000 (15:54 -0500)]
[lld-macho] Fix bug in reading cpuSubType field.

Differential Revision: https://reviews.llvm.org/D139572

22 months ago[Bazel] Set HAVE_DLADDR in config.h
NAKAMURA Takumi [Fri, 9 Dec 2022 02:41:14 +0000 (11:41 +0900)]
[Bazel] Set HAVE_DLADDR in config.h

Corresponding to CMake change in llvmorg-16-init-13673-g138d53895734

22 months agoImprove error handling for invalid breakpoint `-t` and `-x` options.
Jordan Rupprecht [Fri, 9 Dec 2022 01:53:54 +0000 (17:53 -0800)]
Improve error handling for invalid breakpoint `-t` and `-x` options.

Breakpoint option `-t` checks that `option_arg` is empty by checking `option_arg[0] == '\0'`. This is unnecessary: the next two checks for comparing against "current" and calling `getAsInteger` already gracefully handle an empty StringRef. If the `option_arg` string is empty, this crashes (or triggers an assertion failure with asserts enabled). Also, this sets the thread id to `LLDB_INVALID_THREAD_ID` if the thread id is invalid -- it should just not set the thread id.

Likewise of `-x` which checks `option_arg[0] == '\n'` unnecessarily.

I believe both of these bugs are unreachable via normal LLDB usage, and are only accessible via the fuzzer -- most likely some other CLI parsing is trimming whitespace and rejecting empty inputs. Still, it doesn't hurt to simplify this bit.

22 months agoReland "[pgo] Avoid introducing relocations by using private alias"
Paul Kirth [Fri, 9 Dec 2022 00:28:37 +0000 (00:28 +0000)]
Reland "[pgo] Avoid introducing relocations by using private alias"

In many cases, we can use an alias to avoid a symbolic relocations,
instead of using the public, interposable symbol. When the instrumented
function is in a COMDAT, we can use a hidden alias, and still avoid
references to discarded sections.

This version makes the new runtime test a Linux only test.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D137982

22 months ago[LoongArch] Remove GlobalISel from the LINK_COMPONENTS list. NFC
Weining Lu [Fri, 9 Dec 2022 01:11:10 +0000 (09:11 +0800)]
[LoongArch] Remove GlobalISel from the LINK_COMPONENTS list. NFC

LoongArch doesn't use GlobalISel for now.

22 months ago[NFC] Fix leak handling breakpoint names.
Jordan Rupprecht [Fri, 9 Dec 2022 01:14:38 +0000 (17:14 -0800)]
[NFC] Fix leak handling breakpoint names.

The breakpoint list is a list of raw pointers. When breakpoints are removed, the memory is not deleted. Switch to unique pointers. I did some minor cleanup while making this change.

Found by the LLDB command interpreter fuzzer. The input is `br m G`.

22 months ago[gn build] Port 3b7af2796b3d
LLVM GN Syncbot [Fri, 9 Dec 2022 01:06:43 +0000 (01:06 +0000)]
[gn build] Port 3b7af2796b3d

22 months agoRevert "Revert "[-Wunsafe-buffer-usage] Initial commit - Transition away from raw...
Artem Dergachev [Fri, 9 Dec 2022 00:40:33 +0000 (16:40 -0800)]
Revert "Revert "[-Wunsafe-buffer-usage] Initial commit - Transition away from raw buffers.""

This reverts commit bc0617795f8bdcd5deab3e48b120107cc2833cdc.

Be more careful with #includes to avoid linker errors on some buildbots.

22 months ago[NFC] Fix leak in command options configuration.
Jordan Rupprecht [Fri, 9 Dec 2022 00:37:43 +0000 (16:37 -0800)]
[NFC] Fix leak in command options configuration.

`m_options.Append(new OptionPermissions())` leaks because the pointer passed in is not owned. Use a class member to ensure lifetime, which is the common pattern used for this API.

Found by the LLDB command interpreter fuzzer. The fuzz input is running `ap $` twice.

22 months ago[ModuleUtils][KCFI] Set !kcfi_type metadata for sanitizer constructors
Sami Tolvanen [Fri, 9 Dec 2022 00:06:36 +0000 (00:06 +0000)]
[ModuleUtils][KCFI] Set !kcfi_type metadata for sanitizer constructors

Set KCFI type metadata for the sanitizer constructors to prevent
runtime failures when these functions are indirectly called in
instrumented code. This fixes a compatibility issue with KASAN and
-fsanitize=kcfi in the Linux kernel.

Link: https://github.com/ClangBuiltLinux/linux/issues/1742
Reviewed By: nickdesaulniers, MaskRay

Differential Revision: https://reviews.llvm.org/D138945

22 months agoRevert "Reland "[pgo] Avoid introducing relocations by using private alias""
Paul Kirth [Fri, 9 Dec 2022 00:22:57 +0000 (00:22 +0000)]
Revert "Reland "[pgo] Avoid introducing relocations by using private alias""

This reverts commit 3cfaea2d499970c2fd14389ade59f792156be0f8.

The runtime test fails on Mac.

22 months ago[flang] Fix flang after MLIR update
Jeff Niu [Fri, 9 Dec 2022 00:22:06 +0000 (16:22 -0800)]
[flang] Fix flang after MLIR update

22 months ago[compiler-rt] Update build_symbolizer.sh to use -passes syntax
Roman Lebedev [Fri, 9 Dec 2022 00:07:36 +0000 (03:07 +0300)]
[compiler-rt] Update build_symbolizer.sh to use -passes syntax

22 months ago[CMake] Move dladdr check below _GNU_SOURCE check.
Daniel Thornburgh [Wed, 7 Dec 2022 00:22:24 +0000 (16:22 -0800)]
[CMake] Move dladdr check below _GNU_SOURCE check.

The presence of dladdr on Linux depends on whether or not _GNU_SOURCE is
set.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D139575

22 months agoadd floor library function
Joshua Batista [Thu, 8 Dec 2022 21:03:47 +0000 (13:03 -0800)]
add floor library function

This change exposes the floor library function for HLSL,
excluding long, int, and long long doubles.
Floor is supported for all scalar, vector, and matrix types.

Long and long long double support is missing in this patch because those types
don't exist in HLSL. Int is missing because the floor function only works on floating type arguments.

The full documentation of the HLSL floor function is available here:
https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-floor

Reviewed By: beanz

Differential Revision: https://reviews.llvm.org/D139137

22 months ago[mlir][sparse] reject kernels with non-sparsfiable reduction expression.
Peiming Liu [Thu, 8 Dec 2022 20:03:18 +0000 (20:03 +0000)]
[mlir][sparse] reject kernels with non-sparsfiable reduction expression.

To address https://github.com/llvm/llvm-project/issues/59394.

Reduction on negation of the output tensor is a non-sparsifiable kernel, it creates cyclic dependency.

This patch reject those cases instead of crashing.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D139659

22 months ago[ARM][AArch64] Some additional for bitcast splats. NFC
David Green [Thu, 8 Dec 2022 23:08:06 +0000 (23:08 +0000)]
[ARM][AArch64] Some additional for bitcast splats. NFC

22 months ago[NFC] Port one more codegen WinEH test to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 23:06:33 +0000 (02:06 +0300)]
[NFC] Port one more codegen WinEH test to `-passes=` syntax

22 months ago[NFC] Port last few Transforms tests to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 23:04:45 +0000 (02:04 +0300)]
[NFC] Port last few Transforms tests to `-passes=` syntax

22 months ago[NFC] Port last few Other tests to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 23:04:06 +0000 (02:04 +0300)]
[NFC] Port last few Other tests to `-passes=` syntax

22 months ago[NFC] Port all Verifier tests to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 23:03:37 +0000 (02:03 +0300)]
[NFC] Port all Verifier tests to `-passes=` syntax

22 months ago[NFC][asan] Guard implemetation with ASAN_INTERCEPT_SWAPCONTEXT
Vitaly Buka [Thu, 8 Dec 2022 22:52:00 +0000 (14:52 -0800)]
[NFC][asan] Guard implemetation with ASAN_INTERCEPT_SWAPCONTEXT

22 months agoRevert "[AMDGPU] Disable bool range metadata to workaround backend issue"
Yaxun (Sam) Liu [Thu, 8 Dec 2022 21:56:25 +0000 (16:56 -0500)]
Revert "[AMDGPU] Disable bool range metadata to workaround backend issue"

This reverts commit 107ee2613063183cb643cef97f0fad403508c9f0 to facilitate
investigating and fixing the root cause.

Differential Revision: https://reviews.llvm.org/D135269

22 months ago[NFC] Port codegen X86 tests that invoke opt to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:54:41 +0000 (00:54 +0300)]
[NFC] Port codegen X86 tests that invoke opt to `-passes=` syntax

22 months ago[NFC] Port codegen WinEH tests that invoke opt to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:54:41 +0000 (00:54 +0300)]
[NFC] Port codegen WinEH tests that invoke opt to `-passes=` syntax

22 months ago[NFC] Port codegen Thumb2 tests that invoke opt to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:54:40 +0000 (00:54 +0300)]
[NFC] Port codegen Thumb2 tests that invoke opt to `-passes=` syntax

22 months ago[NFC] Port codegen Thumb tests that invoke opt to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:54:40 +0000 (00:54 +0300)]
[NFC] Port codegen Thumb tests that invoke opt to `-passes=` syntax

22 months ago[NFC] Port codegen SystemZ tests that invoke opt to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:54:40 +0000 (00:54 +0300)]
[NFC] Port codegen SystemZ tests that invoke opt to `-passes=` syntax

22 months ago[NFC] Port codegen PowerPC tests that invoke opt to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:54:39 +0000 (00:54 +0300)]
[NFC] Port codegen PowerPC tests that invoke opt to `-passes=` syntax

22 months ago[NFC] Port codegen NVPTX tests that invoke opt to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:54:39 +0000 (00:54 +0300)]
[NFC] Port codegen NVPTX tests that invoke opt to `-passes=` syntax

22 months ago[NFC] Port codegen Generic tests that invoke opt to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:54:36 +0000 (00:54 +0300)]
[NFC] Port codegen Generic tests that invoke opt to `-passes=` syntax

22 months ago[NFC] Port codegen ARM tests that invoke opt to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:54:35 +0000 (00:54 +0300)]
[NFC] Port codegen ARM tests that invoke opt to `-passes=` syntax

22 months ago[NFC] Port codegen AMDGPU tests that invoke opt to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:54:35 +0000 (00:54 +0300)]
[NFC] Port codegen AMDGPU tests that invoke opt to `-passes=` syntax

22 months ago[NFC] Port codegen AArch64 tests that invoke opt to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:54:35 +0000 (00:54 +0300)]
[NFC] Port codegen AArch64 tests that invoke opt to `-passes=` syntax

22 months ago[NFC] Port all tools tests to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:52:21 +0000 (00:52 +0300)]
[NFC] Port all tools tests to `-passes=` syntax

22 months ago[NFC] Port all Verifier tests to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:52:21 +0000 (00:52 +0300)]
[NFC] Port all Verifier tests to `-passes=` syntax

22 months ago[NFC] Port all Other tests to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:51:45 +0000 (00:51 +0300)]
[NFC] Port all Other tests to `-passes=` syntax

22 months ago[NFC] Port all LTO tests to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:51:45 +0000 (00:51 +0300)]
[NFC] Port all LTO tests to `-passes=` syntax

22 months ago[NFC] Port all Feature tests to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:51:45 +0000 (00:51 +0300)]
[NFC] Port all Feature tests to `-passes=` syntax

22 months ago[NFC] Port all DebugInfo tests to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:51:01 +0000 (00:51 +0300)]
[NFC] Port all DebugInfo tests to `-passes=` syntax

22 months ago[NFC] Port all Bitcode tests to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:50:33 +0000 (00:50 +0300)]
[NFC] Port all Bitcode tests to `-passes=` syntax

22 months ago[NFC] Port all Analysis/ScalarEvolution tests to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:49:43 +0000 (00:49 +0300)]
[NFC] Port all Analysis/ScalarEvolution tests to `-passes=` syntax

22 months ago[NFC] Port all Analysis/MustExecute tests to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:49:42 +0000 (00:49 +0300)]
[NFC] Port all Analysis/MustExecute tests to `-passes=` syntax

22 months ago[NFC] Port all Analysis/MemorySSA tests to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:49:41 +0000 (00:49 +0300)]
[NFC] Port all Analysis/MemorySSA tests to `-passes=` syntax

22 months ago[NFC] Port all Analysis/LoopAccessAnalysis tests to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:49:40 +0000 (00:49 +0300)]
[NFC] Port all Analysis/LoopAccessAnalysis tests to `-passes=` syntax

22 months ago[NFC] Port all Analysis/LazyValueAnalysis tests to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:49:40 +0000 (00:49 +0300)]
[NFC] Port all Analysis/LazyValueAnalysis tests to `-passes=` syntax

22 months ago[NFC] Port all Analysis/GlobalsModRef tests to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:49:39 +0000 (00:49 +0300)]
[NFC] Port all Analysis/GlobalsModRef tests to `-passes=` syntax

22 months ago[NFC] Port all Analysis/Dominators tests to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:49:38 +0000 (00:49 +0300)]
[NFC] Port all Analysis/Dominators tests to `-passes=` syntax

22 months ago[NFC] Port all Analysis/CallGraph tests to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:49:36 +0000 (00:49 +0300)]
[NFC] Port all Analysis/CallGraph tests to `-passes=` syntax

22 months ago[NFC] Port all Analysis/AliasSet tests to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:49:35 +0000 (00:49 +0300)]
[NFC] Port all Analysis/AliasSet tests to `-passes=` syntax

22 months ago[lld-macho] Update -adhoc_codesign default
Keith Smiley [Thu, 8 Dec 2022 20:33:41 +0000 (12:33 -0800)]
[lld-macho] Update -adhoc_codesign default

With newer versions of ld64 it generates an adhoc signature by default
for all arm64 simulator targets. This default is especially important
for unit test targets that rarely have custom codesigning requirements
but otherwise won't run on arm64 macs.

Differential Revision: https://reviews.llvm.org/D139672

22 months ago[libc++][math.h] Add double overloads
Nikolas Klauser [Tue, 1 Nov 2022 21:29:57 +0000 (22:29 +0100)]
[libc++][math.h] Add double overloads

This allows libc++ to work with libcs that don't provide a proper math.h implementation.

Reviewed By: ldionne, #libc

Spies: aaron.ballman, fhahn, bcain, Izaron, libcxx-commits

Differential Revision: https://reviews.llvm.org/D138629

22 months agoscudo-standalone: Add GetRSS method on Linux
Bastian Kersting [Thu, 8 Dec 2022 20:22:42 +0000 (12:22 -0800)]
scudo-standalone: Add GetRSS method on Linux

This change adds a GetRSS method on Linux that parses
the number from /proc/self/statm. This change is part
of splitting up https://reviews.llvm.org/D126752.

Reviewed By: vitalybuka, cryptoad

Differential Revision: https://reviews.llvm.org/D139430

22 months ago[libc++] Move filter_view::iterator and sentinel out of filter_view
Nikolas Klauser [Sun, 4 Dec 2022 14:55:27 +0000 (15:55 +0100)]
[libc++] Move filter_view::iterator and sentinel out of filter_view

Reviewed By: ldionne, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D139273

22 months ago[OPENMP51]Codegen for error directive.
Jennifer Yu [Thu, 1 Dec 2022 23:54:35 +0000 (15:54 -0800)]
[OPENMP51]Codegen for error directive.

Added codegen for `omp error` directive.
This is to generate IR to call:
void __kmpc_error(ident_t *loc, int severity, const char *message);

Differential Revision: https://reviews.llvm.org/D139166

22 months agoReland "[pgo] Avoid introducing relocations by using private alias"
Paul Kirth [Thu, 8 Dec 2022 18:30:14 +0000 (18:30 +0000)]
Reland "[pgo] Avoid introducing relocations by using private alias"

In many cases, we can use an alias to avoid a symbolic relocations,
instead of using the public, interposable symbol. When the instrumented
function is in a COMDAT, we can use a hidden alias, and still avoid
references to discarded sections.

This disables the failing runtime test on Windows, since the compiler
options (-fPIC) are unsupported on that platform.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D137982

22 months agoutils/update_mir_test_checks.py: support UTC_ARGS
Gaëtan Bossu [Thu, 8 Dec 2022 20:50:02 +0000 (21:50 +0100)]
utils/update_mir_test_checks.py: support UTC_ARGS

As a reminder, UTC_ARGS is used by lit test cases to specify which
arguments need to be passed to update_XXXX_test_checks.py to be
auto-updated properly.

The support is achieved by relying on common.itertests, which is what
other test
updaters use to iterate over test files.

This commit also changes how the --llc-binary option is saved in args.
It used to be saved as "llc", but it is here changed to the standard
"llc_binary" to make use of an existing ignore mechanism for specific
arguments. Without that change, the option would not be ignored and
would appear in UTC_ARGS. This would be different from what e.g.
update_llc_test_checks does. As update_mir_test_checks.py now supports
UTC_ARGS, it became important to ensure the option is ignored.

Differential Revision: https://reviews.llvm.org/D135580

22 months ago[opt] Disincentivize new tests from using old pass syntax
Roman Lebedev [Thu, 8 Dec 2022 20:35:26 +0000 (23:35 +0300)]
[opt] Disincentivize new tests from using old pass syntax

Over the past day or so, i've took a large swing at our tests,
and reduced the number of tests that were still using the old syntax
from ~1800 to just 200.

Left to handle: (as it is seen in this patch)
* Transforms/LSR
* Transforms/CGP
* Transforms/TypePromotion
* Transforms/HardwareLoops
* Analysis/*
* some misc.

I think this is the right point to start actively refusing
to honor the old syntax, except for the old tests,
to prevent the old syntax from creeping back in.

Thus, let's add temporary default-off flag,
and if it is not passed refuse to accept old syntax.
The tests that still need porting are annotated with this flag.

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D139647