platform/upstream/llvm.git
2 years ago[InstCombine] guard against splat-mul corner case
Sanjay Patel [Mon, 11 Apr 2022 19:44:57 +0000 (15:44 -0400)]
[InstCombine] guard against splat-mul corner case

The test is already simplified, and I'm not sure how
to write a test to exercise the new clause. But it
protects the 2-bit pattern from miscompiling as noted
in D123453.

https://alive2.llvm.org/ce/z/QPyVfv
(If we managed to fall into the mul transform, it
would wrongly create a zero on this pattern.)

2 years ago[MLIR][Presburger][Simplex] symbolic lexmin: add some normalization heuristics
Arjun P [Sun, 10 Apr 2022 20:09:13 +0000 (21:09 +0100)]
[MLIR][Presburger][Simplex] symbolic lexmin: add some normalization heuristics

Normalize some of the division and inequality expressions used,
which can improve performance. Also deduplicate some of the
normalization functionality throughout the Presburger library.

Reviewed By: Groverkss

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

2 years ago[lld-macho][nfc] Use includeInSymtab for all symtab-skipping logic
Jez Ng [Mon, 11 Apr 2022 19:45:25 +0000 (15:45 -0400)]
[lld-macho][nfc] Use includeInSymtab for all symtab-skipping logic

{D123302} got me looking deeper at `includeInSymtab`. I thought it was a
little odd that there were excluded (live) symbols for which
`includeInSymtab` was false; we shouldn't have so many different ways to
exclude a symbol. As such, this diff makes the `L`-prefixed-symbol
exclusion code use `includeInSymtab` too. (Note that as part of our
support for `__eh_frame`, we will also be excluding all `__eh_frame`
symbols from the symtab in a future diff.)

Another thing I noticed is that the `emitStabs` code never has to deal
with excluded symbols because `SymtabSection::finalize()` already
filters them out. As such, I've updated the comments and asserts from
{D123302} to reflect this.

Reviewed By: #lld-macho, thakis

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

2 years ago[MLIR][Presburger] subtract: fix bug in the non-recursive implementation
Arjun P [Sun, 10 Apr 2022 11:25:14 +0000 (12:25 +0100)]
[MLIR][Presburger] subtract: fix bug in the non-recursive implementation

When making the subtract implementation non-recursive, tail calls were
implemented by incrementing the level but not pushing a frame, and returning
was implemented as returning to the level corresponding to the number of frames in the stack.

This is incorrect, as there could be a case where we tail-recurse at `level`,
and then recurse at `level + 1`, pushing a frame. However, because the previous
frame was missing, this new frame would be interpreted as corresponding to
`level` and not `level + 1`. Fix this by removing the special handling of tail
calls and just doing them as normal recursion, as this is the simplest correct
implementation and handling them specifically would be a premature optimization.

The impact of this bug is only on performance as this can only lead to
unnecessary subtractions of the same disjuncts multiples times. As subtraction
is idempotent, and rationally empty disjuncts are always discarded, this
does not affect the output, so this patch does not include a regression test.
(This also does not affect termination.)

Reviewed By: Groverkss

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

2 years ago[Driver] Simplify hasFlag pattern with addOptInFlag/addOptOutFlag helpers
Fangrui Song [Mon, 11 Apr 2022 19:29:25 +0000 (12:29 -0700)]
[Driver] Simplify hasFlag pattern with addOptInFlag/addOptOutFlag helpers

Reviewed By: dexonsmith

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

2 years agoAMDGPU/SDAG: Custom SETCC (i.e. ballot) is always uniform
Nicolai Hähnle [Fri, 8 Apr 2022 15:52:13 +0000 (10:52 -0500)]
AMDGPU/SDAG: Custom SETCC (i.e. ballot) is always uniform

The AMDGPUISD::SETCC node is like ISD::SETCC, but returns a lane mask
instead of a per-lane boolean. The lane mask is uniform.

This improves instruction selection for code patterns like
ctpop(ballot(x)), which can now use an S_BCNT1_* instruction instead
of V_BCNT_*.

GlobalISel already selects scalar instructions (an earlier commit
added a test case)..

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

2 years ago[mlir][ods] ODS-level Attribute Optimizations
Mogball [Fri, 8 Apr 2022 16:41:31 +0000 (16:41 +0000)]
[mlir][ods] ODS-level Attribute Optimizations

This patch contains several ODS-level optimizations to attribute getters and getting.

1. OpAdaptors, when provided a DictionaryAttr, will instantiate an OperationName so that adaptor attribute getters can used cached identifiers.
2. Verifiers will take advantage of attributes stored in sorted order to get all required (non-optional, non-default valued, and non-derived) attributes in one pass over the attribute dictionary and verify that they are present.
3. ODS-generated attribute getters will use "subrange" lookup. Because the attributes are stored in sorted order and ODS knows which attributes are required, the number of required attributes less than and greater than each attribute can be computed. When searching for an attribute, the ends of the search range can be dropped.

Reviewed By: jpienaar

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

2 years ago[LoopUnroll] Always respect user unroll pragma
Whitney Tsang [Mon, 11 Apr 2022 17:52:34 +0000 (13:52 -0400)]
[LoopUnroll] Always respect user unroll pragma

IMO when user provide unroll pragma, compiler should always respect it.
It is not clear to me why loop unroll pass currently ensure that the
unrolled loop size is limited by PragmaUnrollThreshold.

Reviewed By: Meinersbur

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

2 years ago[clang][extract-api] Emit "functionSignature" in SGF for ObjC methods.
Daniel Grumberg [Thu, 7 Apr 2022 12:50:28 +0000 (13:50 +0100)]
[clang][extract-api] Emit "functionSignature" in SGF for ObjC methods.

- Split GlobalRecord into two distinct types to be able to introduce
has_function_signature type trait.
- Add has_function_signature type trait.
- Serialize function signatures as part of serializeAPIRecord for
records that are known to have a function signature.

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

2 years ago[libcxx] locale_bionic.h: skip ndk-version.h on Android platform
zijunzhao [Mon, 11 Apr 2022 17:09:34 +0000 (17:09 +0000)]
[libcxx] locale_bionic.h: skip ndk-version.h on Android platform

The Android platform does not have ndk-version.h, but it will always
have up-to-date libc headers, so it does not need any compatibility
code intended for past versions of NDK_MAJOR. If ndk-version.h is missing,
assume NDK_MAJOR is (conceptually) infinite

Bug: https://buganizer.corp.google.com/issues/222341313
Test: None

2 years ago[TableGen][NFC] Reflow Record accessor comments
Fraser Cormack [Mon, 11 Apr 2022 17:32:38 +0000 (18:32 +0100)]
[TableGen][NFC] Reflow Record accessor comments

2 years ago[TableGen][NFC] Fix copy/paste error in comment
Fraser Cormack [Mon, 11 Apr 2022 17:29:29 +0000 (18:29 +0100)]
[TableGen][NFC] Fix copy/paste error in comment

2 years ago[llvm-lib] Add /WX, warn by default on empty inputs, add opt-out
Nico Weber [Mon, 11 Apr 2022 15:01:34 +0000 (11:01 -0400)]
[llvm-lib] Add /WX, warn by default on empty inputs, add opt-out

lib.exe by default exits successfully without writing an output
file when no inputs are passed. llvm-lib has the same behavior,
for compatibility.

This behavior interacts poorly with build systems: If a static
library target had no inputs, llvm-lib would not produce an output
file, causing ninja (or make, or a similar system) to successfully
run that step, but then re-run it on the next build.

After this patch, llvm-lib emits a warning in this case, that with
/WX can be turned into an error. That way, ninja (or make, or...)
will mark the initial build as failed.

People who don't like the warning can use /ignore:emptyoutput to
suppress it.

The warning also points out the existing flag /llvmlibempty which
forces creation of an empty .lib file (this is an extension to lib.exe).

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

2 years ago[RISCV] Remove riscv-v-fixed-length-vector-elen-max command line option.
Craig Topper [Mon, 11 Apr 2022 17:02:05 +0000 (10:02 -0700)]
[RISCV] Remove riscv-v-fixed-length-vector-elen-max command line option.

This was added before Zve extensions were defined. I think users
should use Zve32x or Zve32f now. Though we will lose support for limiting
ELEN to 16 or 8, but I hope no one was using that.

Reviewed By: frasercrmck

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

2 years ago[RISCV] Remove ExtZvl enum from RISCVSubtarget. NFC
Craig Topper [Mon, 11 Apr 2022 17:01:16 +0000 (10:01 -0700)]
[RISCV] Remove ExtZvl enum from RISCVSubtarget. NFC

Having an enum with names that contain the string representation
of their value doesn't add any value. We can just use the numbers.

Reviewed By: kito-cheng, frasercrmck

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

2 years ago[lldb] Silence warnings about unused static variables in RegisterInfos_arm64.h
Martin Storsjö [Wed, 6 Apr 2022 11:13:54 +0000 (14:13 +0300)]
[lldb] Silence warnings about unused static variables in RegisterInfos_arm64.h

Move them to the only source file that included RegisterInfos_arm64.h
that actually used these variables.

This silences warnings like these:

    In file included from lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp:42:
    lldb/source/Plugins/Process/Utility/RegisterInfos_arm64.h:790:35: warning: ‘g_register_infos_mte’ defined but not used [-Wunused-variable]
      790 | static lldb_private::RegisterInfo g_register_infos_mte[] = {
          |                                   ^~~~~~~~~~~~~~~~~~~~
    lldb/source/Plugins/Process/Utility/RegisterInfos_arm64.h:787:35: warning: ‘g_register_infos_pauth’ defined but not used [-Wunused-variable]
      787 | static lldb_private::RegisterInfo g_register_infos_pauth[] = {
          |                                   ^~~~~~~~~~~~~~~~~~~~~~

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

2 years ago[TargetLowering][RISCV] Allow truncation when checking if the arguments of a setcc...
Craig Topper [Mon, 11 Apr 2022 16:37:41 +0000 (09:37 -0700)]
[TargetLowering][RISCV] Allow truncation when checking if the arguments of a setcc are splats.

We're just trying to canonicalize here and won't be using the constant
value returned.

The attached test changes are because we were previously commuting
a seteq X, (splat_vector 0) because we also have (sub 0, X). The
0 is larger than the element type so we don't detect it as a splat
without the AllowTruncation flag. By preventing the commute we are
able to match it to the vmseq.vx instruction during isel. We only
look for constants on the RHS in isel.

Reviewed By: spatel

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

2 years ago[libcxx] [test] Fix back-to-back use of get_temp_file_name() on Windows
Martin Storsjö [Mon, 28 Mar 2022 20:49:31 +0000 (23:49 +0300)]
[libcxx] [test] Fix back-to-back use of get_temp_file_name() on Windows

On non-Windows platforms, get_temp_file_name() uses `mkstemp()`,
which picks a unique name and creates a file atomically. The
Windows implementation uses `_mktemp_s()`, which doesn't create the
file. The documentation of `_mktemp_s()` also says that by design,
the function uses the same pattern within a process, as long as that
file doesn't exist.

Thus previously, two consecutive calls to `get_temp_file_name()`
on Windows returned the same file name.

Try to create the suggested temp file with `_O_EXCL` (marking the
file name as already used for future calls to `_mktemp_s`) and retry
if we weren't able to exclusively create the file.

This fixes the test failures on Windows observed in D122257.

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

2 years ago[libc++][NFC] Use noexcept instead of _NOEXCEPT for code compiled into the library
Louis Dionne [Mon, 11 Apr 2022 16:30:38 +0000 (12:30 -0400)]
[libc++][NFC] Use noexcept instead of _NOEXCEPT for code compiled into the library

We build the library with C++20 anyways, so we can use noexcept directly.

2 years ago[libc] Add a definition of pthread_attr_t and its getters and setters.
Siva Chandra Reddy [Fri, 8 Apr 2022 08:07:22 +0000 (08:07 +0000)]
[libc] Add a definition of pthread_attr_t and its getters and setters.

Not all attributes have been added to phtread_attr_t in this patch. They
will be added gradually in future patches.

Reviewed By: lntue

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

2 years ago[Dexter] Collate penalties of the same type into a single line for each
Stephen Tozer [Tue, 1 Mar 2022 13:20:51 +0000 (13:20 +0000)]
[Dexter] Collate penalties of the same type into a single line for each

Currently in Dexter, every step at which a DexExpectWatchValue/Type does
not have the correct value is printed on a separate line. This patch
reduces the size of the text output by instead printing each incorrect
result (i.e. each incorrect value seen, 'Variable optimized out', and so
on) on its own line, alongside a list of the steps at which that result
was seen. This makes for much less spam in the output when watches are
missing or wrong for many steps.

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

2 years ago[lld][macho]Fix test to sort symbol table before dumping
Vy Nguyen [Mon, 11 Apr 2022 15:58:31 +0000 (11:58 -0400)]
[lld][macho]Fix test to sort symbol table before dumping

Details: The test previously expected a specific order of those symbols, which is not guaranteed (could change simply due to hashing changes, etc).
So we change it to explicitly sort the symbols before checking contents.

PR/53026

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

2 years ago[InstCombine] try to fold low-mask of ashr to lshr
Sanjay Patel [Mon, 11 Apr 2022 15:16:11 +0000 (11:16 -0400)]
[InstCombine] try to fold low-mask of ashr to lshr

With one-use, we handle this via demanded-bits.
But We need to handle extra uses to improve issue #54750.

https://alive2.llvm.org/ce/z/aDYkPv

2 years ago[InstCombine] add tests for low-mask of ashr; NFC
Sanjay Patel [Mon, 11 Apr 2022 14:48:47 +0000 (10:48 -0400)]
[InstCombine] add tests for low-mask of ashr; NFC

2 years agoRevert "[LICM] Only create load in pre-header when promoting load."
Florian Hahn [Mon, 11 Apr 2022 15:37:23 +0000 (17:37 +0200)]
Revert "[LICM] Only create load in pre-header when promoting load."

This reverts commit 42229b96bf94ec896d5c62fa643d83ba96e86eea.

This appears to cause crashes on multiple bots.

2 years ago[clangd] Performance improvements and cleanup
Kadir Cetinkaya [Fri, 8 Apr 2022 07:56:43 +0000 (09:56 +0200)]
[clangd] Performance improvements and cleanup

- Inline SymbolID hashing to header
- Don't collect references for symbols without a SymbolID
- Store referenced symbols, rather than separately storing decls and
  macros.
- Don't defer ref collection to end of translation unit
- Perform const_cast when updating reference counts (~0.5% saving)
- Introduce caching for getSymbolID in SymbolCollector. (~30% saving)
- Don't modify symbolslab if there's no definition location
- Don't lex the whole file to deduce spelled tokens, just lex the
  relevant piece (~8%)

Overall this achieves ~38% reduction in time spent inside
SymbolCollector compared to baseline (on my machine :)).

I'd expect the last optimization to affect dynamic index a lot more, I
was testing with clangd-indexer on clangd subfolder of LLVM. As
clangd-indexer runs indexing of whole TU at once, we indeed see almost
every token from every source included in the TU (hence lexing full
files vs just lexing referenced tokens are almost the same), whereas
during dynamic indexing we mostly index main file symbols, but we would
touch the files defining/declaring those symbols, and lex complete files
for nothing, rather than just the token location.

The last optimization is also a functional change (added test),
previously we used raw tokens from syntax::tokenize, which didn't
canonicalize trigraphs/newlines in identifiers, wheres
Lexer::getSpelling canonicalizes them.

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

2 years ago[gn build] Port c292b6066cca
LLVM GN Syncbot [Mon, 11 Apr 2022 14:58:55 +0000 (14:58 +0000)]
[gn build] Port c292b6066cca

2 years ago[AMDGPU] Regenerate insert_vector_dynelt.ll
Simon Pilgrim [Mon, 11 Apr 2022 14:34:53 +0000 (15:34 +0100)]
[AMDGPU] Regenerate insert_vector_dynelt.ll

2 years ago[SimplifyLibCalls] Remove unnecessary inbounds check
Nikita Popov [Mon, 11 Apr 2022 14:46:26 +0000 (16:46 +0200)]
[SimplifyLibCalls] Remove unnecessary inbounds check

Even if the GEP is not inbounds, the GEP will have provenance of
the global, and accessing past the extent of the global would be
undefined behavior.

2 years ago[InstCombine] Add strlen of gep test without inbounds (NFC)
Nikita Popov [Mon, 11 Apr 2022 14:45:27 +0000 (16:45 +0200)]
[InstCombine] Add strlen of gep test without inbounds (NFC)

2 years ago[libc++] Implement P1007R3: std::assume_aligned
Louis Dionne [Thu, 3 Feb 2022 19:45:22 +0000 (14:45 -0500)]
[libc++] Implement P1007R3: std::assume_aligned

This supersedes and incoroporates content from both D108906 and D54966,
and also some original content.

Co-Authored-by: Marshall Clow <mclow.lists@gmail.com>
Co-Authored-by: Gonzalo Brito Gadeschi
Differential Revision: https://reviews.llvm.org/D118938

2 years ago[LICM] Only create load in pre-header when promoting load.
Florian Hahn [Mon, 11 Apr 2022 14:45:18 +0000 (16:45 +0200)]
[LICM] Only create load in pre-header when promoting load.

When only a store is sunk, there is no need to create a load in the
pre-header, as the result of the load will never get used.

The dead load can can introduce UB, if the function is marked as
writeonly.

Fixes #51248.

Reviewed By: nikic

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

2 years ago[libc++] Make .version.pass.cpp tests be compile-only tests
Louis Dionne [Mon, 11 Apr 2022 14:38:26 +0000 (10:38 -0400)]
[libc++] Make .version.pass.cpp tests be compile-only tests

We don't really need to run them.

2 years ago[MLIR][Presburger] Make PWMAFunction inheritence from space private
Groverkss [Mon, 11 Apr 2022 14:31:27 +0000 (20:01 +0530)]
[MLIR][Presburger] Make PWMAFunction inheritence from space private

This patch makes inheritence from PresburgerSpace for PWMAFunction private.

The reasoning for this patch is to prevent implicit conversion to
PresburgerSpace from PWMAFunction and to not expose all functions exposed by
PresburgerSpace in PWMAFunction.

Reviewed By: arjunp

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

2 years ago[mlir][tensor] Add pattern to fold ExtractSliceOp, PadOp chains.
gysit [Mon, 11 Apr 2022 14:23:53 +0000 (14:23 +0000)]
[mlir][tensor] Add pattern to fold ExtractSliceOp, PadOp chains.

The pattern folds chains of tensor::ExtractSliceOp, tensor::PadOp pairs if they pad different dimensions. Repeated tiling and padding of the tiled dimensions may introduce such chains. This canonicalization pattern folds these chains to a single tensor::ExtractSliceOp, tensor::PadOp pair that pads all dimensions at once, which simplifies vectorization and bufferization.

Example:
```mlir
   %0 = tensor.extract_slice %input[16, 0] [%sz0, 64] [1, 1]
       : tensor<64x64xf32> to tensor<?x64xf32>
   %1 = tensor.pad %0 low[0, 0] high[%pw0, 0] { ...
     } : tensor<?x64xf32> to tensor<8x64xf32>
   %2 = tensor.extract_slice %1[0, 4] [8, %sz1] [1, 1]
        : tensor<8x64xf32> to tensor<8x?xf32>
   %res = tensor.pad %2 nofold low[0, 0] high[0, %pw1] { ...
     } : tensor<8x?xf32> to tensor<8x4xf32>
```
folds into:
 ```mlir
   %0 = tensor.extract_slice %input[16, 4] [%sz0, %sz1] [1, 1]
        : tensor<64x64xf32> to tensor<?x?xf32>
   %res = tensor.pad %0 nofold low[0, 0] high[%pw0, %pw1] { ...
     } : tensor<?x?xf32> to tensor<8x4xf32>
 ```

Reviewed By: nicolasvasilache, hanchung

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

2 years ago[dllexport] odr-use constexpr default args for constructor closures
Hans Wennborg [Fri, 8 Apr 2022 13:54:09 +0000 (15:54 +0200)]
[dllexport] odr-use constexpr default args for constructor closures

InstantiateDefaultCtorDefaultArgs() is supposed to mark default
constructor args as odr-used, since those args will be used when
emitting the constructor closure.

However, constexpr vars were not getting odr-used since
DoMarkVarDeclReferenced() defers them in MaybeODRUseExprs, and the code
was calling CleanupVarDeclMarking() which discarded those uses instead
of processing them.

(This came up in Chromium, crbug.com/1312086)

Differential revision: https://reviews.llvm.org/D123405

2 years ago[compiler-rt][SystemZ] Skip fuzzer/coverage.test
Ulrich Weigand [Mon, 11 Apr 2022 14:18:09 +0000 (16:18 +0200)]
[compiler-rt][SystemZ] Skip fuzzer/coverage.test

This test is currently marked as XFAIL on s390x, but it is randomly
passing, causing build bot issues.  Setting as UNSUPPORTED for now.

2 years ago[Clang] Avoid legacy PM in some tests (NFC)
Nikita Popov [Mon, 11 Apr 2022 12:36:37 +0000 (14:36 +0200)]
[Clang] Avoid legacy PM in some tests (NFC)

Either remove legacy PM run lines or change them to use new PM.

2 years ago[libc++] Remove the usage of __init in operator+
Nikolas Klauser [Sat, 9 Apr 2022 14:19:45 +0000 (16:19 +0200)]
[libc++] Remove the usage of __init in operator+

`operator+` currently calls `__init`. This patch removes the usage of implementation details.

Reviewed By: ldionne, Mordante, #libc

Spies: libcxx-commits

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

2 years ago[llvm][AArch64] Generate getExtensionFeatures from the list of extensions
David Spickett [Wed, 6 Apr 2022 14:29:51 +0000 (14:29 +0000)]
[llvm][AArch64] Generate getExtensionFeatures from the list of extensions

This takes the AARCH64_ARCH_EXT_NAME in AArch64TargetParser.def and uses
it to generate all the "if bit is set add this feature name" code.

Which gives us a bunch that we were missing. I've updated testing
to include those and reordered them to match the order in the .def.

The final part of the test will catch any missing extensions if
we somehow manage to not generate an if block for them.

This has changed the order of cc1's "-target-feature" output so I've
updated some tests in clang to reflect that.

Reviewed By: tmatheson

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

2 years ago[gn build] Port b4ad28da196d
LLVM GN Syncbot [Mon, 11 Apr 2022 12:47:08 +0000 (12:47 +0000)]
[gn build] Port b4ad28da196d

2 years ago[Clang] Override method ModuleImportRead in MultiplexASTDeserializationListener
Guoxiong Li [Mon, 11 Apr 2022 12:31:16 +0000 (08:31 -0400)]
[Clang] Override method ModuleImportRead in MultiplexASTDeserializationListener

Fixes https://llvm.org/PR54521

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

2 years ago[CodeGen] Async unwind - add a pass to fix CFI information
Momchil Velikov [Mon, 11 Apr 2022 11:08:26 +0000 (12:08 +0100)]
[CodeGen] Async unwind - add a pass to fix CFI information

This pass inserts the necessary CFI instructions to compensate for the
inconsistency of the call-frame information caused by linear (non-CGA
aware) nature of the unwind tables.

Unlike the `CFIInstrInserer` pass, this one almost always emits only
`.cfi_remember_state`/`.cfi_restore_state`, which results in smaller
unwind tables and also transparently handles custom unwind info
extensions like CFA offset adjustement and save locations of SVE
registers.

This pass takes advantage of the constraints taht LLVM imposes on the
placement of save/restore points (cf. `ShrinkWrap.cpp`):

  * there is a single basic block, containing the function prologue

  * possibly multiple epilogue blocks, where each epilogue block is
    complete and self-contained, i.e. CSR restore instructions (and the
    corresponding CFI instructions are not split across two or more
    blocks.

  * prologue and epilogue blocks are outside of any loops

Thus, during execution, at the beginning and at the end of each basic
block the function can be in one of two states:

  - "has a call frame", if the function has executed the prologue, or
     has not executed any epilogue

  - "does not have a call frame", if the function has not executed the
    prologue, or has executed an epilogue

These properties can be computed for each basic block by a single RPO
traversal.

From the point of view of the unwind tables, the "has/does not have
call frame" state at beginning of each block is determined by the
state at the end of the previous block, in layout order.

Where these states differ, we insert compensating CFI instructions,
which come in two flavours:

- CFI instructions, which reset the unwind table state to the
    initial one.  This is done by a target specific hook and is
    expected to be trivial to implement, for example it could be:
```
     .cfi_def_cfa <sp>, 0
     .cfi_same_value <rN>
     .cfi_same_value <rN-1>
     ...
```
where `<rN>` are the callee-saved registers.

- CFI instructions, which reset the unwind table state to the one
    created by the function prologue. These are the sequence:
```
       .cfi_restore_state
       .cfi_remember_state
```
In this case we also insert a `.cfi_remember_state` after the
last CFI instruction in the function prologue.

Reviewed By: MaskRay, danielkiss, chill

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

2 years agoRemove deprecated `parseSourceFile/String()` overloads.
Christian Sigg [Mon, 11 Apr 2022 09:29:32 +0000 (11:29 +0200)]
Remove deprecated `parseSourceFile/String()` overloads.

Reviewed By: rriddle

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

2 years ago[mlir][emitc][nfc] Replace !emitc.opaque pointers
Marius Brehler [Mon, 11 Apr 2022 11:45:44 +0000 (11:45 +0000)]
[mlir][emitc][nfc] Replace !emitc.opaque pointers

Replaces `!emitc.opaque` types used to express pointers with
`!emitc.ptr` types.

2 years ago[SDAG] try to reduce compare of funnel shift equal 0
Sanjay Patel [Mon, 11 Apr 2022 11:09:47 +0000 (07:09 -0400)]
[SDAG] try to reduce compare of funnel shift equal 0

fshl (or X, Y), X, C ==/!= 0 --> or (shl Y, C), X ==/!= 0
fshl X, (or X, Y), C ==/!= 0 --> or (srl Y, BW-C), X ==/!= 0

This is similar to an existing setcc-of-rotate fold, but the
matching requires more checks for the more general funnel op:
https://alive2.llvm.org/ce/z/Ab2jDd

We are effectively decomposing the funnel shift into logical
shifts, reassociating, and removing a shift.

This should get us the final improvements for x86-64 that were
originally shown in D111530
( https://github.com/llvm/llvm-project/issues/49541 );
x86-32 still shows some SHLD/SHRD, so the pattern is not
matching there yet.

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

2 years ago[LICM] Add additional test for load hoisting, simplify existing one.
Florian Hahn [Mon, 11 Apr 2022 11:27:38 +0000 (13:27 +0200)]
[LICM] Add additional test for load hoisting, simplify existing one.

2 years agoRevert "AArch64: take compact unwind frame size from last CFI instruction."
Tim Northover [Mon, 11 Apr 2022 11:25:58 +0000 (12:25 +0100)]
Revert "AArch64: take compact unwind frame size from last CFI instruction."

It was on ToT when I pushed and committed unintentionally.

2 years agoAArch64: add nvcast patterns for v1f64
Tim Northover [Mon, 11 Apr 2022 11:23:05 +0000 (12:23 +0100)]
AArch64: add nvcast patterns for v1f64

2 years agoAArch64: take compact unwind frame size from last CFI instruction.
Tim Northover [Mon, 7 Mar 2022 15:12:57 +0000 (15:12 +0000)]
AArch64: take compact unwind frame size from last CFI instruction.

Asynchronous exception support for the prologue means that there can be
multiple .cfi_def_cfa_offset instructions in a single function, which tripped
up an assertion in the compact unwind generator.

In reality the compact unwind format is far too restrictive to represent
asynchronous frames so if we ever wanted that on Darwin we'd fall back to DWARF
(possibly keeping compact unwind around for synchronous users). So the compact
format should continue to represent the synchronous situation, and the
assertion can be removed.

2 years agoTail calls: look through AssertZExt to find register copy.
Tim Northover [Thu, 3 Mar 2022 12:38:05 +0000 (12:38 +0000)]
Tail calls: look through AssertZExt to find register copy.

arm64_32 guarantees the high 32 bits of pointer parameters are passed as 0, and
this is modelled in the IR by inserting an AssertZExt after the CopyFromReg.
The function deciding whether registers that need to be preserved actually are
wasn't expecting this so it banned perfectly legitimate tail calls.

2 years ago[Clang] Add -no-opaque-pointers to native powerpc test (NFC)
Nikita Popov [Mon, 11 Apr 2022 11:14:49 +0000 (13:14 +0200)]
[Clang] Add -no-opaque-pointers to native powerpc test (NFC)

Does not run on x86, so I missed this before. The test currently
has typed pointer check lines.

2 years ago[InstCombine] Fold sub(add(x,y),min/max(x,y)) -> max/min(x,y) (PR38280)
Simon Pilgrim [Mon, 11 Apr 2022 10:32:45 +0000 (11:32 +0100)]
[InstCombine] Fold sub(add(x,y),min/max(x,y)) -> max/min(x,y) (PR38280)

As discussed on Issue #37628, we can flip a min/max node if we're subtracting from the sum of the node's operands

Alive2: https://alive2.llvm.org/ce/z/W_KXfy

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

2 years ago[C++20][Modules] Add testcases from section 10.2 dependent on header units.
Iain Sandoe [Sat, 19 Mar 2022 19:48:38 +0000 (19:48 +0000)]
[C++20][Modules] Add testcases from section 10.2 dependent on header units.

This adds in testcases reflecting the remaining example in section 10.2
of the C++20 standard.

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

2 years ago[mlir][vector] Swap ExtractSliceOp(TransferWriteOp).
gysit [Mon, 11 Apr 2022 10:19:40 +0000 (10:19 +0000)]
[mlir][vector] Swap ExtractSliceOp(TransferWriteOp).

Rewrite tensor::ExtractSliceOp(vector::TransferWriteOp) to vector::TransferWriteOp(tensor::ExtractSliceOp) if the full slice is overwritten and inserted into another tensor. After this rewrite, the operations bufferize in-place since all of them work on the same %iter_arg slice.

For example:
```mlir
  %0 = vector.transfer_write %vec, %init_tensor[%c0, %c0]
       : vector<8x16xf32>, tensor<8x16xf32>
  %1 = tensor.extract_slice %0[0, 0] [%sz0, %sz1] [1, 1]
       : tensor<8x16xf32> to tensor<?x?xf32>
  %r = tensor.insert_slice %1 into %iter_arg[%iv0, %iv1] [%sz0, %sz1] [1, 1]
       : tensor<?x?xf32> into tensor<27x37xf32>
```
folds to
```mlir
  %0 = tensor.extract_slice %iter_arg[%iv0, %iv1] [%sz0, %sz1] [1, 1]
       : tensor<27x37xf32> to tensor<?x?xf32>
  %1 = vector.transfer_write %vec, %0[%c0, %c0]
       : vector<8x16xf32>, tensor<?x?xf32>
  %r = tensor.insert_slice %1 into %iter_arg[%iv0, %iv1] [%sz0, %sz1] [1, 1]
       : tensor<?x?xf32> into tensor<27x37xf32>

Reviewed By: nicolasvasilache, hanchung

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

2 years ago[OpenCL] Add device enqueue guards for DSE builtins
Sven van Haastregt [Mon, 11 Apr 2022 10:27:51 +0000 (11:27 +0100)]
[OpenCL] Add device enqueue guards for DSE builtins

Align guards of these builtins with opencl-c.h.

2 years ago[X86] Account for high uop/resource usage in BSF/BSR instructions
Simon Pilgrim [Mon, 11 Apr 2022 10:20:04 +0000 (11:20 +0100)]
[X86] Account for high uop/resource usage in BSF/BSR instructions

znver1/2 models were incorrectly modelling these as single uop instructions, instead of the microcoded nightmares they really are.

Now matches AMD SoG, Agner and instlatx64 numbers.

Fixes #54811

2 years ago[CGCall] Check store type in findDominatingStoreToReturnValue()
Nikita Popov [Mon, 11 Apr 2022 10:06:39 +0000 (12:06 +0200)]
[CGCall] Check store type in findDominatingStoreToReturnValue()

We need to make sure that the stored type matches the return type.

2 years ago[mlir][vector] Update transfer read/write doc (NFC).
gysit [Mon, 11 Apr 2022 09:59:35 +0000 (09:59 +0000)]
[mlir][vector] Update transfer read/write doc (NFC).

Clarify the in_bounds attribute is specified for the vector dimensions.

Reviewed By: nicolasvasilache

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

2 years ago[flang] D123388 fix - remove unused variable from test
Jean Perier [Mon, 11 Apr 2022 09:56:44 +0000 (02:56 -0700)]
[flang] D123388 fix - remove unused variable from test

2 years ago[AST] Remove a duplicated getDecl method in TemplateName, NFC.
Haojian Wu [Mon, 11 Apr 2022 09:51:28 +0000 (11:51 +0200)]
[AST] Remove a duplicated getDecl method in TemplateName, NFC.

There is a TemplateName::getTemplateDecl which does the same work.

2 years ago[flang][runtime] Prefer process time over thread time in CPU_TIME
Mats Petersson [Fri, 8 Apr 2022 18:04:47 +0000 (19:04 +0100)]
[flang][runtime] Prefer process time over thread time in CPU_TIME

Most Fortran compilers appear to return the process time
for calls to CPU_TIME, where the flang implementation
prior to this change was returning the time used by the
current thread. This would cause incorrect time being
reported when for example OpenMP is used to share work
across multiple CPUs.

This patch changes the order so the selection of "what
time to return" so that if there is a process time to
report, that is the reported value, and only if that is
not available, the thread time is considerd instead.

Reviewed By: jeanPerier

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

2 years agoRevert rG88ff6f70c45f2767576c64dde28cbfe7a90916ca "[X86] Extend vselect(cond, pshufb...
Simon Pilgrim [Mon, 11 Apr 2022 09:42:32 +0000 (10:42 +0100)]
Revert rG88ff6f70c45f2767576c64dde28cbfe7a90916ca "[X86] Extend vselect(cond, pshufb(x), pshufb(y)) -> or(pshufb(x), pshufb(y)) to include inner or(pshufb(x), pshufb(y)) chains"

Reverting while I investigate reports of internal test regressions/failures

2 years ago[ThinLTOCodeGenerator] Remove support for legacy PM
Nikita Popov [Fri, 8 Apr 2022 09:40:02 +0000 (11:40 +0200)]
[ThinLTOCodeGenerator] Remove support for legacy PM

All users of NewPM=false for the (legacy) ThinLTOCodeGenerator
have been removed, so we can remove this functionality entirely.

2 years ago[Flang][OpenMP] Add implementation of privatisation
Kiran Chandramohan [Mon, 11 Apr 2022 09:05:00 +0000 (09:05 +0000)]
[Flang][OpenMP] Add implementation of privatisation

Privatisation creates local copies of variables in the OpenMP region.
Two functions `createHostAssociateVarClone` and `copyHostAssociateVar`
are added to create a clone of the variable for basic privatisation and to
copy the contents for first-privatisation.

Note: Tests for more data-types will be added when the fir.do_loop is
upstreamed.

This is part of the upstreaming effort from the fir-dev branch in [1].
[1] https://github.com/flang-compiler/f18-llvm-project

Reviewed By: peixin, NimishMishra

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Peter Klausler <pklausler@nvidia.com>
Co-authored-by: Valentin Clement <clementval@gmail.com>
Co-authored-by: Sourabh Singh Tomar <SourabhSingh.Tomar@amd.com>
Co-authored-by: Nimish Mishra <neelam.nimish@gmail.com>
Co-authored-by: Peixin-Qiao <qiaopeixin@huawei.com>
2 years ago[Clang] Enable opaque pointers by default
Nikita Popov [Thu, 7 Apr 2022 09:59:38 +0000 (11:59 +0200)]
[Clang] Enable opaque pointers by default

Enable opaque pointers by default in clang, which can be disabled
either via cc1 option -no-opaque-pointers or cmake flag
-DCLANG_ENABLE_OPAQUE_POINTERS=OFF.

See https://llvm.org/docs/OpaquePointers.html for context.

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

2 years ago[Clang] Add -no-opaque-pointers to recently added test (NFC)
Nikita Popov [Mon, 11 Apr 2022 09:13:05 +0000 (11:13 +0200)]
[Clang] Add -no-opaque-pointers to recently added test (NFC)

2 years ago[C++20][Modules] Remove an empty statement [NFC].
Iain Sandoe [Mon, 11 Apr 2022 07:56:50 +0000 (08:56 +0100)]
[C++20][Modules] Remove an empty statement [NFC].

This addresses a post commit review comment by removing an unused and empty
'else' (replaced with a comment).

2 years ago[X86] Add shuffle combine tests where we fail to fold a mask into a or(pshufb,pshufb...
Simon Pilgrim [Mon, 11 Apr 2022 08:54:42 +0000 (09:54 +0100)]
[X86] Add shuffle combine tests where we fail to fold a mask into a or(pshufb,pshufb) chain

This doesn't hit if we use pshufb intrinsics directly due to a change in lowering order

2 years ago[llvm-lto] Remove support for legacy pass manager
Nikita Popov [Fri, 8 Apr 2022 08:54:20 +0000 (10:54 +0200)]
[llvm-lto] Remove support for legacy pass manager

This removes support for the legacy pass manager in llvm-lto and
llvm-lto2. In this case I've dropped the use-new-pm option entirely,
as I don't think this is considered part of the public interface.

This also makes -debug-pass-manager work with llvm-lto, because
that was needed to migrate some tests to NewPM.

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

2 years ago[flang] Lower optionals in GET_COMMAND_ARGUMENT and GET_ENVIRONMENT_VARIABLE
jeanPerier [Mon, 11 Apr 2022 07:33:39 +0000 (09:33 +0200)]
[flang] Lower optionals in GET_COMMAND_ARGUMENT and  GET_ENVIRONMENT_VARIABLE

Handle dynamic optional argument in GET_COMMAND_ARGUMENT and GET_ENVIRONMENT_VARIABLE
(previously compiled but caused segfaults). The previous code
handled static presence/absence aspects, but not when an absent dummy optional was
passed to one of the optional intrinsic arguments.

Simplify the runtime call lowering to simply lower the runtime call without
dealing with optionality there. This keeps the optional handling logic in
IntrinsicCall.cpp.

Note that the new code will generate some extra "if (not null addr )/then/else"
when the actual arguments are always there at runtime. That makes the implementation
a lot simpler/safer, and I think it is OK for now (I do not expect these runtime
function to be called in hot loop nests).

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

2 years ago[flang] add a static assert in CheckUnitNumberInRangeImpl
Jean Perier [Mon, 11 Apr 2022 07:32:03 +0000 (09:32 +0200)]
[flang] add a static assert in CheckUnitNumberInRangeImpl

Add a check that CheckUnitNumberInRangeImpl is not needlessly instantiated.

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

2 years ago[AArch64][NFC] Update comment in AArch64.td
Alexander Shaposhnikov [Mon, 11 Apr 2022 05:36:28 +0000 (05:36 +0000)]
[AArch64][NFC] Update comment in AArch64.td

2 years ago[AArch64] Split fuse-literals feature
Alexander Shaposhnikov [Mon, 11 Apr 2022 05:27:11 +0000 (05:27 +0000)]
[AArch64] Split fuse-literals feature

This diff splits fuse-literals feature and enables fuse-adrp-add by default,
in particular, it adjusts instruction scheduling to place ADRP+ADD pairs together.
This also enables the linker to apply the relaxations described in
https://github.com/ARM-software/abi-aa/commit/d2ca58c54b8e955cfef25c71822f837ae0439d73.

Differential revision: https://reviews.llvm.org/D120104

Test plan: make check-all

2 years ago[AVR] Merge AVRRelaxMemOperations into AVRExpandPseudoInsts
Patryk Wychowaniec [Mon, 11 Apr 2022 02:21:45 +0000 (02:21 +0000)]
[AVR] Merge AVRRelaxMemOperations into AVRExpandPseudoInsts

This commit contains a refactoring that merges AVRRelaxMemOperations
into AVRExpandPseudoInsts, so that we have a single place in code that
expands the STDWPtrQRr opcode.

Seizing the day, I've also fixed a couple of potential bugs with our
previous implementation (e.g. when the destination register was killed,
the previous implementation would try to .addDef() that killed
register, crashing LLVM in the process - that's fixed now, as proved by
the test).

Reviewed By: benshi001

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

2 years ago[RISCV] Add basic code modeling for llvm.experimental.stepvector intrinsic
LiaoChunyu [Thu, 31 Mar 2022 06:16:24 +0000 (14:16 +0800)]
[RISCV] Add basic code modeling for llvm.experimental.stepvector intrinsic

Scalable vectors llvm.experimental.stepvector intrinsic
will crash due to an invalid cost when run the code through the loopunroll.

Reviewed By: kito-cheng

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

2 years ago[CUDA][HIP] Externalize kernels in anonymous name space
Yaxun (Sam) Liu [Fri, 8 Apr 2022 02:57:56 +0000 (22:57 -0400)]
[CUDA][HIP] Externalize kernels in anonymous name space

kernels in anonymous name space needs to have unique name
to avoid duplicate symbols.

Fixes: https://github.com/llvm/llvm-project/issues/54560

Reviewed by: Artem Belevich

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

2 years ago[llvm-objcopy] Update comments with capitalization change from 6b575395d47b8
Nico Weber [Mon, 11 Apr 2022 01:24:21 +0000 (21:24 -0400)]
[llvm-objcopy] Update comments with capitalization change from 6b575395d47b8

No behavior change.

2 years agoFix a misuse of `cast`
Sheng [Mon, 11 Apr 2022 01:21:15 +0000 (01:21 +0000)]
Fix a misuse of `cast`

`cast` will assert instead of returning null pointer.

2 years ago[LAA] Add test with simpler load of pointer select.
Florian Hahn [Sun, 10 Apr 2022 21:50:23 +0000 (23:50 +0200)]
[LAA] Add test with simpler load of pointer select.

Add a simpler test for D114487/D108699.

2 years ago[LICM] Add test for PR51248.
Florian Hahn [Sun, 10 Apr 2022 20:36:03 +0000 (22:36 +0200)]
[LICM] Add test for PR51248.

Test for #51248. LICM introduces an unused load in a writeonly function.

2 years ago[LICM] Trim unneeded functions from test, add promote-able load.
Florian Hahn [Sun, 10 Apr 2022 20:25:05 +0000 (22:25 +0200)]
[LICM] Trim unneeded functions from test, add promote-able load.

Clean up the test a bit. Also add a promote-able load, to make sure LICM
always has to hoist the load.

2 years ago[X86] Remove dead code from test case
eop Chen [Sun, 10 Apr 2022 15:31:25 +0000 (08:31 -0700)]
[X86] Remove dead code from test case

Obvious NFC, no need to review.

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

2 years ago[libc++] Rename the template arguments of the algorithm result types
Nikolas Klauser [Sun, 10 Apr 2022 09:55:06 +0000 (11:55 +0200)]
[libc++] Rename the template arguments of the algorithm result types

Spies: libcxx-commits

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

2 years ago[X86] Extend vselect(cond, pshufb(x), pshufb(y)) -> or(pshufb(x), pshufb(y)) to inclu...
Simon Pilgrim [Sun, 10 Apr 2022 12:04:53 +0000 (13:04 +0100)]
[X86] Extend vselect(cond, pshufb(x), pshufb(y)) -> or(pshufb(x), pshufb(y)) to include inner or(pshufb(x), pshufb(y)) chains

2 years ago[ORC] add lazy jit support for riscv64
Alex Fan [Thu, 24 Mar 2022 01:46:36 +0000 (09:46 +0800)]
[ORC] add lazy jit support for riscv64

This adds resolver, indirection and trampoline stubs for riscv64,
allowing lazy compilation to work.

It assumes hard float extension exists. I don't know the proper way to detect it as Triple doesn't provide the interface to check riscv +f +d abi.

I am also not sure if orclazy tests should be enabled because lli needs an additional -codemodel=melany for tests to pass.

Reviewed By: lhames

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

2 years ago[X86] combineExtractSubvector - fold extract_subvector(insert_subvector(V,X,C1),C1)
Simon Pilgrim [Sun, 10 Apr 2022 10:03:08 +0000 (11:03 +0100)]
[X86] combineExtractSubvector - fold extract_subvector(insert_subvector(V,X,C1),C1)

extract_subvector(insert_subvector(V,X,C1),C1) -> insert_subvector(extract_subvector(V,C1),X,0)

More aggressively attempt to reduce the width of an extract_subvector source - we currently only do this if we're inserting into a zero vector (i.e. canonicalizing to the AVX implicit zero upper elts pattern).

But if we're extracting from the same point as the inner insert_subvector then the fold is still relatively trivial - we can probably do even better if we can ensure the subvector isn't badly split.

2 years ago[Driver] Prepend - to option name in err_drv_unsupported_option_argument diagnostic
Fangrui Song [Sun, 10 Apr 2022 08:44:53 +0000 (01:44 -0700)]
[Driver] Prepend - to option name in err_drv_unsupported_option_argument diagnostic

2 years ago[VPlan] Place VPExpandSCEVRecipe in pre-header.
Florian Hahn [Sun, 10 Apr 2022 08:26:20 +0000 (10:26 +0200)]
[VPlan] Place VPExpandSCEVRecipe in pre-header.

After D121624 models the pre-header in VPlan, VPExpandSCEVRecipes can be
placed there. This ensures SCEV expansion happens before modifying the
CFG during VPlan execution, when CFG is incomplete.

Depends on D121624.

Reviewed By: Ayal

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

2 years ago[Driver] Simplify OPT_fcolor_diagnostics claim
Fangrui Song [Sun, 10 Apr 2022 08:21:31 +0000 (01:21 -0700)]
[Driver] Simplify OPT_fcolor_diagnostics claim

Mostly NFC, but the diagnostic is changed to the more appropriate
err_drv_invalid_argument_to_option.

2 years ago[Driver] Simplify -f[no-]diagnostics-color handling. NFC
Fangrui Song [Sun, 10 Apr 2022 08:07:44 +0000 (01:07 -0700)]
[Driver] Simplify -f[no-]diagnostics-color handling. NFC

Make them aliases for -f[no-]color-diagnostics.

2 years ago[Frontend] Simplify -finline* handling. NFC
Fangrui Song [Sun, 10 Apr 2022 07:31:25 +0000 (00:31 -0700)]
[Frontend] Simplify -finline* handling. NFC

2 years ago[Driver] Fix -f[no-]inline to override -f[no-]inline-functions/-finline-hint-functions
Fangrui Song [Sun, 10 Apr 2022 07:15:12 +0000 (00:15 -0700)]
[Driver] Fix -f[no-]inline to override -f[no-]inline-functions/-finline-hint-functions

Fix two cases to match GCC:

* -fno-inline -finline => (no cc1 option)
* -fno-inline -finline-functions => -fno-inline

2 years ago[X86][AMX] Fix infinite loop of getShape.
Luo, Yuanke [Sun, 10 Apr 2022 06:32:20 +0000 (14:32 +0800)]
[X86][AMX] Fix infinite loop of getShape.

When walk the user chain to get the shape of a phi node. If it is phi
node in the chain, we should walk to the user of this phi node instead
of the original phi node.

2 years ago[RISCV] Remove unnecessary cast to i8* when converting gather/scatter to strided...
Craig Topper [Sun, 10 Apr 2022 03:01:32 +0000 (20:01 -0700)]
[RISCV] Remove unnecessary cast to i8* when converting gather/scatter to strided load/store.

Not sure why I thought this necessary at the time.

2 years ago[ObjCopy][NFC] Refactor handling of linkedit_data_command in MachOWriter
Alexander Shaposhnikov [Sun, 10 Apr 2022 02:09:11 +0000 (02:09 +0000)]
[ObjCopy][NFC] Refactor handling of linkedit_data_command in MachOWriter

2 years ago[ObjCopy][NFC] Add missing const in MachOLayoutBuilder.h
Alexander Shaposhnikov [Sun, 10 Apr 2022 01:29:24 +0000 (01:29 +0000)]
[ObjCopy][NFC] Add missing const in MachOLayoutBuilder.h

2 years ago[ObjCopy][NFC] Refactor handling of linkedit_data_command
Alexander Shaposhnikov [Sun, 10 Apr 2022 01:20:45 +0000 (01:20 +0000)]
[ObjCopy][NFC] Refactor handling of linkedit_data_command

2 years agoGiving a lot more functions prototypes; NFC
Aaron Ballman [Sat, 9 Apr 2022 21:23:32 +0000 (17:23 -0400)]
Giving a lot more functions prototypes; NFC

This should address https://lab.llvm.org/buildbot/#/builders/37/builds/12315
and speculatively fix other similar diagnostics.

2 years ago[randstruct] NFC change to use static
Bill Wendling [Sat, 9 Apr 2022 20:24:59 +0000 (13:24 -0700)]
[randstruct] NFC change to use static