platform/upstream/llvm.git
2 years ago[Clang/Test]: Rename enable_noundef_analysis to disable-noundef-analysis and turn...
hyeongyu kim [Sun, 16 Jan 2022 09:53:11 +0000 (18:53 +0900)]
[Clang/Test]: Rename enable_noundef_analysis to disable-noundef-analysis and turn it off by default

Turning on `enable_noundef_analysis` flag allows better codegen by removing freeze instructions.
I modified clang by renaming `enable_noundef_analysis` flag to `disable-noundef-analysis` and turning it off by default.

Test updates are made as a separate patch: D108453

Reviewed By: eugenis

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

2 years ago[ELF] Remove forEachRelSec. NFC
Fangrui Song [Sun, 16 Jan 2022 08:28:47 +0000 (00:28 -0800)]
[ELF] Remove forEachRelSec. NFC

2 years ago[ELF] Remove !isLazy() condition from computeBinding
Fangrui Song [Sun, 16 Jan 2022 07:58:15 +0000 (23:58 -0800)]
[ELF] Remove !isLazy() condition from computeBinding

Seems applicable since we demote lazy symbols to Undefined (D111365).

2 years ago[ELF] Remove config->relocatable condition from Symbol::computeBinding
Fangrui Song [Sun, 16 Jan 2022 07:49:47 +0000 (23:49 -0800)]
[ELF] Remove config->relocatable condition from Symbol::computeBinding

2 years ago[ELF] Speed up Symbol::computeBinding. NFC
Fangrui Song [Sun, 16 Jan 2022 07:40:43 +0000 (23:40 -0800)]
[ELF] Speed up Symbol::computeBinding. NFC

When computeBinding is inlined into includeInDynsym and computeIsPreemptible,
the optimizer can remove the config->gnuUnique load.

2 years ago[ELF] Slightly speed up Symbol::includeInDynsym. NFC
Fangrui Song [Sun, 16 Jan 2022 07:32:48 +0000 (23:32 -0800)]
[ELF] Slightly speed up Symbol::includeInDynsym. NFC

2 years ago[ELF] Simplify Symbol::includeInDynsym
Fangrui Song [Sun, 16 Jan 2022 07:27:45 +0000 (23:27 -0800)]
[ELF] Simplify Symbol::includeInDynsym

2 years ago[ELF] Optimize -z combreloc
Fangrui Song [Sun, 16 Jan 2022 06:33:51 +0000 (22:33 -0800)]
[ELF] Optimize -z combreloc

Sorting dynamic relocations is a bottleneck. Simplifying the comparator improves
performance. Linking clang is 4~5% faster with --threads=8.

This change may shuffle R_MIPS_REL32 for Mips and is a NFC for non-Mips.

2 years ago[X86] Pre-checkin test case for combining const operand to VNNI
Luo, Yuanke [Wed, 12 Jan 2022 06:25:42 +0000 (14:25 +0800)]
[X86] Pre-checkin test case for combining const operand to VNNI
instruction.

2 years agoRevert "[cmake] Use `GNUInstallDirs` to support custom installation dirs."
John Ericson [Sun, 16 Jan 2022 05:48:30 +0000 (05:48 +0000)]
Revert "[cmake] Use `GNUInstallDirs` to support custom installation dirs."

https://lab.llvm.org/buildbot/#/builders/46/builds/21146 Still have
this odd error, not sure how to reproduce, so I will just try breaking
up my patch.

This reverts commit 4a678f8072004eff9214c1a4e1836a14abb69535.

2 years ago[cmake] Use `GNUInstallDirs` to support custom installation dirs.
John Ericson [Sat, 15 Jan 2022 07:37:48 +0000 (07:37 +0000)]
[cmake] Use `GNUInstallDirs` to support custom installation dirs.

This is the original patch in my GNUInstallDirs series, now last to merge as the final piece!

It arose as a new draft of D28234. I initially did the unorthodox thing of pushing to that when I wasn't the original author, but since I ended up

 - Using `GNUInstallDirs`, rather than mimicking it, as the original author was hesitant to do but others requested.

 - Converting all the packages, not just LLVM, effecting many more projects than LLVM itself.

I figured it was time to make a new revision.

I have used this patch series (and many back-ports) as the basis of https://github.com/NixOS/nixpkgs/pull/111487 for my distro (NixOS), which was merged last spring (2021). It looked like people were generally on board in D28234, but I make note of this here in case extra motivation is useful.

---

As pointed out in the original issue, a central tension is that LLVM already has some partial support for these sorts of things. Variables like `COMPILER_RT_INSTALL_PATH` have already been dealt with. Variables like `LLVM_LIBDIR_SUFFIX` however, will require further work, so that we may use `CMAKE_INSTALL_LIBDIR`.

These remaining items will be addressed in further patches. What is here is now rote and so we should get it out of the way before dealing more intricately with the remainder.

Reviewed By: #libunwind, #libc, #libc_abi, compnerd

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

2 years ago[ORC-RT] Remove some stale comments.
Lang Hames [Sun, 16 Jan 2022 03:03:15 +0000 (14:03 +1100)]
[ORC-RT] Remove some stale comments.

We switched to SPS serialization for these functions in 089acf25223d2.

2 years ago[ORC-RT] Update WrapperFunctionCall for 089acf25223.
Lang Hames [Sun, 16 Jan 2022 01:56:06 +0000 (12:56 +1100)]
[ORC-RT] Update WrapperFunctionCall for 089acf25223.

089acf25223 updated WrapperFunctionCall to carry arbitrary argument payloads
(rather than plain address ranges). This commit implements the corresponding
update for the ORC runtime.

2 years ago[ELF] Simplify elf::link exit. NFC
Fangrui Song [Sun, 16 Jan 2022 01:59:05 +0000 (17:59 -0800)]
[ELF] Simplify elf::link exit. NFC

2 years ago[SelectionDAG] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds after...
Fangrui Song [Sun, 16 Jan 2022 01:13:09 +0000 (17:13 -0800)]
[SelectionDAG] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds after D117235

2 years ago[RISCV] Add RISCVISD::BFPW to ComputeNumSignBitsForTargetNode.
Craig Topper [Sat, 15 Jan 2022 21:50:38 +0000 (13:50 -0800)]
[RISCV] Add RISCVISD::BFPW to ComputeNumSignBitsForTargetNode.

2 years ago[lldb] Set result error state in 'frame variable'
Dave Lee [Fri, 7 Jan 2022 03:38:31 +0000 (19:38 -0800)]
[lldb] Set result error state in 'frame variable'

Ensure that errors in `frame variable` are reflected in result object.

The statistics for `frame variable` show invocations as being successful, even
when executing one of the error paths.

This change replaces `result.GetErrorStream()` with `result.AppendError()`,
which also sets the status to `eReturnStatusFailed`.

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

Recommitting after D116901 and D116863.

(cherry picked from commit 2c7d10c41278181e3e45c68f28b501cd95193a8a)

2 years ago[AttrBuilder] Remove ctor accepting AttributeList and Index
Nikita Popov [Sat, 15 Jan 2022 21:14:16 +0000 (22:14 +0100)]
[AttrBuilder] Remove ctor accepting AttributeList and Index

Use the AttributeSet constructor instead. There's no good reason
why AttrBuilder itself should exact the AttributeSet from the
AttributeList. Moving this out of the AttrBuilder generally results
in cleaner code.

2 years ago[AArch64] clang support for Armv8.8/9.3 MOPS
Lucas Prates [Thu, 23 Sep 2021 12:34:30 +0000 (13:34 +0100)]
[AArch64] clang support for Armv8.8/9.3 MOPS

This introduces clang command line support for the new Armv8.8-A and
Armv9.3-A instructions for standardising memcpy, memset and memmove
operations, which was previously introduced into LLVM in
https://reviews.llvm.org/D116157.

Patch by Lucas Prates, Tomas Matheson and Son Tuan Vu.

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

2 years ago[lldb] Use PlatformMacOSX for Mac Catalyst
Jonas Devlieghere [Sat, 15 Jan 2022 19:41:37 +0000 (11:41 -0800)]
[lldb] Use PlatformMacOSX for Mac Catalyst

Use PlatformMacOSX for Mac Catalyst apps on both Intel (x86) and Apple
Silicon (arm64).

2 years agoDisable the MLIR ExecutionEngine library when the native target is not configured
Mehdi Amini [Fri, 14 Jan 2022 07:47:47 +0000 (07:47 +0000)]
Disable the MLIR ExecutionEngine library when the native target is not configured

The execution engine would not be functional anyway, we're already
disabling the tests, this also disable the rest of the code.

Anecdotally this reduces the number of static library built when the
builtin target is disabled goes from 236 to 218.

Here is the complete list of LLVM targets built when running
`ninja check-mlir`:

libLLVMAggressiveInstCombine.a
libLLVMAnalysis.a
libLLVMAsmParser.a
libLLVMBinaryFormat.a
libLLVMBitReader.a
libLLVMBitstreamReader.a
libLLVMBitWriter.a
libLLVMCore.a
libLLVMDebugInfoCodeView.a
libLLVMDebugInfoDWARF.a
libLLVMDemangle.a
libLLVMFileCheck.a
libLLVMFrontendOpenMP.a
libLLVMInstCombine.a
libLLVMIRReader.a
libLLVMMC.a
libLLVMMCParser.a
libLLVMObject.a
libLLVMProfileData.a
libLLVMRemarks.a
libLLVMScalarOpts.a
libLLVMSupport.a
libLLVMTableGen.a
libLLVMTableGenGlobalISel.a
libLLVMTextAPI.a
libLLVMTransformUtils.a

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

2 years ago[libc++] Add _LIBCPP_HIDE_FROM_ABI to in_in_result
Nikolas Klauser [Sat, 15 Jan 2022 16:52:24 +0000 (17:52 +0100)]
[libc++] Add _LIBCPP_HIDE_FROM_ABI to in_in_result

Add `_LIBCPP_HIDE_FROM_ABI` to `in_in_result` conversion operators

Reviewed By: Quuxplusone, Mordante, #libc

Spies: libcxx-commits

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

2 years ago[ELF] Make some diagnostics follow the convention
Fangrui Song [Sat, 15 Jan 2022 18:46:25 +0000 (10:46 -0800)]
[ELF] Make some diagnostics follow the convention

2 years ago[CMake][LLDB] Resolve install conflict when `LLDB_BUILD_FRAMEWORK=ON`
paperchalice [Sat, 15 Jan 2022 18:40:48 +0000 (10:40 -0800)]
[CMake][LLDB] Resolve install conflict when `LLDB_BUILD_FRAMEWORK=ON`

Try to fix https://github.com/llvm/llvm-project/issues/108

Install python scripts into canonical resource path

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

2 years ago[lldb] Correctly display the number of types found
Jonas Devlieghere [Sat, 15 Jan 2022 18:23:06 +0000 (10:23 -0800)]
[lldb] Correctly display the number of types found

Correctly display the number of types found for `target modules lookup
--type` and add a test.

Fixes #53219

2 years ago[lldb] Remove anon struct from frame-var-anon-unions test
Dave Lee [Sat, 15 Jan 2022 18:20:02 +0000 (10:20 -0800)]
[lldb] Remove anon struct from frame-var-anon-unions test

This test for anonymous unions seems off. It tests the following:

```
union {
  // fields
};

struct {
  // fields
} var{...};
```

Both are anonymous types, but the first does not declare a variable and the
second one does. The test then checks that `frame var` can directly access the
fields of the anonymous union, but can't directly access the fields of the
anonymous struct variable.

The second test, to directly access the members of the struct variable, seems
pointless as similar code would not compile. A demonstration:

```
struct {
  int a;
  int z;
} a_z{23, 45};

printf("%d\n", a_z.a); // fine
printf("%d\n", a); // this does not compile
```

Since we can't directly access the fields in code, I'm not sure there's a
reason to test that lldb also can't directly access them (other than perhaps as
a regression test).

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

2 years ago[lldb] Remove PlatformDarwin::GetCompatibleArch helper
Jonas Devlieghere [Sat, 15 Jan 2022 05:46:26 +0000 (21:46 -0800)]
[lldb] Remove PlatformDarwin::GetCompatibleArch helper

This also removes the corresponding unit tests. I wrote them to sanity
check my original refactoring and checked them in because why not. The
current implementation, without the added complexity of indices, is
simple enough that we can do without it.

2 years ago[flang] Fold SCALE()
Peter Klausler [Thu, 30 Dec 2021 00:22:37 +0000 (16:22 -0800)]
[flang] Fold SCALE()

Fold references to the intrinsic function SCALE().

(Also work around some MSVC headaches somehow exposed by
this patch: disable a bogus MSVC warning that began to appear
in unrelated source files, and avoid the otherwise-necessary
use of the "template" keyword in a call to a template member
function of a class template.)

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

2 years ago[libc++] Normalize some whitespace in preparation for D116570. NFC.
Arthur O'Dwyer [Sat, 15 Jan 2022 17:20:33 +0000 (12:20 -0500)]
[libc++] Normalize some whitespace in preparation for D116570. NFC.

2 years ago[AttrBuilder] Remove non-const td_attrs()
Nikita Popov [Sat, 15 Jan 2022 17:00:20 +0000 (18:00 +0100)]
[AttrBuilder] Remove non-const td_attrs()

Mutations should happen through appropriate APIs that uphold the
sorting invariant. Exposing a mutable iterator is not necessary.

2 years agoSilence warning with MSVC.
Alexandre Ganea [Sat, 15 Jan 2022 17:00:58 +0000 (12:00 -0500)]
Silence warning with MSVC.

Fixes:

[2587/4073] Building CXX object projects\compiler-rt\lib\sanitizer_common\CMakeFiles\RTSanitizerCommon.x86_64.dir\sanitizer_stoptheworld_win.cpp.obj
D:\git\llvm-project\compiler-rt\lib\sanitizer_common\sanitizer_stoptheworld_win.cpp(125,33): warning: comparison of integers of different signs: 'DWORD' (aka 'unsigned long') and 'int' [-Wsign-compare]
      if (SuspendThread(thread) == -1) {
          ~~~~~~~~~~~~~~~~~~~~~ ^  ~~
1 warning generated.

2 years ago[compiler-rt][cmake] Fix clang-cl warnings introduced in ae4c643bcdf2
Alexandre Ganea [Sat, 15 Jan 2022 16:59:46 +0000 (11:59 -0500)]
[compiler-rt][cmake] Fix clang-cl warnings introduced in ae4c643bcdf2

See report in https://reviews.llvm.org/D116872#3245667

2 years ago[AttrBuilder] Remove empty() / td_empty() methods
Nikita Popov [Sat, 15 Jan 2022 16:55:12 +0000 (17:55 +0100)]
[AttrBuilder] Remove empty() / td_empty() methods

The empty() method is a footgun: It only checks whether there are
non-string attributes, which is not at all obvious from its name,
and of dubious usefulness. td_empty() is entirely unused.

Drop these methods in favor of hasAttributes(), which checks
whether there are any attributes, regardless of whether these are
string or enum attributes.

2 years ago[LoopUtils] Use InstSimplifyFolder in addRuntimeChecks.
Florian Hahn [Sat, 15 Jan 2022 15:21:16 +0000 (15:21 +0000)]
[LoopUtils] Use InstSimplifyFolder in addRuntimeChecks.

Use the InstSimplifyFolder introduced earlier to perform initial
simplification during runtime check construction.

2 years ago[X86] LowerFunnelShift - enable vXi32 handling
Simon Pilgrim [Sat, 15 Jan 2022 14:55:21 +0000 (14:55 +0000)]
[X86] LowerFunnelShift - enable vXi32 handling

2 years ago[libc++] Adds tests for LWG-3373.
Mark de Wever [Mon, 8 Nov 2021 20:16:50 +0000 (21:16 +0100)]
[libc++] Adds tests for LWG-3373.

The code in libc++ already satisfy the requirements of LWG-3373. Since
the issue was written to specifically allow the types to be used in
structured bindings, tests have been added to validate the new
requirement.

Implements
LWG-3373 {to,from}_chars_result and format_to_n_result need the "we really mean what we say" wording

Reviewed By: #libc, ldionne

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

2 years ago[BOLT][CMAKE] Accept BOLT_CLANG_EXE and BOLT_LLD_EXE
Amir Ayupov [Fri, 14 Jan 2022 22:18:43 +0000 (14:18 -0800)]
[BOLT][CMAKE] Accept BOLT_CLANG_EXE and BOLT_LLD_EXE

Add CMake options to supply clang and lld binaries for use in check-bolt
instead of requiring the build of clang and lld projects.

Suggested by Mehdi Amini in https://lists.llvm.org/pipermail/llvm-dev/2021-December/154426.html

Test Plan:
```
cmake -G Ninja ~/local/llvm-project/llvm \
-DLLVM_TARGETS_TO_BUILD="X86"  \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DLLVM_ENABLE_PROJECTS="bolt"  \
-DBOLT_CLANG_EXE=~/local/bin/clang \
-DBOLT_LLD_EXE=~/local/bin/lld

ninja check-bolt
...
llvm-lit: /home/aaupov/local/llvm-project/llvm/utils/lit/lit/llvm/config.py:436: note: using clang: /home/aaupov/local/bin/clang
llvm-lit: /home/aaupov/local/llvm-project/llvm/utils/lit/lit/llvm/config.py:436: note: using ld.lld: /home/aaupov/local/bin/ld.lld
llvm-lit: /home/aaupov/local/llvm-project/llvm/utils/lit/lit/llvm/config.py:436: note: using lld-link: /home/aaupov/local/bin/lld-link
llvm-lit: /home/aaupov/local/llvm-project/llvm/utils/lit/lit/llvm/config.py:436: note: using ld64.lld: /home/aaupov/local/bin/ld64.lld
llvm-lit: /home/aaupov/local/llvm-project/llvm/utils/lit/lit/llvm/config.py:436: note: using wasm-ld: /home/aaupov/local/bin/wasm-ld
...
```

Tested all configurations:
- LLVM_ENABLE_PROJECTS="bolt;clang;lld" + no BOLT_*_EXE
- LLVM_ENABLE_PROJECTS="bolt;clang" + BOLT_LLD_EXE
- LLVM_ENABLE_PROJECTS="bolt;lld" + BOLT_CLANG_EXE
- LLVM_ENABLE_PROJECTS="bolt" + BOLT_CLANG_EXE + BOLT_LLD_EXE
- LLVM_ENABLE_PROJECTS="bolt;clang;lld" + BOLT_CLANG_EXE + BOLT_LLD_EXE

Reviewed By: maksfb

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

2 years ago[SelectionDAG][VP] Add splitting/widening for VP_LOAD and VP_STORE
Fraser Cormack [Thu, 13 Jan 2022 17:23:07 +0000 (17:23 +0000)]
[SelectionDAG][VP] Add splitting/widening for VP_LOAD and VP_STORE

Original patch by @hussainjk.

This patch was split off from D109377 to keep vector legalization
(widening/splitting) separate from vector element legalization
(promoting).

While the original patch added a third overload of
SelectionDAG::getVPStore, this patch takes the liberty of collapsing
those all down to 1, as three overloads seems excessive for a
little-used node.

The original patch also used ModifyToType in places, but that method
still crashes on scalable vector types. Seeing as the other VP
legalization methods only work when all operands need identical
widening, this patch follows in that vein.

Reviewed By: craig.topper

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

2 years ago[IRBuilder] Migrate select-folding to value-based FoldSelect.
Florian Hahn [Sat, 15 Jan 2022 11:26:44 +0000 (11:26 +0000)]
[IRBuilder] Migrate select-folding to value-based FoldSelect.

Reviewed By: lebedev.ri

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

2 years ago[CMake] Fix compiler-rt -Wl,-z,gnu-version-script-compat warnings on non-Solaris
Fangrui Song [Sat, 15 Jan 2022 09:35:48 +0000 (01:35 -0800)]
[CMake] Fix compiler-rt -Wl,-z,gnu-version-script-compat warnings on non-Solaris

2 years ago[MC] Remove MCContext::reportFatalError
Fangrui Song [Sat, 15 Jan 2022 08:42:42 +0000 (00:42 -0800)]
[MC] Remove MCContext::reportFatalError

As the 10-year-old FIXME comment says, this API is not recommended.

2 years ago[RISCV][Clang] Add attrs to crc32_d/crc32c_d
Chenbing.Zheng [Sat, 15 Jan 2022 08:35:06 +0000 (08:35 +0000)]
[RISCV][Clang] Add attrs to crc32_d/crc32c_d

Reviewed By: craig.topper

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

2 years ago[MC][ARC][Mips] Replace MCContext::reportFatalError calls with reportError
Fangrui Song [Sat, 15 Jan 2022 08:37:24 +0000 (00:37 -0800)]
[MC][ARC][Mips] Replace MCContext::reportFatalError calls with reportError

2 years ago[RISCV] Add CSRs defined in the recently ratified Sstc extension
Alex Bradbury [Fri, 14 Jan 2022 11:53:09 +0000 (11:53 +0000)]
[RISCV] Add CSRs defined in the recently ratified Sstc extension

The 'RISC-V "stimecmp / vstimecmp" Extension' was ratified at the end of
last year though hasn't yet been integrated in the main specification
documents (see
<https://wiki.riscv.org/display/TECH/Recently+Ratified+Extensions>).

RISC-V "stimecmp / vstimecmp" Extension
<https://github.com/riscv/riscv-time-compare/releases/download/v0.5.4/Sstc.pdf>.

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

2 years ago[RISCV] Add CSRs defined in the recently ratified Smstateen extension
Alex Bradbury [Fri, 14 Jan 2022 09:15:35 +0000 (09:15 +0000)]
[RISCV] Add CSRs defined in the recently ratified Smstateen extension

The "RISC-V State Enable Extension" was ratified at the end of at the
end of last year though hasn't yet been integrated in the main
specification documents (see
<https://wiki.riscv.org/display/TECH/Recently+Ratified+Extensions>).

This commit adds the CSRs defined by this extension in
<https://github.com/riscv/riscv-state-enable/releases/download/v0.6.3/Smstateen.pdf>.

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

2 years ago[RISCV] Add CSRs defined in the recently ratified Sscofpmf extension
Alex Bradbury [Fri, 14 Jan 2022 08:48:23 +0000 (08:48 +0000)]
[RISCV] Add CSRs defined in the recently ratified Sscofpmf extension

The "RISC-V Count Overflow and Mode-Based Filtering Extension" was
ratified at the end of last year though hasn't yet been integrated in
the main specification documents (see
<https://wiki.riscv.org/display/TECH/Recently+Ratified+Extensions>).

This commit adds the CSRs defined by this extension in
<https://github.com/riscv/riscv-count-overflow/releases/download/v0.5.2/Sscofpmf.pdf>.

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

2 years ago[MC][ARM] Replace MCContext::reportFatalError call with reportError
Fangrui Song [Sat, 15 Jan 2022 08:32:03 +0000 (00:32 -0800)]
[MC][ARM] Replace MCContext::reportFatalError call with reportError

This call is slightly try. We need to postpone getFixupKindNumBytes.

2 years ago[RISCV][NFC] Add a function to customLegalizeToWOp by Intrinsic
Chenbing.Zheng [Sat, 15 Jan 2022 08:14:38 +0000 (08:14 +0000)]
[RISCV][NFC] Add a function to customLegalizeToWOp by Intrinsic

These cases follow the same pattern, so they can be combined
to a unqiue function.

Reviewed By: craig.topper

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

2 years ago[MC][ARM] Replace MCContext::reportFatalError call with reportError
Fangrui Song [Sat, 15 Jan 2022 08:13:49 +0000 (00:13 -0800)]
[MC][ARM] Replace MCContext::reportFatalError call with reportError

2 years ago[MC][PowerPC] Replace MCContext::reportFatalError calls with reportError
Fangrui Song [Sat, 15 Jan 2022 08:01:36 +0000 (00:01 -0800)]
[MC][PowerPC] Replace MCContext::reportFatalError calls with reportError

User errors should use reportError. reportError allows us to continue parsing
the file and collect more diagnostics.

While here, make the diagnostic follow convention, merge tests, and test
line/column numbers.

2 years ago[RISCV] Add test for vector extension
eopXD [Fri, 14 Jan 2022 21:00:07 +0000 (13:00 -0800)]
[RISCV] Add test for vector extension

It seems that D115709 have mis-deleted the whole testcase for vector
extension. This commit adds them back.

Reviewed By: craig.topper

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

2 years ago[NFC][msan] Track alignment in the test
Vitaly Buka [Sat, 15 Jan 2022 07:04:24 +0000 (23:04 -0800)]
[NFC][msan] Track alignment in the test

2 years agoRevert "[cmake] Use `GNUInstallDirs` to support custom installation dirs."
John Ericson [Sat, 15 Jan 2022 07:35:02 +0000 (07:35 +0000)]
Revert "[cmake] Use `GNUInstallDirs` to support custom installation dirs."

Sorry for the disruption, I will try again later.

This reverts commit efeb50197091b2ade24c00b9d55814bc433a7fd1.

2 years ago[RISCV] Add the zvl extension according to the v1.0 spec
eopXD [Sat, 23 Oct 2021 10:18:24 +0000 (03:18 -0700)]
[RISCV] Add the zvl extension according to the v1.0 spec

`zvl` is the new standard vector extension that specifies the minimum vector length of the vector extension.
The `zvl` extension is related to the `zve` extension and other updates that are added in v1.0.

According to https://github.com/riscv-non-isa/riscv-c-api-doc/pull/21,
Clang defines macro `__riscv_v_min_vlen` for `zvl` and it can be used for applications that uses the vector extension.
LLVM checks whether the option `riscv-v-vector-bits-min` (if specified) matches the `zvl*` extension specified.

Reviewed By: craig.topper

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

2 years ago[msan] Reset shadow of byval before call
Vitaly Buka [Fri, 14 Jan 2022 07:52:34 +0000 (23:52 -0800)]
[msan] Reset shadow of byval before call

If function is not sanitized we must reset shadow, not copy.

Depends on D117285

Reviewed By: kda, eugenis

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

2 years agoworkflows: Make issue-subscriber more robust for labels with special characters
Tom Stellard [Sat, 15 Jan 2022 01:08:01 +0000 (17:08 -0800)]
workflows: Make issue-subscriber more robust for labels with special characters

Also, replace the existing actionscript implementation with a python
script that can be run outside of GitHub Actions.  The intention is
that going forward, all github action functionality would be implemented
in this script.

Reviewed By: kwk

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

2 years ago[RISCV][NFC] Add IsRV64 predicate in xperm.w pattern
Lian Wang [Sat, 15 Jan 2022 04:04:56 +0000 (04:04 +0000)]
[RISCV][NFC] Add IsRV64 predicate in xperm.w pattern

Reviewed By: craig.topper

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

2 years agoRevert "[X86][MS] Change the alignment of f80 to 16 bytes on Windows 32bits to match...
Phoebe Wang [Sat, 15 Jan 2022 02:04:25 +0000 (10:04 +0800)]
Revert "[X86][MS] Change the alignment of f80 to 16 bytes on Windows 32bits to match with ICC"

This reverts commit 1bb0caf561688681be67cc91560348c9e43fcbf3.

2 years agoRevert "[X86][LLD] Update datelayout in LLD tests. NFCI"
Phoebe Wang [Sat, 15 Jan 2022 02:03:35 +0000 (10:03 +0800)]
Revert "[X86][LLD] Update datelayout in LLD tests. NFCI"

This reverts commit 9b43237128da0a7a3bc8a16f6f2c0897b9e842be.

2 years ago[NFCI][CMake] add space among flag sets in all_linker_flags_uppercase
Yuanfang Chen [Sat, 15 Jan 2022 02:42:03 +0000 (18:42 -0800)]
[NFCI][CMake] add space among flag sets in all_linker_flags_uppercase

Follow-up on 74bb4ad5d4eb0. It should not change behaviors but a good thing to
do.

2 years ago[LSR] Fix crash in Phi node with EHPad block
Quentin Colombet [Sat, 15 Jan 2022 02:49:50 +0000 (18:49 -0800)]
[LSR] Fix crash in Phi node with EHPad block

This fixes a crash I observed in issue #48708 where the LSR
pass tries to insert an instruction in a basic block with only a
catchswitch statement in there. This happens because the Phi node
being evaluated assumes the same value for different basic blocks.

If the basic block associated with the incoming value of the operand
being evaluated has an EHPad terminator LSR skips optimizing it.
But if that incoming value can come from multiple different blocks
there can be some incoming basic blocks which are terminated in
an EHPad. If these are then rewritten in RewriteForPhi the ones
containing an EHPad terminator will hit the "Insertion point must
be a normal instruction" assert in AdjustInsertPositionForExpand.

This fix makes CollectLoopInvariantFixupsAndFormulae also ignore
cases where the same value has another incoming basic block with an
EHPad, same as it already does in case the primary value has one.

Patch by Lorenz Brun <lorenz@brun.one>

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

2 years ago[RISCV] Add patterns for vector widening integer add/subtract
jacquesguan [Thu, 13 Jan 2022 07:41:21 +0000 (15:41 +0800)]
[RISCV] Add patterns for vector widening integer add/subtract

Add patterns for vector widening integer add/subtract instructions

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

2 years ago[BOLT][DWARF] Reduce overhead for sized dealloc
Alexander Yermolovich [Sat, 15 Jan 2022 01:25:30 +0000 (17:25 -0800)]
[BOLT][DWARF] Reduce overhead for sized dealloc

This is a follow up to Fix size mismatch error with jemalloc.
4243b6582cf3bb5fbcde908913d4779ded731321
Although that fix works it increased memory footprint.
With this patch we go back to original memory footprint.

Reviewed By: maksfb

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

2 years ago[msan] Clear byval shadow in ignored functions
Vitaly Buka [Fri, 14 Jan 2022 04:22:56 +0000 (20:22 -0800)]
[msan] Clear byval shadow in ignored functions

If function has no sanitize_memory we still reset shadow for nested calls.
The first return from getShadow() correctly returned shadow for argument,
but it didn't reset shadow of byval pointee.

Depends on D117277

Reviewed By: eugenis

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

2 years ago[RISCV] update zfh and zfhmin extention to v1.0
Shao-Ce SUN [Sat, 15 Jan 2022 01:11:58 +0000 (09:11 +0800)]
[RISCV] update zfh and zfhmin extention to v1.0

`zfh` and `zfhmin` have been ratified, with version 1.0.

Reviewed By: craig.topper

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

2 years agoenable noundef analysis with -fsanitize-memory-param-retval
Kevin Athey [Fri, 14 Jan 2022 10:12:57 +0000 (02:12 -0800)]
enable noundef analysis with -fsanitize-memory-param-retval

Enable noundef analysis (-enable-noundef-analysis) via the -fsanitize-memory-param-retval clang flag.
This completes the work found in:
  - https://reviews.llvm.org/D116855
  - https://reviews.llvm.org/D116633

Depends on D116633

Reviewed By: vitalybuka

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

2 years ago[cmake] Use `GNUInstallDirs` to support custom installation dirs.
John Ericson [Tue, 11 Jan 2022 05:35:14 +0000 (05:35 +0000)]
[cmake] Use `GNUInstallDirs` to support custom installation dirs.

This is the original patch in my GNUInstallDirs series, now last to merge as the final piece!

It arose as a new draft of D28234. I initially did the unorthodox thing of pushing to that when I wasn't the original author, but since I ended up

 - Using `GNUInstallDirs`, rather than mimicking it, as the original author was hesitant to do but others requested.

 - Converting all the packages, not just LLVM, effecting many more projects than LLVM itself.

I figured it was time to make a new revision.

I have used this patch series (and many back-ports) as the basis of https://github.com/NixOS/nixpkgs/pull/111487 for my distro (NixOS), which was merged last spring (2021). It looked like people were generally on board in D28234, but I make note of this here in case extra motivation is useful.

---

As pointed out in the original issue, a central tension is that LLVM already has some partial support for these sorts of things. Variables like `COMPILER_RT_INSTALL_PATH` have already been dealt with. Variables like `LLVM_LIBDIR_SUFFIX` however, will require further work, so that we may use `CMAKE_INSTALL_LIBDIR`.

These remaining items will be addressed in further patches. What is here is now rote and so we should get it out of the way before dealing more intricately with the remainder.

Reviewed By: #libunwind, #libc, #libc_abi, compnerd

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

2 years ago[NFC][msan] Consolidate clean shadow handling
Vitaly Buka [Fri, 14 Jan 2022 02:16:42 +0000 (18:16 -0800)]
[NFC][msan] Consolidate clean shadow handling

Depends on D117276

Reviewed By: kda, eugenis

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

2 years ago[NFC][msan] Don't setOrigin for byval pointer
Vitaly Buka [Fri, 14 Jan 2022 01:23:51 +0000 (17:23 -0800)]
[NFC][msan] Don't setOrigin for byval pointer

It's NFC because shadow of pointer is clean so origins will not be
propagated anyway.

Depends on D117275

Reviewed By: kda, eugenis

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

2 years agoTeach llvm-jitlink to support archives in inputs files and -load_hidden
Ben Langmuir [Fri, 14 Jan 2022 20:07:25 +0000 (12:07 -0800)]
Teach llvm-jitlink to support archives in inputs files and -load_hidden

Similar to the ld64 command-line options. These use the same underlying
mechanisms as -l and -hidden-l, but allow specifying an absolute path to
the archive. This is often more convenient for a one-off, or when adding
a new search path could change how existing -l options are resolved.

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

2 years ago[lldb/doc] Rephrase tutorial paragraph (NFC)
Med Ismail Bennani [Sat, 15 Jan 2022 00:21:10 +0000 (16:21 -0800)]
[lldb/doc] Rephrase tutorial paragraph (NFC)

Fixes #52694

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2 years ago[mlir][sparse] parameterize MTTKRP kernel
Aart Bik [Fri, 14 Jan 2022 19:08:57 +0000 (11:08 -0800)]
[mlir][sparse] parameterize MTTKRP kernel

Rather than hardcoding all constants, we now use the input tensor to drive the
code setup. Of course, we still need to hardcode dim-2 of A and the final
verification in CHECK is input dependent, but overall this sets a slightly
better example of tensor setup in general.

Reviewed By: bixia

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

2 years ago[lldb] Only promote -Wignored-attributes to an error
Jonas Devlieghere [Sat, 15 Jan 2022 00:15:43 +0000 (16:15 -0800)]
[lldb] Only promote -Wignored-attributes to an error

Avoid other warnings from failing the test, such as
-Wunused-command-line-argument in the downstream Swift fork.

2 years ago[flasg] Debug folding of substring references
Peter Klausler [Thu, 6 Jan 2022 21:31:37 +0000 (13:31 -0800)]
[flasg] Debug folding of substring references

Character substrings weren't being folded correctly;
add tests and rework the implementation so that substrings
of literals and named constant character scalars & arrays
are properly folded for use in constant expressions.

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

2 years ago[lldb] Fix platform selection on Apple Silicon
Jonas Devlieghere [Fri, 14 Jan 2022 07:10:22 +0000 (23:10 -0800)]
[lldb] Fix platform selection on Apple Silicon

Currently, when connecting to a remote iOS device from the command line
on Apple Silicon, we end up using the host platform (PlatfromMacOSX)
instead of remote-ios (PlatformRemoteiOS). This happens because
PlatfromMacOSX includes arm64-apple-ios and arm64e-apple-ios as
compatible architectures, presumably to support debugging iOS Apps on
Apple Silicon [1].

This is a problem for debugging remote ios devices, because the host
platform doesn't look for an expanded shared cache on disk and as a
result we end up reading everything from memory, incurring a significant
performance hit.

The crux of this patch is to make PlatfromMacOSX *not* compatible with
arm64(e)-apple-ios. This also means that we now use remote-ios
(PlatformRemoteiOS) as the platform for debugging iOS apps on Apple
Silicon. This has the (unintended) side effect that unlike we do for the
host platform, we no longer check our local shared cache, and incur a
performance hit on debugging these apps.

To avoid that, PlatformRemoteiOS now also check the local cache to
support this use case, which is cheap enough to do unconditionally for
PlatformRemoteiOS.

[1] https://support.apple.com/guide/app-store/iphone-ipad-apps-mac-apple-silicon-fird2c7092da/mac

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

2 years agoRevert "Skip exception cleanups when the innermost scope is EHTerminateScope."
James Y Knight [Fri, 14 Jan 2022 23:59:02 +0000 (18:59 -0500)]
Revert "Skip exception cleanups when the innermost scope is EHTerminateScope."

Breaks tests on some platforms. Reverting while investigating.

This reverts commit a4e255f9c6d4458fa6e70394af626f3b65e0a26d.

2 years ago[BOLT][NFC] Remove redundant dependent template type
Amir Ayupov [Fri, 14 Jan 2022 20:57:37 +0000 (12:57 -0800)]
[BOLT][NFC] Remove redundant dependent template type

Summary:
Reduce code size by removing redundant dependent template type
from RewriteInstance methods.

Code size savings (via bloaty on llvm-bolt Debug build):
```
symbol,vmsize,filesize -> vmsize,filesize (delta vmsize,filesize)
updateELFSymbolTable         57096,59600 -> 56656,59048 (440,552)
updateELFSymbolTable::lambda 35957,55277 -> 35949,54485   (8,792)
getOutputSections            20592,21440 -> 20372,21156 (220,284)
getOutputSections::lambda      1792,5300 ->   1792,5372   (0,-72)

total delta (668,1556)
```

Reviewed By: maksfb

FBD33589393

2 years ago[BOLT][CMAKE] Use IN_LIST check
Amir Ayupov [Fri, 14 Jan 2022 22:26:37 +0000 (14:26 -0800)]
[BOLT][CMAKE] Use IN_LIST check

Summary:
Address @smeenai feedback https://reviews.llvm.org/D117061#inline-1122106:
>CMake has if(IN_LIST) now, which you can use instead of the string(FIND)

IN_LIST is available since CMake 3.3 released in 2015.

Reviewed By: smeenai

FBD33590959

2 years ago[Hexagon] Fix optimize address mode pass only handle BaseImmOffset mode
Pranav Bhandarkar [Fri, 14 Jan 2022 23:42:10 +0000 (15:42 -0800)]
[Hexagon] Fix optimize address mode pass only handle BaseImmOffset mode

This is a fix for a crash in the HexagonOptAddrMode pass that was looking
for the third operand (offset) in the following instruction that does not,
in fact, have a third operand:

  $r1 = L2_loadw_locked $r1

Additionally, this patch also adds an addrMode value to vgather pseudos
in the Hexagon backend.

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

2 years agoclang/AMDGPU: Don't set implicit arg attribute to default size
Matt Arsenault [Sat, 4 Dec 2021 15:52:07 +0000 (10:52 -0500)]
clang/AMDGPU: Don't set implicit arg attribute to default size

Since 2959e082e1427647e107af0b82770682eaa58fe1, we conservatively
assume all inputs are enabled by default. This isn't the best
interface for controlling these anyway, since it's not granular and
only allows trimming the last fields.

2 years ago[flang] Accept ENTRY names in generic interfaces
Peter Klausler [Mon, 10 Jan 2022 18:16:19 +0000 (10:16 -0800)]
[flang] Accept ENTRY names in generic interfaces

ENTRY statement names in module subprograms were not acceptable for
use as a "module procedure" in a generic interface, but should be.
ENTRY statements need to have symbols with place-holding
SubprogramNameDetails created for them in order to be visible in
generic interfaces.  Those symbols are created from the "program
tree" data structure.  This patch adds ENTRY statement names to the
program tree data structure and uses them to generate SubprogramNameDetails
symbols.

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

2 years ago[NFC] Add additional tests for icmp predicate.
Nadav Rotem [Fri, 14 Jan 2022 23:22:10 +0000 (15:22 -0800)]
[NFC] Add additional tests for icmp predicate.

This commit adds small tests for the combination of:
{exact, no_exact} x { EQ, NE, UGT, UGE, ULT, ULE, SGT, SGE, SLT, SLE}

This is related to the changes in D117338.

2 years ago[flang] Don't blank-fill remaining lines in internal output
Peter Klausler [Wed, 5 Jan 2022 19:42:18 +0000 (11:42 -0800)]
[flang] Don't blank-fill remaining lines in internal output

Internal writes to character arrays should not blank-fill
records (elements) past the last one that was written to.

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

2 years ago[clang-format] Add experimental option to remove LLVM braces
Owen Pan [Mon, 13 Dec 2021 02:25:33 +0000 (18:25 -0800)]
[clang-format] Add experimental option to remove LLVM braces

See the style examples at:
https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements

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

2 years agoSkip exception cleanups when the innermost scope is EHTerminateScope.
James Y Knight [Wed, 10 Nov 2021 17:45:02 +0000 (12:45 -0500)]
Skip exception cleanups when the innermost scope is EHTerminateScope.

EHTerminateScope is used to implement C++ noexcept semantics. Per C++
[except.terminate], it is implemented-defined whether no, some, or all
cleanups are run prior to terminatation.

Therefore, the code to run cleanups on the way towards termination is
unnecessary, and may be omitted.

After this change, we will still run some cleanups: any cleanups in a
function called from the noexcept function will continue to run, while
those in the noexcept function itself will not.

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

2 years agoRegenerate some autogenerated test files ahead of modifying them.
James Y Knight [Sun, 14 Nov 2021 00:00:54 +0000 (19:00 -0500)]
Regenerate some autogenerated test files ahead of modifying them.

2 years ago[SROA] Bail out on PHIs in catchswitch BBs
Heejin Ahn [Wed, 12 Jan 2022 23:07:45 +0000 (15:07 -0800)]
[SROA] Bail out on PHIs in catchswitch BBs

In the process of rewriting `alloca`s and `phi`s that use them, the SROA
pass can try to insert a non-PHI instruction by calling
`getFirstInsertionPt()`, which is not possible in a catchswitch BB. This
CL makes we bail out on these cases.

Reviewed By: dschuff

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

2 years ago[scudo] Make Scudo compile for C++20
Kostya Kortchinsky [Fri, 14 Jan 2022 21:50:37 +0000 (13:50 -0800)]
[scudo] Make Scudo compile for C++20

In C++20 compound assignment to volatile (here `LocalData[I]++`) is
deprecated, so `mutex_test.cpp` fails to compile.

Simply changing it to `LocalData[I] = LocalData[I] + 1` fixes it.

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

2 years ago[flang] Signal runtime error on WRITE after ENDFILE
Peter Klausler [Fri, 7 Jan 2022 18:29:23 +0000 (10:29 -0800)]
[flang] Signal runtime error on WRITE after ENDFILE

After an ENDFILE statement, a WRITE is an error without
a prior BACKSPACE.  Also fix the return value for the case
of formatted integer input with no input digits to be false
(exposed by new test).

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

2 years agoRevert "[BasicAliasAnalysis] Remove isMallocOrCallocLikeFn"
Bryce Wilson [Fri, 14 Jan 2022 22:42:53 +0000 (14:42 -0800)]
Revert "[BasicAliasAnalysis] Remove isMallocOrCallocLikeFn"

This reverts commit 1f2cfc4fdc1eefb2c5f562c77a5fe7e916bbf670.

2 years ago[NFC][msan] Add byvals tests with known issues
Vitaly Buka [Fri, 14 Jan 2022 01:11:23 +0000 (17:11 -0800)]
[NFC][msan] Add byvals tests with known issues

Depends on D117274

Reviewed By: eugenis

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

2 years ago[LLDB] Skip TestIOHandlerPythonREPLSigint.py on AArch64/Linux
Muhammad Omair Javaid [Fri, 14 Jan 2022 22:23:20 +0000 (03:23 +0500)]
[LLDB] Skip TestIOHandlerPythonREPLSigint.py on AArch64/Linux

TestIOHandlerPythonREPLSigint.py is running falky on AArch64/Linux
buildbot failing randomly. Skipping it for AArch64/Linux as well.

2 years ago[flang] Legacy extension: non-character formats
Peter Klausler [Fri, 7 Jan 2022 01:03:40 +0000 (17:03 -0800)]
[flang] Legacy extension: non-character formats

Very old (pre-'77 standard) codes would use arrays initialized
with Hollerith literals, typically in DATA, as modifiable
formats.

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

2 years ago[BOLT][DWARF] Fix high pc patching
Vladislav Khmelevsky [Fri, 14 Jan 2022 22:03:42 +0000 (01:03 +0300)]
[BOLT][DWARF] Fix high pc patching

The DW_FORM_addr form of highPC address is written in absolute addres,
the data form is written in offset-from-low pc format.

Due to the large test binary the test is prepared separately in
https://github.com/rafaelauler/bolt-tests/pull/8

Vladislav Khmelevsky,
Advanced Software Technology Lab, Huawei

Reviewed By: ayermolo

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

2 years ago[NFC][SCEV] Introduce `getCastExpr()` QoL helper
Roman Lebedev [Fri, 14 Jan 2022 21:33:43 +0000 (00:33 +0300)]
[NFC][SCEV] Introduce `getCastExpr()` QoL helper

2 years agoComment parsing: Don't recognize commands in single-line double quotation
Aaron Puchert [Fri, 14 Jan 2022 21:45:59 +0000 (22:45 +0100)]
Comment parsing: Don't recognize commands in single-line double quotation

This is consistent with the behavior of Doxygen, and allows users to
write strings with C escapes or document input/output formats containing
special characters (@ or \) without escaping them, which might be
confusing. For example, if a function wants to document its expected
input format as "user@host" it doesn't have to write user\@host instead,
which would look right in the documentation but confusing in the code.
Now users can just use double quotes (which they might do anyway).

This fixes a lot of false positives of -Wdocumentation-unknown-command,
but it could also fix issues with -Wdocumentation if the text triggers
an actual command.

Reviewed By: gribozavr2

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

2 years agoComment parsing: Simplify Lexer::skipLineStartingDecorations (NFC)
Aaron Puchert [Fri, 14 Jan 2022 21:44:58 +0000 (22:44 +0100)]
Comment parsing: Simplify Lexer::skipLineStartingDecorations (NFC)

Inspection of the first character can just be handled by the loop as
well, it does exactly the same thing. Dereferencing the pointer a second
time shouldn't be an issue: the middle end can eliminate that second
read as it's separated from the first only by a pure function call.

Reviewed By: gribozavr2

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

2 years ago[libc] move strdup out of requiring SCUDO
Michael Jones [Wed, 12 Jan 2022 19:51:53 +0000 (11:51 -0800)]
[libc] move strdup out of requiring SCUDO

strdup needs either scudo enabled or fullbuild disabled, this properly
adds the second condition

Reviewed By: sivachandra, lntue

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

2 years ago[LoopInterchange] Enable interchange with multiple inner loop indvars
Congzhe Cao [Fri, 14 Jan 2022 20:42:00 +0000 (15:42 -0500)]
[LoopInterchange] Enable interchange with multiple inner loop indvars

Currently loop interchange only supports loops with one inner loop
induction variable. This patch adds support for transformation with
more than one inner loop induction variables. The induction PHIs and
induction increment instructions are moved/duplicated properly to the
new outer header and the new outer latch, respectively.

Reviewed By: bmahjour

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

2 years ago[NFC][msan] Reorder branches in complex if
Vitaly Buka [Fri, 14 Jan 2022 00:13:37 +0000 (16:13 -0800)]
[NFC][msan] Reorder branches in complex if

Reviewed By: eugenis

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