platform/upstream/llvm.git
3 years agoAMDGPU: Fix broken test
Matt Arsenault [Fri, 27 Aug 2021 02:04:13 +0000 (22:04 -0400)]
AMDGPU: Fix broken test

3 years ago[PowerPC][ELF] make sure local variable space does not overlap with parameter save...
Chen Zheng [Thu, 1 Jul 2021 09:41:03 +0000 (09:41 +0000)]
[PowerPC][ELF] make sure local variable space does not overlap with parameter save area

Reviewed By: jsji

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

3 years agoAMDGPU: Invert AMDGPUAttributor
Matt Arsenault [Wed, 11 Aug 2021 22:33:40 +0000 (18:33 -0400)]
AMDGPU: Invert AMDGPUAttributor

Switch to using BitIntegerState for each of the inputs, and invert
their meanings.

This now diverges more from the old AMDGPUAnnotateKernelFeatures, but
this isn't used yet anyway.

3 years agoAMDGPU: Fix broken check lines
Matt Arsenault [Sat, 14 Aug 2021 17:24:54 +0000 (13:24 -0400)]
AMDGPU: Fix broken check lines

3 years agoGlobalISel: Add CallBase to CallLoweringInfo
Matt Arsenault [Sat, 14 Aug 2021 19:58:17 +0000 (15:58 -0400)]
GlobalISel: Add CallBase to CallLoweringInfo

The DAG version has this, and is necessary for call lowering to take
advantage of any attributes at the call site.

3 years agoAMDGPU: Restrict attributor transforms
Matt Arsenault [Fri, 13 Aug 2021 18:20:00 +0000 (14:20 -0400)]
AMDGPU: Restrict attributor transforms

We only really want this to add the custom attributes. Theoretically
the regular transforms were already run at this point. Touching
undefined behavior breaks a lot of tests when this is enabled by
default, many of which are expecting to test handling of undef
operations.

3 years ago[libomptarget][NFC] Replaced obsolete name "getOrAllocTgtPtr" with new "getTargetPoin...
George Rokos [Fri, 27 Aug 2021 01:00:05 +0000 (18:00 -0700)]
[libomptarget][NFC] Replaced obsolete name "getOrAllocTgtPtr" with new "getTargetPointer" in debug messages.

3 years agoAMDGPU: Remove hacky attribute deduction from AMDGPUAttributor
Matt Arsenault [Wed, 11 Aug 2021 23:01:30 +0000 (19:01 -0400)]
AMDGPU: Remove hacky attribute deduction from AMDGPUAttributor

amdgpu-calls and amdgpu-stack-objects don't really belong as
attributes, and are currently a hacky way of passing an analysis into
the DAG. These don't really belong in the IR, and don't really fit in
with the other attributes. Remove these to facilitate inverting the
pass.

I don't exactly understand the indirect call test changes. These tests
are using calls which are trivially replacable with a direct call, so
I'm not sure what the point is.

3 years agoAMDGPU: Stop inferring use of llvm.amdgcn.kernarg.segment.ptr
Matt Arsenault [Sat, 14 Aug 2021 00:43:32 +0000 (20:43 -0400)]
AMDGPU: Stop inferring use of llvm.amdgcn.kernarg.segment.ptr

We no longer use this intrinsic outside of the backend and no longer
support using it outside of kernels.

3 years ago[WebAssembly] Fix PHI when relaying longjmps
Heejin Ahn [Thu, 26 Aug 2021 19:25:03 +0000 (12:25 -0700)]
[WebAssembly] Fix PHI when relaying longjmps

When doing Emscritpen EH, if SjLj is also enabled and used and if the
thrown exception has a possiblity being a longjmp instead of an
exception, we shouldn't swallow it; we should rethrow, or relay it. It
was done in D106525 and the code is here:
https://github.com/llvm/llvm-project/blob/8441a8eea8007b9eaaaabf76055949180a702d6d/llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp#L858-L898

Here is the pseudocode of that part: (copied from comments)
```
if (%__THREW__.val == 0 || %__THREW__.val == 1)
  goto %tail
else
  goto %longjmp.rethrow

longjmp.rethrow: ;; This is longjmp. Rethrow it
  %__threwValue.val = __threwValue
  emscripten_longjmp(%__THREW__.val, %__threwValue.val);

tail: ;; Nothing happened or an exception is thrown
  ... Continue exception handling ...
```

If the current BB (where the `invoke` is created) has successors that
has the current BB as its PHI incoming node, now that has to change to
`tail` in the pseudocode, because `tail` is the latest BB that is
connected with the next BB, but this was missing.

Reviewed By: tlively

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

3 years agoRemove set-but-unused variable
David Blaikie [Wed, 25 Aug 2021 19:03:53 +0000 (12:03 -0700)]
Remove set-but-unused variable

3 years ago[sanitizer] No THREADLOCAL in qsort and bsearch
Vitaly Buka [Thu, 26 Aug 2021 17:25:09 +0000 (10:25 -0700)]
[sanitizer] No THREADLOCAL in qsort and bsearch

qsort can reuse qsort_r if available.
bsearch always passes key as the first comparator argument, so we
can use it to wrap the original comparator.

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

3 years agoAMDGPU: Remove unnecessary -NEXT checks
Matt Arsenault [Sat, 14 Aug 2021 15:00:47 +0000 (11:00 -0400)]
AMDGPU: Remove unnecessary -NEXT checks

This avoids spuriously breaking the test in a future change

3 years agoAMDGPU: Fix amdgpu_gfx calling convention usage in test
Matt Arsenault [Sat, 14 Aug 2021 15:58:07 +0000 (11:58 -0400)]
AMDGPU: Fix amdgpu_gfx calling convention usage in test

This was calling a regular C function from amdgpu_gfx, which isn't
defined to have all of the necessary implicit arguments.

3 years ago[lld-macho][nfc] Clean up InputSection constructors
Jez Ng [Thu, 8 Jul 2021 16:31:37 +0000 (12:31 -0400)]
[lld-macho][nfc] Clean up InputSection constructors

3 years ago[CUDA] update constraints on NVPTX builtins to include PTX73 and 74.
Artem Belevich [Thu, 26 Aug 2021 23:00:18 +0000 (16:00 -0700)]
[CUDA] update constraints on NVPTX builtins to include PTX73 and 74.

3 years agoAMDGPU: Fix crashing on kernel declarations when lowering LDS
Matt Arsenault [Thu, 26 Aug 2021 21:41:33 +0000 (17:41 -0400)]
AMDGPU: Fix crashing on kernel declarations when lowering LDS

This was trying to insert the used marker into a declaration.

3 years ago[lld-macho] Have -ObjC load archive members before symbol resolution
Jez Ng [Thu, 26 Aug 2021 17:51:38 +0000 (13:51 -0400)]
[lld-macho] Have -ObjC load archive members before symbol resolution

This is what ld64 does. Deviating in behavior here can result
in some subtle duplicate symbol errors, as detailed in the objc.s test.

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

3 years ago[lld-macho] Refactor archive loading
Jez Ng [Thu, 26 Aug 2021 15:49:47 +0000 (11:49 -0400)]
[lld-macho] Refactor archive loading

The previous logic was duplicated between symbol-initiated
archive loads versus flag-initiated loads (i.e. `-force_load` and
`-ObjC`). This resulted in code duplication as well as redundant work --
we would create Archive instances twice whenever we had one of those
flags; once in `getArchiveMembers` and again when we constructed the
ArchiveFile.

This was motivated by an upcoming diff where we load archive members
containing ObjC-related symbols before loading those containing
ObjC-related sections, as well as before performing symbol resolution.
Without this refactor, it would be difficult to do that while avoiding
loading the same archive member twice.

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

3 years ago[lld-macho] Fix unwind info personality size
Jez Ng [Thu, 26 Aug 2021 02:46:48 +0000 (22:46 -0400)]
[lld-macho] Fix unwind info personality size

This was missed by {D107035}. This fix addresses the following warning:

  loop variable 'personality' has type 'const uint32_t &' (aka 'const unsigned int &') but is initialized with type 'const unsigned long long' resulting in a copy [-Wrange-loop-analysis]

In addition to fixing the size, I also removed the const reference,
since there's no performance benefit to avoiding copies of integer-sized
values.

3 years ago[mlir][spirv] Initial support for 64 bit index type and builtins
Butygin [Sat, 14 Aug 2021 08:57:02 +0000 (11:57 +0300)]
[mlir][spirv] Initial support for 64 bit index type and builtins

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

3 years ago[AST] Pick last tentative definition as the acting definition
Benson Chu [Sun, 15 Aug 2021 18:12:21 +0000 (13:12 -0500)]
[AST] Pick last tentative definition as the acting definition

Clang currently picks the second tentative definition when
VarDecl::getActingDefinition is called.

This can lead to attributes being dropped if they are attached to
tentative definitions that appear after the second one. This is
because VarDecl::getActingDefinition loops through VarDecl::redecls
assuming that the last tentative definition is the last element in the
iterator. However, it is the second element that would be the last
tentative definition.

This changeset modifies getActingDefinition to iterate through the
declaration chain in reverse, so that it can immediately return when
it encounters a tentative definition.

Originally the unit test for this changeset did not have a -triple
flag for the clang invocation, leading to this test being broken on
MacOS, since Mach-O does not support the section attribute.

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

3 years ago[clang][NewPM] Mention that legacy PM flags are deprecated
Arthur Eubanks [Thu, 26 Aug 2021 21:32:06 +0000 (14:32 -0700)]
[clang][NewPM] Mention that legacy PM flags are deprecated

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

3 years ago[DebugInfo] convert btf_tag attrs to DI annotations for func parameters
Yonghong Song [Thu, 26 Aug 2021 18:25:04 +0000 (11:25 -0700)]
[DebugInfo] convert btf_tag attrs to DI annotations for func parameters

Generate btf_tag annotations for DILocalVariable. The annotations
are represented as an DINodeArray in DebugInfo.

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

3 years ago[CMake] Change -DENABLE_EXPERIMENTAL_NEW_PASS_MANAGER=off to -DLLVM_ENABLE_NEW_PASS_M...
Fangrui Song [Thu, 26 Aug 2021 21:25:31 +0000 (14:25 -0700)]
[CMake] Change -DENABLE_EXPERIMENTAL_NEW_PASS_MANAGER=off to -DLLVM_ENABLE_NEW_PASS_MANAGER=off

LLVM_ENABLE_NEW_PASS_MANAGER is set to ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER, so
-DLLVM_ENABLE_NEW_PASS_MANAGER=off has no effect.

Change the cache variable to LLVM_ENABLE_NEW_PASS_MANAGER instead.
A user opting out the new PM needs to switch from
-DENABLE_EXPERIMENTAL_NEW_PASS_MANAGER=off to
-DLLVM_ENABLE_NEW_PASS_MANAGER=off.

Also give a warning that -DLLVM_ENABLE_NEW_PASS_MANAGER=off is deprecated.

Reviewed By: aeubanks, phosek

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

3 years ago[DebugInfo] generate btf_tag annotations for func parameters
Yonghong Song [Mon, 19 Jul 2021 16:11:10 +0000 (09:11 -0700)]
[DebugInfo] generate btf_tag annotations for func parameters

Generate btf_tag annotations for function parameters.
A field "annotations" is introduced to DILocalVariable, and
annotations are represented as an DINodeArray, similar to
DIComposite elements. The following example illustrates how
annotations are encoded in IR:
    distinct !DILocalVariable(name: "info",, arg: 1, ..., annotations: !10)
    !10 = !{!11, !12}
    !11 = !{!"btf_tag", !"a"}
    !12 = !{!"btf_tag", !"b"}

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

3 years ago[analyzer] Fix scan-build report deduplication.
Artem Dergachev [Thu, 26 Aug 2021 04:33:38 +0000 (21:33 -0700)]
[analyzer] Fix scan-build report deduplication.

The previous behavior was to deduplicate reports based on md5 of the
html file. This algorithm might have worked originally but right now
HTML reports contain information rich enough to make them virtually
always distinct which breaks deduplication entirely.

The new strategy is to (finally) take advantage of IssueHash - the
stable report identifier provided by clang that is the same if and only if
the reports are duplicates of each other.

Additionally, scan-build no longer performs deduplication on its own.
Instead, the report file name is now based on the issue hash,
and clang instances will silently refuse to produce a new html file
when a duplicate already exists. This eliminates the problem entirely.

The '-analyzer-config stable-report-filename' option is deprecated
because report filenames are no longer unstable. A new option is
introduced, '-analyzer-config verbose-report-filename', to produce
verbose file names that look similar to the old "stable" file names.
The old option acts as an alias to the new option.

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

3 years ago[asan] Implemented flag to emit intrinsics to optimize ASan callbacks.
Kirill Stoimenov [Thu, 19 Aug 2021 17:58:29 +0000 (17:58 +0000)]
[asan] Implemented flag to emit intrinsics to optimize ASan callbacks.

Reviewed By: vitalybuka

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

3 years ago[asan] Fixed a runtime crash.
Kirill Stoimenov [Thu, 26 Aug 2021 00:12:53 +0000 (00:12 +0000)]
[asan] Fixed a runtime crash.

Looks like the NoRegister has some effect on the final code that is generated. My guess is that some optimization kicks in at the end?

When I use -S to dump the assembly I get the correct version with 'shrq    $3, %r8':
        movq    %r9, %r8
        shrq    $3, %r8
        movsbl  2147450880(%r8), %r8d

But, when I disassemble the final binary I get RAX in stead of R8:
        mov    %r9,%r8
        shr    $0x3,%rax
        movsbl 0x7fff8000(%r8),%r8d

Reviewed By: vitalybuka

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

3 years ago[mlir][tosa] Tosa reverse to linalg supporting dynamic shapes
Rob Suderman [Thu, 26 Aug 2021 18:20:58 +0000 (11:20 -0700)]
[mlir][tosa] Tosa reverse to linalg supporting dynamic shapes

Needed to switch to extract to support tosa.reverse using dynamic shapes.

Reviewed By: NatashaKnk

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

3 years ago[SLP]Improve graph reordering.
Alexey Bataev [Tue, 3 Aug 2021 20:20:32 +0000 (13:20 -0700)]
[SLP]Improve graph reordering.

Reworked reordering algorithm. Originally, the compiler just tried to
detect the most common order in the reordarable nodes (loads, stores,
extractelements,extractvalues) and then fully rebuilding the graph in
the best order. This was not effecient, since it required an extra
memory and time for building/rebuilding tree, double the use of the
scheduling budget, which could lead to missing vectorization due to
exausted scheduling resources.

Patch provide 2-way approach for graph reodering problem. At first, all
reordering is done in-place, it doe not required tree
deleting/rebuilding, it just rotates the scalars/orders/reuses masks in
the graph node.

The first step (top-to bottom) rotates the whole graph, similarly to the previous
implementation. Compiler counts the number of the most used orders of
the graph nodes with the same vectorization factor and then rotates the
subgraph with the given vectorization factor to the most used order, if
it is not empty. Then repeats the same procedure for the subgraphs with
the smaller vectorization factor. We can do this because we still need
to reshuffle smaller subgraph when buildiong operands for the graph
nodes with lasrger vectorization factor, we can rotate just subgraph,
not the whole graph.

The second step (bottom-to-top) scans through the leaves and tries to
detect the users of the leaves which can be reordered. If the leaves can
be reorder in the best fashion, they are reordered and their user too.
It allows to remove double shuffles to the same ordering of the operands in
many cases and just reorder the user operations instead. Plus, it moves
the final shuffles closer to the top of the graph and in many cases
allows to remove extra shuffle because the same procedure is repeated
again and we can again merge some reordering masks and reorder user nodes
instead of the operands.

Also, patch improves cost model for gathering of loads, which improves
x264 benchmark in some cases.

Gives about +2% on AVX512 + LTO (more expected for AVX/AVX2) for {625,525}x264,
+3% for 508.namd, improves most of other benchmarks.
The compile and link time are almost the same, though in some cases it
should be better (we're not doing an extra instruction scheduling
anymore) + we may vectorize more code for the large basic blocks again
because of saving scheduling budget.

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

3 years ago[MergeICmps] Add test for call before first load (NFC)
Nikita Popov [Thu, 26 Aug 2021 19:12:11 +0000 (21:12 +0200)]
[MergeICmps] Add test for call before first load (NFC)

If a clobbering call happens before all loads, that shouldn't
block the transform.

3 years ago[test] Update precommit tests for D108734
Arthur Eubanks [Thu, 26 Aug 2021 19:05:56 +0000 (12:05 -0700)]
[test] Update precommit tests for D108734

3 years ago[sanitizer] Add basic qsort test
Vitaly Buka [Thu, 26 Aug 2021 19:02:45 +0000 (12:02 -0700)]
[sanitizer] Add basic qsort test

3 years ago[libomptarget][amdgpu][nfc] Rename variables, delete dead code
Jon Chesterfield [Thu, 26 Aug 2021 17:56:01 +0000 (18:56 +0100)]
[libomptarget][amdgpu][nfc] Rename variables, delete dead code

3 years agoRevert "[MCA][NFC] Remove redundant calls to std::move."
Andrea Di Biagio [Thu, 26 Aug 2021 18:53:17 +0000 (19:53 +0100)]
Revert "[MCA][NFC] Remove redundant calls to std::move."

This reverts commit 9cc0023fb863194be526f0bf19bd21e36236c5f6.
due to buildbot failures.

3 years ago[libc][NFC] Move the mutex implementation into a utility class.
Siva Chandra Reddy [Thu, 26 Aug 2021 05:21:54 +0000 (05:21 +0000)]
[libc][NFC] Move the mutex implementation into a utility class.

This allows others parts of the libc to use the mutex types without
actually pulling in public function implementations.

Along the way, few cleanups have been done, like using a uniform type to
refer the linux futex word.

Reviewed By: michaelrj

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

3 years ago[MCA][NFC] Remove redundant calls to std::move.
Andrea Di Biagio [Thu, 26 Aug 2021 18:43:18 +0000 (19:43 +0100)]
[MCA][NFC] Remove redundant calls to std::move.

This fixes some redundant move in return statement [-Wredundant-move] gcc 9.3.0
warnings.

This also fixes a minor coverity issue reported agaist class MCAOperand about
the lack of proper initialization for field Index.

No functional change intended.

3 years ago[AArch64][GlobalISel] Optimize G_BUILD_VECTOR of undef + 1 elt -> SUBREG_TO_REG
Jessica Paquette [Thu, 26 Aug 2021 18:04:17 +0000 (11:04 -0700)]
[AArch64][GlobalISel] Optimize G_BUILD_VECTOR of undef + 1 elt -> SUBREG_TO_REG

This pattern

```
%elt = ... something ...
%undef = G_IMPLICIT_DEF
%vec = G_BUILD_VECTOR %elt, %undef, %undef, ... %undef
```

Can be selected to a SUBREG_TO_REG, assuming `%elt` and `%vec` have the same
register bank. We don't care about any of the bits in `%vec` aside from those
in `%elt`, which just happens to be the 0th element.

This is preferable to emitting `mov` instructions for every index.

This gives minor code size improvements on the test suite at -Os.

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

3 years ago[docs, AMDGPU] Fix typo in dwarf register number mapping
RamNalamothu [Thu, 26 Aug 2021 18:24:15 +0000 (23:54 +0530)]
[docs, AMDGPU] Fix typo in dwarf register number mapping

Reviewed By: xgupta

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

3 years ago[docs] Update Getting Started with Visual Studio guide
Yaron Keren [Sat, 21 Aug 2021 17:59:45 +0000 (20:59 +0300)]
[docs] Update Getting Started with Visual Studio guide

Update this document for 2021.

Reviewed By: aaron.ballman, kuhnel, amccarth

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

3 years ago[mlir][tosa] Elementwise operation dynamic shape support
Rob Suderman [Thu, 26 Aug 2021 18:06:12 +0000 (11:06 -0700)]
[mlir][tosa] Elementwise operation dynamic shape support

Added dynamic shape support for elementwise operations. This assumes equal
sizes (broadcasting 1-length dynamic is problematic).

Reviewed By: NatashaKnk

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

3 years ago[libc++][NFC] Sort headers alphabetically
Louis Dionne [Thu, 26 Aug 2021 18:18:03 +0000 (14:18 -0400)]
[libc++][NFC] Sort headers alphabetically

3 years ago[LLDB] Add type to the output for FieldDecl when logging in ClangASTSource::layoutRec...
Shafik Yaghmour [Thu, 26 Aug 2021 18:11:00 +0000 (11:11 -0700)]
[LLDB] Add type to the output for FieldDecl when logging in ClangASTSource::layoutRecordType

I was debugging a problem and noticed that it would have been helpful to have
the type of each FieldDecl when looking at the output from
ClangASTSource::layoutRecordType.

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

3 years ago[MCA][RegisterFile] Consistently update the PRF in the presence of multiple writes...
Andrea Di Biagio [Thu, 26 Aug 2021 17:57:59 +0000 (18:57 +0100)]
[MCA][RegisterFile] Consistently update the PRF in the presence of multiple writes to the same register.

My last change to the RegisterFile (PR51495) has introduced a bug in the logic
that allocates physical registers in the PRF.

In some cases, this bug could have triggered a nasty unsigned wrap in the number
of allocated registers, thus resulting in mca being stuck forever in a loop of
PRF availability checks.

3 years ago[gn build] Port ee44dd8062a2
LLVM GN Syncbot [Thu, 26 Aug 2021 18:08:07 +0000 (18:08 +0000)]
[gn build] Port ee44dd8062a2

3 years ago[libc++] Implement the underlying mechanism for range adaptors
Louis Dionne [Wed, 11 Aug 2021 21:36:35 +0000 (17:36 -0400)]
[libc++] Implement the underlying mechanism for range adaptors

This patch implements the underlying mechanism for range adaptors. It
does so based on http://wg21.link/p2387, even though that paper hasn't
been adopted yet. In the future, if p2387 is adopted, it would suffice
to rename `__bind_back` to `std::bind_back` and `__range_adaptor_closure`
to `std::range_adaptor_closure` to implement that paper by the spec.

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

3 years ago[libc] add inttypes header
Michael Jones [Wed, 25 Aug 2021 21:11:31 +0000 (21:11 +0000)]
[libc] add inttypes header

Add inttypes.h to llvm libc. As its first functions strtoimax and
strtoumax are included.

Reviewed By: sivachandra

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

3 years ago[SLP][NFC]Add a test for correct shuffles order after reordering.
Alexey Bataev [Thu, 26 Aug 2021 17:35:31 +0000 (10:35 -0700)]
[SLP][NFC]Add a test for correct shuffles order after reordering.

3 years ago[DebugInfo] convert btf_tag attrs to DI annotations for DIGlobalVariable
Yonghong Song [Thu, 26 Aug 2021 16:44:14 +0000 (09:44 -0700)]
[DebugInfo] convert btf_tag attrs to DI annotations for DIGlobalVariable

Generate btf_tag annotations for DIGlobalVariable. The annotations
are represented as an DINodeArray in DebugInfo.

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

3 years ago[NFC] Removing deprecated intel-features test folder
Walter Erquinigo [Thu, 26 Aug 2021 17:35:29 +0000 (10:35 -0700)]
[NFC] Removing deprecated intel-features test folder

This folder has no valid tests anymore

3 years ago[GlobalOpt] add tests for constant expressions that can trap; NFC
Sanjay Patel [Thu, 26 Aug 2021 16:33:42 +0000 (12:33 -0400)]
[GlobalOpt] add tests for constant expressions that can trap; NFC

https://llvm.org/PR47578

3 years ago[NFC] Remove deprecated Intel PT test
Walter Erquinigo [Thu, 26 Aug 2021 17:34:04 +0000 (10:34 -0700)]
[NFC] Remove deprecated Intel PT test

3 years ago[libomptarget][amdgpu][nfc] Rename source files
Jon Chesterfield [Thu, 26 Aug 2021 16:36:04 +0000 (17:36 +0100)]
[libomptarget][amdgpu][nfc] Rename source files

3 years ago[libc++] Fix incorrect bypassing of <wctype.h>
Louis Dionne [Wed, 25 Aug 2021 16:27:20 +0000 (12:27 -0400)]
[libc++] Fix incorrect bypassing of <wctype.h>

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

3 years ago[NFC][sanitizer] Swap qsort_r and qsort code
Vitaly Buka [Thu, 26 Aug 2021 17:21:20 +0000 (10:21 -0700)]
[NFC][sanitizer] Swap qsort_r and qsort code

To simplify future review.

3 years ago[libc++] XFAIL align.pass.cpp for PowerPC LE
Louis Dionne [Thu, 26 Aug 2021 17:21:29 +0000 (13:21 -0400)]
[libc++] XFAIL align.pass.cpp for PowerPC LE

This patch XFAILs the `align.pass.cpp` for PowerPC (LE).

It appears that this test will fail on Power for the `LLIArr2` and `Padding` structs within the test,
as the `assert` for `alignof(AtomicImpl) >= sizeof(AtomicImpl)` will be false. In this case, these structs
presumably should not be lock-free, so we currently XFAIL this for now.

The failure was discovered after D97913 was committed. It looks like `alignof(AtomicImpl) < sizeof(AtomicImpl)`,
even prior to this commit, but this test began running on Power after D97913, whereas we were
not running `align.pass.cpp` before.

This patch addresses https://bugs.llvm.org/show_bug.cgi?id=51548 by temporarily XFAILing the test
in order to investigate it further.

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

3 years ago[RISCV] Insert a sext_inreg when type legalizing i32 shl by constant on RV64.
Craig Topper [Thu, 26 Aug 2021 16:33:53 +0000 (09:33 -0700)]
[RISCV] Insert a sext_inreg when type legalizing i32 shl by constant on RV64.

Similar to what we do for add/sub/mul.

This can help remove some sext.w. There are some regressions on
some bswap tests, but I have an idea how to fix that for a follow up.

A new PACKW pattern is added to handle the new sext_inreg placement.

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

3 years ago[CMake] Enable LLVM_ENABLE_PER_TARGET_RUNTIME_DIR by default on Linux
Fangrui Song [Thu, 26 Aug 2021 17:13:16 +0000 (10:13 -0700)]
[CMake] Enable LLVM_ENABLE_PER_TARGET_RUNTIME_DIR by default on Linux

This makes the default build closer to a -DLLVM_ENABLE_RUNTIMES=all build.
The layout is arguably superior because different libraries of target triples
are in different directories, similar to GCC/Debian multiarch.

When LLVM_DEFAULT_TARGET_TRIPLE is x86_64-unknown-linux-gnu,
`lib/clang/14.0.0/lib/libclang_rt.asan-x86_64.a`
becomes
`lib/clang/14.0.0/lib/x86_64-unknown-linux-gnu/libclang_rt.asan.a`.

Clang has been detecting both paths since 2018 (D50547).

---

Note: Darwin needs to be disabled. The hierarchy needs to be sorted out.
The current -DLLVM_DEFAULT_TARGET_TRIPLE=off state is like:
```
lib/clang/14.0.0/lib/darwin/libclang_rt.profile_ios.a
lib/clang/14.0.0/lib/darwin/libclang_rt.profile_iossim.a
lib/clang/14.0.0/lib/darwin/libclang_rt.profile_osx.a
```

Windows needs to be disabled: https://reviews.llvm.org/D107799?id=368557#2963311

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

3 years ago[DebugInfo] generate btf_tag annotations for DIGlobalVariable
Yonghong Song [Mon, 19 Jul 2021 16:33:55 +0000 (09:33 -0700)]
[DebugInfo] generate btf_tag annotations for DIGlobalVariable

Generate btf_tag annotations for DIGlobalVariable.
A field "annotations" is introduced to DIGlobalVariable, and
annotations are represented as an DINodeArray, similar to
DIComposite elements. The following example illustrates how
annotations are encoded in IR:
    distinct !DIGlobalVariable(..., annotations: !10)
    !10 = !{!11, !12}
    !11 = !{!"btf_tag", !"a"}
    !12 = !{!"btf_tag", !"b"}

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

3 years ago[DWARFLinker] Prefix debug section names with '.' in the comments. NFC.
RamNalamothu [Thu, 26 Aug 2021 16:54:06 +0000 (22:24 +0530)]
[DWARFLinker] Prefix debug section names with '.' in the comments. NFC.

In DWARFLinker.h, some comments prefix the debug section names
with '.' while others do not.

Reviewed By: dblaikie

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

3 years agoTypo fix; NFC
Aaron Ballman [Thu, 26 Aug 2021 16:53:52 +0000 (12:53 -0400)]
Typo fix; NFC

3 years agoAdding an assertion back.
Aaron Ballman [Thu, 26 Aug 2021 16:39:12 +0000 (12:39 -0400)]
Adding an assertion back.

This assert was removed in 98339f14a0420cdfbe4215d8d1bc0a01165e0495,
but during post-commit review, it was pointed out that the assert was
valid.

3 years ago[CodeExtractor] Making the arguments outlined easier to access from the outside
Andrew Litteken [Thu, 26 Aug 2021 15:24:34 +0000 (08:24 -0700)]
[CodeExtractor] Making the arguments outlined easier to access from the outside

The Code Extractor does not provide an easy mechanism for determining the
inputs and outputs after extraction has occurred, this patch gives the
ability to pass in empty SetVectors to be filled with the inputs and
outputs if they need to be analyzed.

Added Tests:
- InputOutputMonitoring in unittests/Transforms/Utils/CodeExtractorTests.cpp

Reviewers: paquette

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

3 years ago[Clang][RISCV] Implement getConstraintRegister for RISC-V
Luís Marques [Thu, 26 Aug 2021 16:43:06 +0000 (17:43 +0100)]
[Clang][RISCV] Implement getConstraintRegister for RISC-V

The getConstraintRegister method is used by semantic checking of inline
assembly statements in order to diagnose conflicts between clobber list
and input/output lists. By overriding getConstraintRegister we get those
diagnostics and we match RISC-V GCC's behavior. The implementation is
trivial due to the lack of single-register RISC-V-specific constraints.

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

3 years ago[AMDGPU] Invert partial vgpr to agpr spill lane order
Stanislav Mekhanoshin [Wed, 25 Aug 2021 21:02:38 +0000 (14:02 -0700)]
[AMDGPU] Invert partial vgpr to agpr spill lane order

On targets requiring VGPR alignment we may end up spilling an
unaligned register if we were partially spilled odd number of
leading lanes. The reminder will start with an odd register.

This problem is solved by inverting the order of lanes to
be spillied so that we start from the end.

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

3 years ago[SelectionDAG] Optimize bitreverse expansion to minimize the number of mask constants.
Craig Topper [Wed, 25 Aug 2021 22:28:06 +0000 (15:28 -0700)]
[SelectionDAG] Optimize bitreverse expansion to minimize the number of mask constants.

We can halve the number of mask constants by masking before shl
and after srl.

This can reduce the number of mov immediate or constant
materializations. Or reduce the number of constant pool loads
for X86 vectors.

I think we might be able to do something similar for bswap. I'll
look at it next.

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

3 years ago[gn build] Port 1076082a0d97
LLVM GN Syncbot [Thu, 26 Aug 2021 16:28:53 +0000 (16:28 +0000)]
[gn build] Port 1076082a0d97

3 years ago[libomptarget][amdgpu] Macro for accessing GPU variables from plugin
Jon Chesterfield [Thu, 26 Aug 2021 16:28:17 +0000 (17:28 +0100)]
[libomptarget][amdgpu] Macro for accessing GPU variables from plugin

Lets the amdgpu plugin write to omptarget_device_environment
to enable debugging. Intend to use in the near future to record the
wavesize that a given deviceRTL was compiled with for running on hardware
that supports 32 or 64.

Patch sets all the attributes that are useful. Notably .data means the variable
is set by writing to host memory before copying to the GPU instead of launching
a kernel to update the image. Can simplify the plugin slightly to drop the
code for patching after load if this is used consistently.

NFC on nvptx, cuda plugin seems to work fine without any annotations.

Reviewed By: jdoerfert

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

3 years ago[Support]: Introduce the `HashBuilder` interface.
Alexandre Rames [Tue, 10 Aug 2021 17:25:21 +0000 (10:25 -0700)]
[Support]: Introduce the `HashBuilder` interface.

The `HashBuilder` interface allows conveniently building hashes of various data
types, without relying on the underlying hasher type to know about hashed data
types.

Reviewed By: dexonsmith

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

3 years agoRevert "[SLP]Improve graph reordering."
Alexey Bataev [Thu, 26 Aug 2021 16:11:22 +0000 (09:11 -0700)]
Revert "[SLP]Improve graph reordering."

This reverts commit a28234e37af877b2b4a23c2091c27fa18c155f9a to
investigate a compiler crash caused by the commit.

3 years ago[analyzer] Extend the documentation of MallocOverflow
Balazs Benics [Thu, 26 Aug 2021 16:15:10 +0000 (18:15 +0200)]
[analyzer] Extend the documentation of MallocOverflow

Previously by following the documentation it was not immediately clear
what the capabilities of this checker are.

In this patch, I add some clarification on when does the checker issue a
report and what it's limitations are.
I'm also advertising suppressing such reports by adding an assertion, as
demonstrated by the test3().
I'm highlighting that this checker might produce an extensive amount of
findings, but it might be still useful for code audits.

Reviewed By: martong

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

3 years ago[IR] Remove addPseudoProbeAttribute (NFC)
Kazu Hirata [Thu, 26 Aug 2021 16:02:26 +0000 (09:02 -0700)]
[IR] Remove addPseudoProbeAttribute (NFC)

The last use was removed on Jun 17, 2021 in commit
bd52495518808bdbf24f4d8e9e20774d6d2e3333.

3 years ago[AArch64] provide strictfp attributes in test file
Simon Wallis [Thu, 26 Aug 2021 15:56:26 +0000 (16:56 +0100)]
[AArch64] provide strictfp attributes in test file

A post-commit review comment on  https://reviews.llvm.org/D107452 pointed out that
https://llvm.org/docs/LangRef.html
says:
"In a function that uses the constrained intrinsics the strictfp attribute is required on all function calls."

Although there are several files across several test directories which don't follow this guidance, it is straightforward to provide this attribute.

Reviewed By: kpn

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

3 years ago[DebugInfo] convert btf_tag attrs to DI annotations for DISubprograms
Yonghong Song [Thu, 26 Aug 2021 06:13:38 +0000 (23:13 -0700)]
[DebugInfo] convert btf_tag attrs to DI annotations for DISubprograms

Generate btf_tag annotations for DISubprograms. The annotations
are represented as an DINodeArray in DebugInfo.

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

3 years ago[X86][Codegen] PR51615: don't replace wide volatile load with narrow broadcast-from...
Roman Lebedev [Thu, 26 Aug 2021 15:40:00 +0000 (18:40 +0300)]
[X86][Codegen] PR51615: don't replace wide volatile load with narrow broadcast-from-memory

Even though https://bugs.llvm.org/show_bug.cgi?id=51615
appears to be introduced by D105390, the fix lies here.

We can not replace a wide volatile load with a broadcast-from-memory,
because that would narrow the load, which isn't legal for volatiles.

Reviewed By: spatel

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

3 years ago[ConstraintElimination] Rewrite tests to reduce verification complexity.
Florian Hahn [Thu, 26 Aug 2021 12:56:58 +0000 (13:56 +0100)]
[ConstraintElimination] Rewrite tests to reduce verification complexity.

This patch reduces the bitwidth of types certain tests operate and gets
rid of a number of @use(i1) calls and xor's the conditions together
instead, which eliminates all timeouts when verifying the tests.
See https://github.com/AliveToolkit/alive2/issues/744 for more details.

3 years ago[LoopPredication] Preserve MemorySSA
Anna Thomas [Wed, 25 Aug 2021 20:19:18 +0000 (16:19 -0400)]
[LoopPredication]  Preserve MemorySSA

Since LICM has now unconditionally moved to MemorySSA based form, all
passes that run in same LPM as LICM need to preserve MemorySSA (i.e. our
downstream pipeline).

Added loop-mssa to all tests and perform -verify-memoryssa within
LoopPredication itself.

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

3 years ago[libc++] Revert a use of `static_cast` for `_VSTD::forward`. NFCI.
Arthur O'Dwyer [Wed, 25 Aug 2021 23:40:03 +0000 (19:40 -0400)]
[libc++] Revert a use of `static_cast` for `_VSTD::forward`. NFCI.

As requested in D107584.

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

3 years ago[DebugInfo] generate btf_tag annotations for DISubprogram types
Yonghong Song [Mon, 19 Jul 2021 15:33:01 +0000 (08:33 -0700)]
[DebugInfo] generate btf_tag annotations for DISubprogram types

Generate btf_tag annotations for DISubprogram types.
A field "annotations" is introduced to DISubprogram, and
annotations are represented as an DINodeArray, similar to
DIComposite elements. The following example illustrates how
annotations are encoded in IR:
    distinct !DISubprogram(..., annotations: !10)
    !10 = !{!11, !12}
    !11 = !{!"btf_tag", !"a"}
    !12 = !{!"btf_tag", !"b"}

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

3 years ago[CGP] Fix the crash for combining address mode when having cyclic dependency
Andrew Wei [Thu, 26 Aug 2021 14:52:42 +0000 (22:52 +0800)]
[CGP] Fix the crash for combining address mode when having cyclic dependency

In the combination of addressing modes, when replacing the matched phi nodes,
sometimes the phi node to be replaced has been modified. For example,
there’s matcher set [A, B] and [C, A], which will have cyclic dependency:
A is replaced by B and C will be replaced by A. Because we tried to match new phi node
to another new phi node, we should ignore new phi nodes when mapping new phi node to old one.

Reviewed By: skatkov

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

3 years ago[AArch64] Lower fpto*i.sat intrinsics for NEON.
Jacob Bramley [Thu, 5 Aug 2021 12:36:05 +0000 (13:36 +0100)]
[AArch64] Lower fpto*i.sat intrinsics for NEON.

Following on from D102353, extend the fpto*i.sat intrinsics to use NEON
fcvt* instructions.

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

3 years ago[libc++][NFC] Fix typo in test/support/test_range.h
Joe Loser [Thu, 26 Aug 2021 14:34:35 +0000 (10:34 -0400)]
[libc++][NFC] Fix typo in test/support/test_range.h

Fix typo in `#error` filepath.

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

3 years ago[libc++][doc] Cleanup, normalize, and update projects status docs
Kent Ross [Thu, 26 Aug 2021 14:23:54 +0000 (10:23 -0400)]
[libc++][doc] Cleanup, normalize, and update projects status docs

Mark the now-done [cmp.result] in spaceship projects as complete;
normalize some status markers for papers and projects; fix alignment
and line breaks in spaceship projects, add links to standard

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

3 years ago[SLP]Improve graph reordering.
Alexey Bataev [Tue, 3 Aug 2021 20:20:32 +0000 (13:20 -0700)]
[SLP]Improve graph reordering.

Reworked reordering algorithm. Originally, the compiler just tried to
detect the most common order in the reordarable nodes (loads, stores,
extractelements,extractvalues) and then fully rebuilding the graph in
the best order. This was not effecient, since it required an extra
memory and time for building/rebuilding tree, double the use of the
scheduling budget, which could lead to missing vectorization due to
exausted scheduling resources.

Patch provide 2-way approach for graph reodering problem. At first, all
reordering is done in-place, it doe not required tree
deleting/rebuilding, it just rotates the scalars/orders/reuses masks in
the graph node.

The first step (top-to bottom) rotates the whole graph, similarly to the previous
implementation. Compiler counts the number of the most used orders of
the graph nodes with the same vectorization factor and then rotates the
subgraph with the given vectorization factor to the most used order, if
it is not empty. Then repeats the same procedure for the subgraphs with
the smaller vectorization factor. We can do this because we still need
to reshuffle smaller subgraph when buildiong operands for the graph
nodes with lasrger vectorization factor, we can rotate just subgraph,
not the whole graph.

The second step (bottom-to-top) scans through the leaves and tries to
detect the users of the leaves which can be reordered. If the leaves can
be reorder in the best fashion, they are reordered and their user too.
It allows to remove double shuffles to the same ordering of the operands in
many cases and just reorder the user operations instead. Plus, it moves
the final shuffles closer to the top of the graph and in many cases
allows to remove extra shuffle because the same procedure is repeated
again and we can again merge some reordering masks and reorder user nodes
instead of the operands.

Also, patch improves cost model for gathering of loads, which improves
x264 benchmark in some cases.

Gives about +2% on AVX512 + LTO (more expected for AVX/AVX2) for {625,525}x264,
+3% for 508.namd, improves most of other benchmarks.
The compile and link time are almost the same, though in some cases it
should be better (we're not doing an extra instruction scheduling
anymore) + we may vectorize more code for the large basic blocks again
because of saving scheduling budget.

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

3 years ago[libc++][doc] Repair files with CRLF line endings.
Kent Ross [Thu, 26 Aug 2021 14:08:59 +0000 (10:08 -0400)]
[libc++][doc] Repair files with CRLF line endings.

These are the only files in libc++ that have CRLF line endings instead of LF.

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

3 years ago[X86] getShape - don't dereference dyn_cast<>
Simon Pilgrim [Thu, 26 Aug 2021 12:17:27 +0000 (13:17 +0100)]
[X86] getShape - don't dereference dyn_cast<>

dyn_cast can return nullptr, use cast<> to assert we have the correct type.

3 years agoFix MSVC "result of 32-bit shift implicitly converted to 64 bits" warning. NFCI.
Simon Pilgrim [Thu, 26 Aug 2021 12:15:29 +0000 (13:15 +0100)]
Fix MSVC "result of 32-bit shift implicitly converted to 64 bits" warning. NFCI.

3 years agoRevert "[analyzer] Extend the documentation of MallocOverflow"
Balazs Benics [Thu, 26 Aug 2021 13:29:32 +0000 (15:29 +0200)]
Revert "[analyzer] Extend the documentation of MallocOverflow"

This reverts commit 6097a41924584b613153237d8e66e9660001ce7d.

3 years ago[analyzer] Extend the documentation of MallocOverflow
Balazs Benics [Thu, 26 Aug 2021 12:31:09 +0000 (14:31 +0200)]
[analyzer] Extend the documentation of MallocOverflow

Previously by following the documentation it was not immediately clear
what the capabilities of this checker are.

In this patch, I add some clarification on when does the checker issue a
report and what it's limitations are.
I'm also advertising suppressing such reports by adding an assertion, as
demonstrated by the test3().
I'm highlighting that this checker might produce an extensive amount of
findings, but it might be still useful for code audits.

Reviewed By: martong

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

3 years ago[LoopDataPrefetch] Add missed LoopSimplify dependence for prefetch pass
Andrew Wei [Thu, 26 Aug 2021 13:01:59 +0000 (21:01 +0800)]
[LoopDataPrefetch] Add missed LoopSimplify dependence for prefetch pass

SCEVExpander::expandCodeFor may expand add recurrences for loop with a preheader,
so we should make LoopDataPrefetch dependent on LoopSimplify.
This patch will try to fix : https://bugs.llvm.org/show_bug.cgi?id=43784

Reviewed By: Meinersbur

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

3 years ago[AMDGPU] Remove dead and broken ComplexPatterns
Jessica Clarke [Thu, 26 Aug 2021 11:48:29 +0000 (12:48 +0100)]
[AMDGPU] Remove dead and broken ComplexPatterns

SelectADDRParam was discovered as being dead 5 years ago and removed in
7b4ef068c6f5 but the unused ComplexPattern definition was left behind.
SelectADDRDWord has never existed as far as I can tell, even back when
AMDGPU was R600-only and called that.

Reviewed By: foad

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

3 years ago[SelectionDAG] Remove unused SDTConvertOp
Jessica Clarke [Thu, 26 Aug 2021 11:48:14 +0000 (12:48 +0100)]
[SelectionDAG] Remove unused SDTConvertOp

This was used by CONVERT_RNDSAT, which was removed in def496c04b0d, so
the profile is now unused.

Reviewed By: xgupta

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

3 years ago[X86][MCA] Address the latest issues with MULX reported in PR51495.
Andrea Di Biagio [Wed, 25 Aug 2021 20:34:35 +0000 (21:34 +0100)]
[X86][MCA] Address the latest issues with MULX reported in PR51495.

It turns out that SchedWrite WriteIMulH was always assigned to the low half of
the result of a MULX (rather than to the high half).

To avoid confusion, this patch swaps the two MULX writes in the tablegen
definition of MULX32/64.  That way, write names better describe what they
actually refer to; this also avoids further complications if in future we decide
to reuse the same MulH writes to also model other scalar integer multiply
instructions.  I also had to swap the latency values for the two MULX writes to
make sure that the change is effectively an NFC. In fact, none of the existing
x86 tests were affected by this small refactoring.

This patch also fixes a bug in MCA: a wrong latency value was propagated for
instructions that perform multiple writes to a same register.  This last issue
was found by Roman while testing MULX on targets that define a different latency
for the Low/High part of the result.

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

3 years ago[sanitizer] Fix build on FreeBSD RISC-V
Alex Richardson [Thu, 26 Aug 2021 10:11:56 +0000 (11:11 +0100)]
[sanitizer] Fix build on FreeBSD RISC-V

We have to avoid calling renameat2 and clone on FreeBSD.
Additionally, the mcontext structure has different members.

Reviewed By: jrtc27, luismarques

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

3 years agoAssert pointer cannot be null; NFC
Sindhu Chittireddy [Thu, 26 Aug 2021 10:58:56 +0000 (06:58 -0400)]
Assert pointer cannot be null; NFC

Klocwork static code analysis exposed this concern:
Pointer 'SubExpr' returned from call to getSubExpr() function which may
return NULL from 'cast_or_null<Expr>(Operand)', which will be
dereferenced in the statement following it

Add an assert on SubExpr to make it clear this pointer cannot be null.

3 years ago[AArch64][SVE] Teach cost model masked gathers/scatters are cheap
Matthew Devereau [Thu, 26 Aug 2021 10:08:03 +0000 (11:08 +0100)]
[AArch64][SVE] Teach cost model masked gathers/scatters are cheap

Tell the cost model to use the scalable calculation for non-neon fixed vector.
This results in a cheaper cost for fixed-length SVE masked gathers/scatters
allowing the vectorizor to emit them more frequently.

3 years ago[X86] Don't write to the source directory in test
Benjamin Kramer [Thu, 26 Aug 2021 10:11:02 +0000 (12:11 +0200)]
[X86] Don't write to the source directory in test

3 years agoThe maximal representable alignment in LLVM IR is 1GiB, not 512MiB
Roman Lebedev [Thu, 26 Aug 2021 08:51:28 +0000 (11:51 +0300)]
The maximal representable alignment in LLVM IR is 1GiB, not 512MiB

In LLVM IR, `AlignmentBitfieldElementT` is 5-bit wide
But that means that the maximal alignment exponent is `(1<<5)-2`,
which is `30`, not `29`. And indeed, alignment of `1073741824`
roundtrips IR serialization-deserialization.

While this doesn't seem all that important, this doubles
the maximal supported alignment from 512MiB to 1GiB,
and there's actually one noticeable use-case for that;
On X86, the huge pages can have sizes of 2MiB and 1GiB (!).

So while this doesn't add support for truly huge alignments,
which i think we can easily-ish do if wanted, i think this adds
zero-cost support for a not-trivially-dismissable case.

I don't believe we need any upgrade infrastructure,
and since we don't explicitly record the IR version,
we don't need to bump one either.

As @craig.topper speculates in D108661#2963519,
this might be an artificial limit imposed by the original implementation
of the `getAlignment()` functions.

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

3 years ago[libunwind] Don't include cet.h/immintrin.h unconditionally
Benjamin Kramer [Thu, 26 Aug 2021 09:37:07 +0000 (11:37 +0200)]
[libunwind] Don't include cet.h/immintrin.h unconditionally

These may not exist when CET isn't available.