platform/upstream/llvm.git
3 years ago[mlir-tblgen] Add DagNode StaticMatcher.
Chia-hung Duan [Mon, 20 Sep 2021 22:59:56 +0000 (22:59 +0000)]
[mlir-tblgen] Add DagNode StaticMatcher.

Some patterns may share the common DAG structures. Generate a static
function to do the match logic to reduce the binary size.

Reviewed By: jpienaar

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

3 years agoUpdate MLIR generate-test-checks.py to add the notice from the source into the genera...
Mehdi Amini [Mon, 20 Sep 2021 17:28:01 +0000 (17:28 +0000)]
Update MLIR generate-test-checks.py to add the notice from the source into the generated file

Folks may not read the source of the tool and miss these instructions.

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

3 years ago[X86] Rename the X86WinAllocaExpander pass and related symbols to "DynAlloca". NFC.
Amara Emerson [Fri, 17 Sep 2021 18:47:32 +0000 (11:47 -0700)]
[X86] Rename the X86WinAllocaExpander pass and related symbols to "DynAlloca". NFC.

For x86 Darwin, we have a stack checking feature which re-uses some of this
machinery around stack probing on Windows. Renaming this to be more appropriate
for a generic feature.

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

3 years ago[mlir][tosa] Add several binary elementwise to the list of broadcastable ops.
natashaknk [Mon, 20 Sep 2021 23:07:13 +0000 (16:07 -0700)]
[mlir][tosa] Add several binary elementwise to the list of broadcastable ops.

Reviewed By: rsuderman

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

3 years ago[clang] Fix a few comment typos to cycle bots
Nico Weber [Mon, 20 Sep 2021 22:48:34 +0000 (18:48 -0400)]
[clang] Fix a few comment typos to cycle bots

3 years ago[mlir][tosa] Remove the documentation requirement for elements of several binary...
natashaknk [Mon, 20 Sep 2021 22:00:24 +0000 (15:00 -0700)]
[mlir][tosa] Remove the documentation requirement for elements of several binary elementwise ops to be of the same rank.

Reviewed By: rsuderman

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

3 years ago[AMDGPU][NFC] Correct typos in lib/Target/AMDGPU/AMDGPU*.cpp files. Test commit for...
Jacob Lambert [Mon, 20 Sep 2021 21:28:10 +0000 (14:28 -0700)]
[AMDGPU][NFC] Correct typos in lib/Target/AMDGPU/AMDGPU*.cpp files. Test commit for new contributor.

3 years ago[GlobalISel] Implement support for the "trap-func-name" attribute.
Amara Emerson [Mon, 20 Sep 2021 19:28:47 +0000 (12:28 -0700)]
[GlobalISel] Implement support for the "trap-func-name" attribute.

This attribute calls a function instead of emitting a trap instruction.

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

3 years agoSema: relax va_start checking further for Windows AArch64
Saleem Abdulrasool [Mon, 20 Sep 2021 21:19:25 +0000 (21:19 +0000)]
Sema: relax va_start checking further for Windows AArch64

When building in C mode, the VC runtime assumes that it can use pointer
aliasing through `char *` for the parameter to `__va_start`.  Relax the
checks further.  In theory we could keep the tests strict for non-system
header code, but this takes the less strict approach as the additional
check doesn't particularly end up being too much more helpful for
correctness.  The C++ type system is a bit stricter and requires the
explicit cast which we continue to verify.

3 years ago[OpenMP][NVPTX] Fix a warning that data argument not used by format string
Shilei Tian [Mon, 20 Sep 2021 21:22:04 +0000 (17:22 -0400)]
[OpenMP][NVPTX] Fix a warning that data argument not used by format string

Reviewed By: jhuber6, grokos

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

3 years ago[Polly] Partially fix scoped alias metadata
Nikita Popov [Mon, 20 Sep 2021 20:19:51 +0000 (22:19 +0200)]
[Polly] Partially fix scoped alias metadata

This partially addresses the verifier failures caused by D110026.
In particular, it does not fix the "second level" alias metadata.

3 years ago[NFC] [hwasan] Separate outline and inline instrumentation.
Florian Mayer [Mon, 20 Sep 2021 13:01:04 +0000 (14:01 +0100)]
[NFC] [hwasan] Separate outline and inline instrumentation.

Reviewed By: eugenis

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

3 years ago[RISCV] Add test cases for missed opportunities to use vand/vor/vxor.vx. NFC
Craig Topper [Mon, 20 Sep 2021 19:18:47 +0000 (12:18 -0700)]
[RISCV] Add test cases for missed opportunities to use vand/vor/vxor.vx. NFC

These are cases were the splat is in another basic block. CGP
needs to sink it to expose the opportunity to SelectionDAG.

3 years ago[DebugInfo] Add test for dumping DW_AT_defaulted
Paul Robinson [Mon, 20 Sep 2021 20:43:37 +0000 (16:43 -0400)]
[DebugInfo] Add test for dumping DW_AT_defaulted

3 years agoRevert "Fix CLANG_ENABLE_STATIC_ANALYZER=OFF building all analyzer source"
Nico Weber [Mon, 20 Sep 2021 20:18:03 +0000 (16:18 -0400)]
Revert "Fix CLANG_ENABLE_STATIC_ANALYZER=OFF building all analyzer source"

This reverts commit 6d7b3d6b3a8dbd62650b6c3dae1fe904a8ae9048.
Breaks running cmake with `-DCLANG_ENABLE_STATIC_ANALYZER=OFF`
without turning off CLANG_TIDY_ENABLE_STATIC_ANALYZER.
See comments on https://reviews.llvm.org/D109611 for details.

3 years ago[cmake] Put check from D110016 behind (default-on) flag
Nico Weber [Mon, 20 Sep 2021 19:06:00 +0000 (15:06 -0400)]
[cmake] Put check from D110016 behind (default-on) flag

See discussion on https://reviews.llvm.org/D110016 for details.

3 years ago[RISCV] Teach RISCVTargetLowering::shouldSinkOperands to sink splats for FMA.
Craig Topper [Mon, 20 Sep 2021 18:48:54 +0000 (11:48 -0700)]
[RISCV] Teach RISCVTargetLowering::shouldSinkOperands to sink splats for FMA.

If either of the multiplicands is a splat, we can sink it to use
vfmacc.vf or similar.

3 years ago[RISCV] Add test cases for missed opportunity to use vfmacc.vf. NFC
Craig Topper [Mon, 20 Sep 2021 18:40:03 +0000 (11:40 -0700)]
[RISCV] Add test cases for missed opportunity to use vfmacc.vf. NFC

This is another case of a splat being in another basic block
preventing SelectionDAG from optimizing it.

3 years ago[libc++] [P0919] Some belated review on D87171.
Arthur O'Dwyer [Tue, 31 Aug 2021 17:04:29 +0000 (13:04 -0400)]
[libc++] [P0919] Some belated review on D87171.

- Simplify the structure of the new tests.
- Test const containers as well as non-const containers,
    since it's easy to do so.
- Remove redundant enable-iffing of helper structs' member functions.
    (They're not instantiated unless they're called, and who would call them?)
- Fix indentation and use more consistent SFINAE method in <unordered_map>.
- Add _LIBCPP_INLINE_VISIBILITY on some swap functions.

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

3 years ago[libc++] [LIBCXX-DEBUG-FIXME] Constexpr char_traits::copy mustn't compare unrelated...
Arthur O'Dwyer [Wed, 21 Apr 2021 02:24:24 +0000 (22:24 -0400)]
[libc++] [LIBCXX-DEBUG-FIXME] Constexpr char_traits::copy mustn't compare unrelated pointers.

Now that __builtin_is_constant_evaluated() is present on all supported
compilers, we can use it to skip the UB-inducing assert in cases where
the computation might be happening at constexpr time.

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

3 years ago[lldb][NFC] Remove outdated FIXME
Alex Langford [Mon, 20 Sep 2021 18:43:52 +0000 (11:43 -0700)]
[lldb][NFC] Remove outdated FIXME

3 years ago[gn build] Don't pass -Wl,-z,defs for sanitizer builds
Arthur Eubanks [Mon, 20 Sep 2021 17:42:07 +0000 (10:42 -0700)]
[gn build] Don't pass -Wl,-z,defs for sanitizer builds

-Wl,-z,defs doesn't work with sanitizers.
See https://clang.llvm.org/docs/AddressSanitizer.html

Reviewed By: thakis

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

3 years ago[IR] Add helper to convert offset to GEP indices
Nikita Popov [Sun, 19 Sep 2021 15:32:35 +0000 (17:32 +0200)]
[IR] Add helper to convert offset to GEP indices

We implement logic to convert a byte offset into a sequence of GEP
indices for that offset in a number of places. This patch adds a
DataLayout::getGEPIndicesForOffset() method, which implements the
core logic. I've updated SROA, ConstantFolding and InstCombine to
use it, and there's a few more places where it looks relevant.

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

3 years ago[mlir][MemRef] Compute unused dimensions of a rank-reducing subviews using strides...
MaheshRavishankar [Mon, 20 Sep 2021 18:04:15 +0000 (11:04 -0700)]
[mlir][MemRef] Compute unused dimensions of a rank-reducing subviews using strides as well.

For `memref.subview` operations, when there are more than one
unit-dimensions, the strides need to be used to figure out which of
the unit-dims are actually dropped.

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

3 years ago[OpenMP][host runtime] Fix indirect lock table race condition
Peyton, Jonathan L [Mon, 13 Sep 2021 20:44:04 +0000 (15:44 -0500)]
[OpenMP][host runtime] Fix indirect lock table race condition

The indirect lock table can exhibit a race condition during initializing
and setting/unsetting locks. This occurs if the lock table is
resized by one thread (during an omp_init_lock) and accessed (during an
omp_set|unset_lock) by another thread.

The test runtime/test/lock/omp_init_lock.c test exposed this issue and
will fail if run enough times.

This patch restructures the lock table so pointer/iterator validity is
always kept. Instead of reallocating a single table to a larger size, the
lock table begins preallocated to accommodate 8K locks. Each row of the
table is allocated as needed with each row allowing 1K locks. If the 8K
limit is reached for the initial table, then another table, capable of
holding double the number of locks, is allocated and linked
as the next table. The indices stored in the user's locks take this
linked structure into account when finding the lock within the table.

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

3 years agoFix bad merge the removed switch case
Geoffrey Martin-Noble [Mon, 20 Sep 2021 17:58:58 +0000 (10:58 -0700)]
Fix bad merge the removed switch case

When https://reviews.llvm.org/D109520 was landed, it reverted the addition of this switch
case added in https://reviews.llvm.org/D109293. This caused `-Wswitch` failures (and
presumably broke the functionality added in the latter patch).

3 years agoDiagnose -Wunused-value based on CFG reachability
Yuanfang Chen [Thu, 24 Jun 2021 06:46:42 +0000 (23:46 -0700)]
Diagnose -Wunused-value based on CFG reachability

While at it, add the diagnosis message "left operand of comma operator has no effect" (used by GCC) for comma operator.

This also makes Clang diagnose in the constant evaluation context which aligns with GCC/MSVC behavior. (https://godbolt.org/z/7zxb8Tx96)

Reviewed By: aaron.ballman

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

3 years ago[mlir][Linalg] Add ConvolutionOpInterface.
MaheshRavishankar [Mon, 20 Sep 2021 17:40:31 +0000 (10:40 -0700)]
[mlir][Linalg] Add ConvolutionOpInterface.

Add an interface that allows grouping together all covolution and
pooling ops within Linalg named ops. The interface currently
- the indexing map used for input/image access is valid
- the filter and output are accessed using projected permutations
- that all loops are charecterizable as one iterating over
  - batch dimension,
  - output image dimensions,
  - filter convolved dimensions,
  - output channel dimensions,
  - input channel dimensions,
  - depth multiplier (for depthwise convolutions)

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

3 years agoRevert "[CMake] Add debuginfo-tests to LLVM_ALL_PROJECTS after D110016"
Fangrui Song [Mon, 20 Sep 2021 17:32:19 +0000 (10:32 -0700)]
Revert "[CMake] Add debuginfo-tests to LLVM_ALL_PROJECTS after D110016"

This reverts commit 4b80f0125adc876c8ef325f1c0ace4af023f2264.

debuginfo-tests has been renamed to cross-project-tests.

3 years agoRevert code change of D63497 & D74399 for riscv64-*-linux GCC detection
Fangrui Song [Mon, 20 Sep 2021 17:28:32 +0000 (10:28 -0700)]
Revert code change of D63497 & D74399 for riscv64-*-linux GCC detection

This partially reverts commits 1fc2a47f0b6c415312593e43489cf9ea2507d902 and 9816e726e747d72e0c5ac92aa20e652031a10448.

See D109727. Replacing config.guess in favor of {gcc,clang} -dumpmachine
can avoid the riscv64-{redhat,suse}-linux GCC detection.

Acked-by: Luís Marques <luismarques@lowrisc.org>
3 years agoEliminate _LIBCPP_EQUAL_DELETE in favor of `=delete`.
Arthur O'Dwyer [Fri, 17 Sep 2021 02:47:36 +0000 (22:47 -0400)]
Eliminate _LIBCPP_EQUAL_DELETE in favor of `=delete`.

All supported compilers have supported `=delete` as an extension
in C++03 mode for many years at this point.

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

3 years ago[RISCV] Teach RISCVTargetLowering::shouldSinkOperands to sink splats for FAdd/FSub...
Craig Topper [Mon, 20 Sep 2021 17:21:42 +0000 (10:21 -0700)]
[RISCV] Teach RISCVTargetLowering::shouldSinkOperands to sink splats for FAdd/FSub/FMul/FDiv.

3 years ago[RISCV] Add test cases showing failure to use .vf vector operations when splat is...
Craig Topper [Mon, 20 Sep 2021 17:13:20 +0000 (10:13 -0700)]
[RISCV] Add test cases showing failure to use .vf vector operations when splat is in another basic block. NFC

We should have CGP copy the splats into the same basic block as the
FP operation so that SelectionDAG can fold them.

3 years ago[lldb][crashlog] Avoid specifying arch for image when a UUID is present
Vedant Kumar [Fri, 17 Sep 2021 23:07:42 +0000 (16:07 -0700)]
[lldb][crashlog] Avoid specifying arch for image when a UUID is present

When adding an image to a target for crashlog purposes, avoid specifying
the architecture of the image.

This has the effect of making SBTarget::AddModule infer the ArchSpec for
the image based on the SBTarget's architecture, which LLDB puts serious
effort into calculating correctly (in TargetList::CreateTargetInternal).

The status quo is that LLDB randomly guesses the ArchSpec for a module
if its architecture is specified, via:

```
  SBTarget::AddModule -> Platform::GetAugmentedArchSpec -> Platform::IsCompatibleArchitecture ->
GetSupportedArchitectureAtIndex -> {ARM,x86}GetSupportedArchitectureAtIndex
```

... which means that the same crashlog can fail to load on an Apple
Silicon Mac (due to the random guess of arm64e-apple-macosx for the
module's ArchSpec not being compatible with the SBTarget's (correct)
ArchSpec), while loading just fine on an Intel Mac.

I'm not sure how to add a test for this (it doesn't look like there's
test coverage of this path in-tree). It seems like it would be pretty
complicated to regression test: the host LLDB would need to be built for
arm64e, we'd need a hand-crafted arm64e iOS crashlog, and we'd need a
binary with an iOS deployment target. I'm open to other / simpler
options.

rdar://82679400

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

3 years ago[NCF][OpenMP] Fix metadirective test on SystemZ
cchen [Mon, 20 Sep 2021 17:22:21 +0000 (12:22 -0500)]
[NCF][OpenMP] Fix metadirective test on SystemZ

3 years agoRevert "[MLIR][SCF] Add for-to-while loop transformation pass"
Mehdi Amini [Mon, 20 Sep 2021 17:21:59 +0000 (17:21 +0000)]
Revert "[MLIR][SCF] Add for-to-while loop transformation pass"

This reverts commit 644b55d57ec76a18916d30f921781b99795f6e10.

The added test is failing the bots.

3 years agoTemporarily XFAIL MLIR test that fails the LLVM verifier after 8700f2bd3
Mehdi Amini [Mon, 20 Sep 2021 17:19:25 +0000 (17:19 +0000)]
Temporarily XFAIL MLIR test that fails the LLVM verifier after 8700f2bd3

3 years agoAdd use_default_shell_env = True to ctx.actions.run
Alexander Grund [Mon, 20 Sep 2021 17:04:23 +0000 (10:04 -0700)]
Add use_default_shell_env = True to ctx.actions.run

When building a tool in a non-standard environment (e.g. custom
compiler path -> LD_LIBRARY_PATH set) then
`use_default_shell_env = True` is required to run that tool in the same
environment or otherwise the build will fail due to missing symbols.
See https://github.com/google/jax/issues/7842 for this issue and
https://github.com/tensorflow/tensorflow/pull/44549 for related fix in
TF.

Reviewed By: GMNGeoffrey

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

3 years ago[lld] Remove timers.ll because inconsistent timers behavior causes the test to fail...
Amy Huang [Mon, 20 Sep 2021 16:54:48 +0000 (09:54 -0700)]
[lld] Remove timers.ll because inconsistent timers behavior causes the test to fail sometimes

See https://reviews.llvm.org/D109904

3 years ago[ELF] Add --why-extract= to query why archive members/lazy object files are extracted
Fangrui Song [Mon, 20 Sep 2021 16:52:30 +0000 (09:52 -0700)]
[ELF] Add --why-extract= to query why archive members/lazy object files are extracted

Similar to D69607 but for archive member extraction unrelated to GC. This patch adds --why-extract=.

Prior art:

GNU ld -M prints
```
Archive member included to satisfy reference by file (symbol)

a.a(a.o)                      main.o (a)
b.a(b.o)                      (b())
```

-M is mainly for input section/symbol assignment <-> output section mapping
(often huge output) and the information may appear ad-hoc.

Apple ld64
```
__Z1bv forced load of b.a(b.o)
_a forced load of a.a(a.o)
```

It doesn't say the reference file.

Arm's proprietary linker
```
Selecting member vsnprintf.o(c_wfu.l) to define vsnprintf.
...
Loading member vsnprintf.o from c_wfu.l.
              definition:  vsnprintf
              reference :  _printf_a
```

---

--why-extract= gives the user the full data (which is much shorter than GNU ld
-Map). It is easy to track a chain of references to one archive member with a
one-liner, e.g.

```
% ld.lld main.o a_b.a b_c.a c.a -o /dev/null --why-extract=- | tee stdout
reference       extracted       symbol
main.o  a_b.a(a_b.o)    a
a_b.a(a_b.o)    b_c.a(b_c.o)    b()
b_c.a(b_c.o)    c.a(c.o)        c()

% ruby -ane 'BEGIN{p={}}; p[$F[1]]=[$F[0],$F[2]] if $.>1; END{x="c.a(c.o)"; while y=p[x]; puts "#{y[0]} extracts #{x} to resolve #{y[1]}"; x=y[0] end}' stdout
b_c.a(b_c.o) extracts c.a(c.o) to resolve c()
a_b.a(a_b.o) extracts b_c.a(b_c.o) to resolve b()
main.o extracts a_b.a(a_b.o) to resolve a
```

Archive member extraction happens before --gc-sections, so this may not be a live path
under --gc-sections, but I think it is a good approximation in practice.

* Specifying a file avoids output interleaving with --verbose.
* Required `=` prevents accidental overwrite of an input if the user forgets `=`. (Most of compiler drivers' long options accept `=` but not ` `)

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

3 years ago[Verifier] Try to fix MSVC build
Nikita Popov [Mon, 20 Sep 2021 16:45:36 +0000 (18:45 +0200)]
[Verifier] Try to fix MSVC build

Some buildbots fail with:

> C:\a\llvm-clang-x86_64-expensive-checks-win\llvm-project\llvm\lib\IR\Verifier.cpp(4352): error C2678: binary '==': no operator found which takes a left-hand operand of type 'const llvm::MDOperand' (or there is no acceptable conversion)

Possibly the explicit MDOperand to Metadata* conversion will help?

3 years ago[MCA] Fix a warning
Kazu Hirata [Mon, 20 Sep 2021 16:46:38 +0000 (09:46 -0700)]
[MCA] Fix a warning

This patch fixes the warning

  InstructionTables.cpp:27:56: error: loop variable 'Resource' of type
  'const std::pair<const uint64_t, ResourceUsage> &' (aka 'const
  pair<const unsigned long, llvm::mca::ResourceUsage> &') binds to a
  temporary constructed from type 'const std::pair<unsigned long,
  llvm::mca::ResourceUsage> &' [-Werror,-Wrange-loop-construct]

Note that Resource is declared as:

   SmallVector<std::pair<uint64_t, ResourceUsage>, 4> Resources;

without "const" for uint64_t.

3 years ago[gn build] Port d85e347a28dc
LLVM GN Syncbot [Mon, 20 Sep 2021 16:39:59 +0000 (16:39 +0000)]
[gn build] Port d85e347a28dc

3 years ago[RISCV] Add a pass to recognize VLS strided loads/store from gather/scatter.
Craig Topper [Mon, 20 Sep 2021 16:31:14 +0000 (09:31 -0700)]
[RISCV] Add a pass to recognize VLS strided loads/store from gather/scatter.

For strided accesses the loop vectorizer seems to prefer creating a
vector induction variable with a start value of the form
<i32 0, i32 1, i32 2, ...>. This value will be incremented each
loop iteration by a splat constant equal to the length of the vector.
Within the loop, arithmetic using splat values will be done on this
vector induction variable to produce indices for a vector GEP.

This pass attempts to dig through the arithmetic back to the phi
to create a new scalar induction variable and a stride. We push
all of the arithmetic out of the loop by folding it into the start,
step, and stride values. Then we create a scalar GEP to use as the
base pointer for a strided load or store using the computed stride.
Loop strength reduce will run after this pass and can do some
cleanups to the scalar GEP and induction variable.

Reviewed By: frasercrmck

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

3 years ago[ELF] Don't fall back to .text for e_entry
Fangrui Song [Mon, 20 Sep 2021 16:35:12 +0000 (09:35 -0700)]
[ELF] Don't fall back to .text for e_entry

We have the rule to simulate
(https://sourceware.org/binutils/docs/ld/Entry-Point.html),
but the behavior is questionable
(https://sourceware.org/pipermail/binutils/2021-September/117929.html).

gold doesn't fall back to .text.
The behavior is unlikely relied by projects (there is even a warning for
executable links), so let's just delete this fallback path.

Reviewed By: jhenderson, peter.smith

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

3 years ago[Verifier] Verify scoped noalias metadata
Nikita Popov [Thu, 16 Sep 2021 20:16:57 +0000 (22:16 +0200)]
[Verifier] Verify scoped noalias metadata

Verify that !noalias, !alias.scope and llvm.experimental.noalias.scope
arguments have the format specified in
https://llvm.org/docs/LangRef.html#noalias-and-alias-scope-metadata.
I've fixed up a lot of broken metadata used by tests in advance.
Especially using a scope instead of the expected scope list is a
commonly made mistake.

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

3 years ago[lldb] Extract adding symbols for UUID/File/Frame (NFC)
Jonas Devlieghere [Mon, 20 Sep 2021 15:53:20 +0000 (08:53 -0700)]
[lldb] Extract adding symbols for UUID/File/Frame (NFC)

This moves the logic for adding symbols based on UUID, file and frame
into little helper functions. This is in preparation for D110011.

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

3 years ago[lldb] Fix whitespace in CommandObjectTarget (NFC)
Jonas Devlieghere [Fri, 17 Sep 2021 19:41:23 +0000 (12:41 -0700)]
[lldb] Fix whitespace in CommandObjectTarget (NFC)

3 years ago[DSE] Add additional tests to cover review comments.
Florian Hahn [Mon, 20 Sep 2021 14:41:28 +0000 (15:41 +0100)]
[DSE] Add additional tests to cover review comments.

Adds additional tests following comments from D109844.

Also removes unusued in.ptr arguments and places in the call tests that
used loads instead of a getval call.

3 years ago[mlir][linalg] Add IndexOp support to fusion on tensors.
Tobias Gysi [Mon, 20 Sep 2021 15:49:15 +0000 (15:49 +0000)]
[mlir][linalg] Add IndexOp support to fusion on tensors.

This revision depends on https://reviews.llvm.org/D109761 and https://reviews.llvm.org/D109766.

Reviewed By: nicolasvasilache

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

3 years ago[MLIR][SCF] Add for-to-while loop transformation pass
Morten Borup Petersen [Fri, 20 Aug 2021 08:49:56 +0000 (09:49 +0100)]
[MLIR][SCF] Add for-to-while loop transformation pass

This pass transforms SCF.ForOp operations to SCF.WhileOp. The For loop condition is placed in the 'before' region of the while operation, and indctuion variable incrementation + the loop body in the 'after' region. The loop carried values of the while op are the induction variable (IV) of the for-loop + any iter_args specified for the for-loop.
Any 'yield' ops in the for-loop are rewritten to additionally yield the (incremented) induction variable.

This transformation is useful for passes where we want to consider structured control flow solely on the basis of a loop body and the computation of a loop condition. As an example, when doing high-level synthesis in CIRCT, the incrementation of an IV in a for-loop is "just another part" of a circuit datapath, and what we really care about is the distinction between our datapath and our control logic (the condition variable).

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

3 years ago[mlir][linalg] Fix typo (NFC).
Tobias Gysi [Mon, 20 Sep 2021 15:44:41 +0000 (15:44 +0000)]
[mlir][linalg] Fix typo (NFC).

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

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

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

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

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

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

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

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

3 years ago[flang] Put intrinsic function table back into order
peter klausler [Wed, 15 Sep 2021 23:41:26 +0000 (16:41 -0700)]
[flang] Put intrinsic function table back into order

Some intrinsic functions weren't findable because the table
wasn't strictly in order of names.

And complete a missing generalization of the extension DCONJG
to accept any kind of complex argument, like DREAL and DIMAG
were.

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

3 years ago[X86] Always check the size of SourceTy before getting the next type
Wang, Pengfei [Mon, 20 Sep 2021 14:52:59 +0000 (22:52 +0800)]
[X86] Always check the size of SourceTy before getting the next type

D109607 results in a regression in llvm-test-suite.
The reason is we didn't check the size of SourceTy, so that we will
return wrong SSE type when SourceTy is overlapped.

Reviewed By: Meinersbur

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

3 years ago[X86] Add test to show the effect caused by D109607. NFC
Wang, Pengfei [Sun, 19 Sep 2021 14:38:12 +0000 (22:38 +0800)]
[X86] Add test to show the effect caused by D109607. NFC

3 years ago[OpenCL] Supports atomics in C++ for OpenCL 2021
Justas Janickas [Tue, 7 Sep 2021 16:13:05 +0000 (17:13 +0100)]
[OpenCL] Supports atomics in C++ for OpenCL 2021

Atomics in C++ for OpenCL 2021 are now handled the same way as in
OpenCL C 3.0. This is a header-only change.

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

3 years ago[clangd] Bail-out when an empty compile flag is encountered
Kadir Cetinkaya [Thu, 16 Sep 2021 15:43:15 +0000 (17:43 +0200)]
[clangd] Bail-out when an empty compile flag is encountered

Fixes https://github.com/clangd/clangd/issues/865

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

3 years ago[mlir][linalg] Fusion on tensors.
Tobias Gysi [Mon, 20 Sep 2021 14:16:26 +0000 (14:16 +0000)]
[mlir][linalg] Fusion on tensors.

Add a new version of fusion on tensors that supports the following scenarios:
- support input and output operand fusion
- fuse a producer result passed in via tile loop iteration arguments (update the tile loop iteration arguments)
- supports only linalg operations on tensors
- supports only scf::for
- cannot add an output to the tile loop nest

The LinalgTileAndFuseOnTensors pass tiles the root operation and fuses its producers.

Reviewed By: nicolasvasilache, mravishankar

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

3 years ago[analyzer] Move docs of SmartPtr to correct subcategory
Deep Majumder [Mon, 20 Sep 2021 14:42:26 +0000 (20:12 +0530)]
[analyzer] Move docs of SmartPtr to correct subcategory

The docs of alpha.cplusplus.SmartPtr was incorrectly placed under
alpha.deadcode. Moved it to under alpha.cplusplus

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

3 years ago[Analysis] Add support for vscale in computeKnownBitsFromOperator
David Sherwood [Thu, 16 Sep 2021 13:19:55 +0000 (14:19 +0100)]
[Analysis] Add support for vscale in computeKnownBitsFromOperator

In ValueTracking.cpp we use a function called
computeKnownBitsFromOperator to determine the known bits of a value.
For the vscale intrinsic if the function contains the vscale_range
attribute we can use the maximum and minimum values of vscale to
determine some known zero and one bits. This should help to improve
code quality by allowing certain optimisations to take place.

Tests added here:

  Transforms/InstCombine/icmp-vscale.ll

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

3 years ago[AMDGPU] Regenerate checks
Jay Foad [Mon, 20 Sep 2021 13:21:55 +0000 (14:21 +0100)]
[AMDGPU] Regenerate checks

3 years ago[JITLink] Adopt forEachRelocation() helper in ELF RISCV backend (NFC)
Stefan Gränitz [Mon, 20 Sep 2021 13:22:15 +0000 (15:22 +0200)]
[JITLink] Adopt forEachRelocation() helper in ELF RISCV backend (NFC)

Following D109516, this patch re-uses the new helper function for ELF relocation traversal in the RISCV backend.

Reviewed By: StephenFan

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

3 years ago[JITLink] Adopt forEachRelocation() helper in ELF x86-64 backend (NFC)
Stefan Gränitz [Mon, 20 Sep 2021 13:21:34 +0000 (15:21 +0200)]
[JITLink] Adopt forEachRelocation() helper in ELF x86-64 backend (NFC)

Following D109516, this patch re-uses the new helper function for ELF relocation traversal in the x86-64 backend.

Reviewed By: StephenFan

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

3 years agoThread safety analysis: Drop special block handling
Aaron Puchert [Mon, 20 Sep 2021 13:20:09 +0000 (15:20 +0200)]
Thread safety analysis: Drop special block handling

Previous changes like D101202 and D104261 have eliminated the special
status that break and continue once had, since now we're making
decisions purely based on the structure of the CFG without regard for
the underlying source code constructs.

This means we don't gain anything from defering handling for these
blocks. Dropping it moves some diagnostics, though arguably into a
better place. We're working around a "quirk" in the CFG that perhaps
wasn't visible before: while loops have an empty "transition block"
where continue statements and the regular loop exit meet, before
continuing to the loop entry. To get a source location for that, we
slightly extend our handling for empty blocks. The source location for
the transition ends up to be the loop entry then, but formally this
isn't a back edge. We pretend it is anyway. (This is safe: we can always
treat edges as back edges, it just means we allow less and don't modify
the lock set. The other way around it wouldn't be safe.)

Reviewed By: aaron.ballman

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

3 years ago[lldb] [DynamicRegisterInfo] Unset value_regs/invalidate_regs before Finalize()
Michał Górny [Sat, 18 Sep 2021 13:25:32 +0000 (15:25 +0200)]
[lldb] [DynamicRegisterInfo] Unset value_regs/invalidate_regs before Finalize()

Set value_regs and invalidate_regs in RegisterInfo pushed onto m_regs
to nullptr, to ensure that the temporaries passed there are not
accidentally used.

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

3 years ago[lldb] [test] Add unittest for DynamicRegisterInfo::Finalize()
Michał Górny [Thu, 16 Sep 2021 18:52:02 +0000 (20:52 +0200)]
[lldb] [test] Add unittest for DynamicRegisterInfo::Finalize()

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

3 years ago[Clang] [Fix] Clang build fails when build directory contains space character
Brain Swift [Mon, 20 Sep 2021 12:45:35 +0000 (18:15 +0530)]
[Clang] [Fix] Clang build fails when build directory contains space character

Clang build fails when build directory contains space character.

Error messages:

[ 95%] Linking CXX executable ../../../../bin/clang
clang: error: no such file or directory: 'Space/Net/llvm/Build/tools/clang/tools/driver/Info.plist'
make[2]: *** [bin/clang-14] Error 1
make[1]: *** [tools/clang/tools/driver/CMakeFiles/clang.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

The path name is actually:
  'Dev Space/Net/llvm/Build/tools/clang/tools/driver/Info.plist'

Bugzilla issue - https://bugs.llvm.org/show_bug.cgi?id=51884
Reporter and patch author - Brain Swift <bsp2bsp-llvm@yahoo.com>

Reviewed By: aaron.ballman

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

3 years ago[ARM] MVE reverse shuffles.
David Green [Mon, 20 Sep 2021 12:48:01 +0000 (13:48 +0100)]
[ARM] MVE reverse shuffles.

The vectorizer can sometimes make reverse shuffles from indices that
count down. In MVE, we don't have a 128bit rev instruction, but we can
select this to a VREV64 with some lane movs to swap the two halfs.

Ideally this would use VMOVD's, but only gets as far as VMOVS's at the
moment.

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

3 years ago[update_mir_test_checks.py] Use -NEXT FileCheck directories
Alex Richardson [Mon, 20 Sep 2021 11:33:33 +0000 (12:33 +0100)]
[update_mir_test_checks.py] Use -NEXT FileCheck directories

Previously the script emitted output using plain CHECK directives. This
can result in a test passing even if there are some instructions between
CHECK directives that should have been removed. It also makes debugging
tests that have the output in a different order more difficult since
FileCheck can match with a later line and then complain about the "wrong"
directive not being found.

This will cause quite large diffs when updating existing tests, but I'm not sure we need an opt-in flag here.

Depends on D109765 (pre-commit tests)

Reviewed By: MaskRay

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

3 years agopre-commit test for D109767
Alex Richardson [Mon, 20 Sep 2021 11:33:25 +0000 (12:33 +0100)]
pre-commit test for D109767

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

3 years agoFix CLANG_ENABLE_STATIC_ANALYZER=OFF building all analyzer source
Alex Richardson [Mon, 20 Sep 2021 11:32:56 +0000 (12:32 +0100)]
Fix CLANG_ENABLE_STATIC_ANALYZER=OFF building all analyzer source

Since https://reviews.llvm.org/D87118, the StaticAnalyzer directory is
added unconditionally. In theory this should not cause the static analyzer
sources to be built unless they are referenced by another target. However,
the clang-cpp target (defined in clang/tools/clang-shlib) uses the
CLANG_STATIC_LIBS global property to determine which libraries need to
be included. To solve this issue, this patch avoids adding libraries to
that property if EXCLUDE_FROM_ALL is set.

In case something like this comes up again: `cmake --graphviz=targets.dot`
is quite useful to see why a target is included as part of `ninja all`.

Reviewed By: thakis

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

3 years agoMachOObjectFile - checkOverlappingElement - use const-ref to avoid unnecessary copies...
Simon Pilgrim [Fri, 17 Sep 2021 16:47:28 +0000 (17:47 +0100)]
MachOObjectFile - checkOverlappingElement - use const-ref to avoid unnecessary copies. NFCI.

Reported by MSVC static analyzer.

3 years ago[X86] X86TargetTransformInfo - remove unnecessary if-else after early exit. NFCI.
Simon Pilgrim [Fri, 17 Sep 2021 15:25:30 +0000 (16:25 +0100)]
[X86] X86TargetTransformInfo - remove unnecessary if-else after early exit. NFCI.

(style) Break the if-else chain as they all return.

3 years ago[MCA] InstructionTables::execute() - use const-ref iterator in for-range loop. NFCI.
Simon Pilgrim [Fri, 17 Sep 2021 15:22:55 +0000 (16:22 +0100)]
[MCA] InstructionTables::execute() - use const-ref iterator in for-range loop. NFCI.

Avoid unnecessary copies, reported by MSVC static analyzer.

3 years ago[mlir][openacc] Make use of the second counter extension in DataOp translation
Valentin Clement [Thu, 22 Jul 2021 01:47:54 +0000 (21:47 -0400)]
[mlir][openacc] Make use of the second counter extension in DataOp translation

Make use of runtime extension for the second reference counter used in
structured data region. This extension is implemented in D106510 and D106509.

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

3 years ago[lldb] [gdb-remote] Always send PID when detaching w/ multiprocess
Michał Górny [Sun, 19 Sep 2021 11:02:31 +0000 (13:02 +0200)]
[lldb] [gdb-remote] Always send PID when detaching w/ multiprocess

Always send PID in the detach packet when multiprocess extensions are
enabled.  This is required by qemu's GDB server, as plain 'D' packet
results in an error and the emulated system is not resumed.

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

3 years ago[GlobalISel] Improve elimination of dead instructions in legalizer
Petar Avramovic [Mon, 20 Sep 2021 11:00:13 +0000 (13:00 +0200)]
[GlobalISel] Improve elimination of dead instructions in legalizer

Add eraseInstr(s) utility functions. Before deleting an instruction
collects its use instructions. After deletion deletes use instructions
that became trivially dead.
This patch clears all dead instructions in existing legalizer mir tests.

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

3 years ago[NewPM] Make InlinerPass (aka 'inline') a parameterized pass
Bjorn Pettersson [Thu, 16 Sep 2021 07:28:32 +0000 (09:28 +0200)]
[NewPM] Make InlinerPass (aka 'inline') a parameterized pass

In default pipelines the ModuleInlinerWrapperPass is adding the
InlinerPass to the pipeline twice, once due to MandatoryFirst (passing
true in the ctor) and then a second time with false as argument.

To make it possible to bisect and reduce opt test cases for this
part of the pipeline we need to be able to choose between the two
different variants of the InlinerPass when running opt. This patch is
changing 'inline' to a CGSCC_PASS_WITH_PARAMS in the PassRegistry,
making it possible run opt with both -passes=cgscc(inline) and
-passes=cgscc(inline<only-mandatory>).

Reviewed By: aeubanks, mtrofin

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

3 years ago[clang][NFC] Remove dead code
Andy Wingo [Wed, 4 Aug 2021 08:39:52 +0000 (10:39 +0200)]
[clang][NFC] Remove dead code

Remove code that has no effect in SemaType.cpp:processTypeAttrs.

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

3 years agoAdd myself as a code owner for SYCL support
Alexey Bader [Mon, 20 Sep 2021 06:31:35 +0000 (09:31 +0300)]
Add myself as a code owner for SYCL support

3 years ago[OpenCL] Supports optional writing to 3d images in C++ for OpenCL 2021
Justas Janickas [Mon, 6 Sep 2021 15:04:19 +0000 (16:04 +0100)]
[OpenCL] Supports optional writing to 3d images in C++ for OpenCL 2021

Adds support for a feature macro __opencl_c_3d_image_writes in
C++ for OpenCL 2021 enabling a respective optional core feature
from OpenCL 3.0.

This change aims to achieve compatibility between C++ for OpenCL
2021 and OpenCL 3.0.

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

3 years agoAArch64: use ldp/stp for 128-bit atomic load/store in v.84 onwards
Tim Northover [Wed, 15 Sep 2021 11:20:03 +0000 (12:20 +0100)]
AArch64: use ldp/stp for 128-bit atomic load/store in v.84 onwards

v8.4 says that normal loads/stores of 128-bytes are single-copy atomic if
they're properly aligned (which all LLVM atomics are) so we no longer need to
do a full RMW operation to guarantee we got a clean read.

3 years ago[mlir] Fix integration tests failures introduced in D108505
Vladislav Vinogradov [Mon, 20 Sep 2021 08:48:24 +0000 (11:48 +0300)]
[mlir] Fix integration tests failures introduced in D108505

3 years agoRevert "[AArch64][SVE] Teach cost model that masked loads/stores are cheap"
David Spickett [Mon, 20 Sep 2021 08:44:09 +0000 (08:44 +0000)]
Revert "[AArch64][SVE] Teach cost model that masked loads/stores are cheap"

This reverts commit 734708e04f84b72f1ae7c8b35c002b8bf97dc064.

Due to build failures on the 2 stage SVE VLS bot.
https://lab.llvm.org/buildbot/#/builders/176/builds/908/steps/11/logs/stdio

3 years ago[lldb] [gdb-remote] Recognize aarch64v type from gdbserver
Michał Górny [Thu, 16 Sep 2021 17:01:55 +0000 (19:01 +0200)]
[lldb] [gdb-remote] Recognize aarch64v type from gdbserver

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

3 years ago[lldb] [gdb-remote] Remove unused arg from GDBRemoteRegisterContext::ReadRegisterBytes()
Michał Górny [Mon, 30 Aug 2021 08:23:22 +0000 (10:23 +0200)]
[lldb] [gdb-remote] Remove unused arg from GDBRemoteRegisterContext::ReadRegisterBytes()

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

3 years ago[MLIR][Linalg] Make detensoring cost-model more flexible.
KareemErgawy-TomTom [Mon, 20 Sep 2021 07:35:42 +0000 (09:35 +0200)]
[MLIR][Linalg] Make detensoring cost-model more flexible.

So far, the CF cost-model for detensoring was limited to discovering
pure CF structures. This means, if while discovering the CF component,
the cost-model found any op that is not detensorable, it gives up on
detensoring altogether. This patch makes it a bit more flexible by
cleaning-up the detensorable component from non-detensorable ops without
giving up entirely.

Reviewed By: silvas

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

3 years ago[CaptureTracking] Allow passing LI to PointerMayBeCapturedBefore (NFC).
Florian Hahn [Mon, 20 Sep 2021 08:07:34 +0000 (09:07 +0100)]
[CaptureTracking] Allow passing LI to PointerMayBeCapturedBefore (NFC).

isPotentiallyReachable can use LoopInfo to return earlier. This patch
allows passing an optional LI to PointerMayBeCapturedBefore. Used in
D109844.

Reviewed By: nikic, asbirlea

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

3 years ago[CMake] Add debuginfo-tests to LLVM_ALL_PROJECTS after D110016
Fangrui Song [Mon, 20 Sep 2021 07:56:27 +0000 (00:56 -0700)]
[CMake] Add debuginfo-tests to LLVM_ALL_PROJECTS after D110016

3 years ago[MLIR] Simplex::appendVariable: early return if count == 0
Arjun P [Mon, 20 Sep 2021 07:39:05 +0000 (13:09 +0530)]
[MLIR] Simplex::appendVariable: early return if count == 0

3 years ago[mlir] Fix bug in partial dialect conversion
Vladislav Vinogradov [Fri, 20 Aug 2021 11:25:42 +0000 (14:25 +0300)]
[mlir] Fix bug in partial dialect conversion

The discussion on forum:
https://llvm.discourse.group/t/bug-in-partial-dialect-conversion/4115

The `applyPartialConversion` didn't handle the operations, that were
marked as illegal inside dynamic legality callback.
Instead of reporting error, if such operation was not converted to legal set,
the method just added it to `unconvertedSet` in the same way as unknown operations.

This patch fixes that and handle dynamically illegal operations as well.

The patch includes 2 fixes for existing passes:

* `tensor-bufferize` - explicitly mark `std.return` as legal.
* `convert-parallel-loops-to-gpu` - ugly fix with marking visited operations
  to avoid recursive legality checks.

Reviewed By: rriddle

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

3 years ago[mlir][NFC] Add explicit "::mlir" namespace to tblgen generated code
Vladislav Vinogradov [Fri, 3 Sep 2021 11:02:34 +0000 (14:02 +0300)]
[mlir][NFC] Add explicit "::mlir" namespace to tblgen generated code

Reviewed By: lattner, ftynse

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

3 years ago[lldb] Remove two #ifndef linux from Platform.cpp
Pavel Labath [Fri, 17 Sep 2021 11:16:26 +0000 (13:16 +0200)]
[lldb] Remove two #ifndef linux from Platform.cpp

These have been here since r215992, guarding the calls to HostInfo, but
their purpose unclear -- HostInfoLinux provides these functions and they
work fine.

3 years ago[libc][obvious] Add inttypes.h and stdlib.h as deps to *div functions.
Siva Chandra Reddy [Mon, 20 Sep 2021 05:54:32 +0000 (05:54 +0000)]
[libc][obvious] Add inttypes.h and stdlib.h as deps to *div functions.

3 years ago[libc][obvious] Make *abs and *div functions buildable in default mode.
Siva Chandra Reddy [Mon, 20 Sep 2021 05:44:10 +0000 (05:44 +0000)]
[libc][obvious] Make *abs and *div functions buildable in default mode.

3 years ago[NFC] Add assert and test showing that revert of D109596 wasn't justified
Max Kazantsev [Mon, 20 Sep 2021 04:58:17 +0000 (11:58 +0700)]
[NFC] Add assert and test showing that revert of D109596 wasn't justified

All transforms of IndVars have prerequisite requirement of LCSSA and LoopSimplify
form and rely on it. Added test that shows that this actually stands.

3 years agoRevert "Revert "[IndVars] Replace PHIs if loop exits on 1st iteration""
Max Kazantsev [Mon, 20 Sep 2021 04:28:56 +0000 (11:28 +0700)]
Revert "Revert "[IndVars] Replace PHIs if loop exits on 1st iteration""

This reverts commit 6fec6552f54885ae06bf76b35f9f1173a0561a4c.

The patch was reverted on incorrect claim that this patch may break LCSSA form
when the loop is not in a simplify form. All IndVars' transform insure that
the loop is in simplify and LCSSA form, so if it wasn't broken before this
transform, it will also not be broken after it.

3 years ago[libc] Add implementations of div, ldiv, lldiv and imaxdiv.
Siva Chandra Reddy [Fri, 17 Sep 2021 04:38:17 +0000 (04:38 +0000)]
[libc] Add implementations of div, ldiv, lldiv and imaxdiv.

Reviewed By: michaelrj

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

3 years ago[SCEV] Support negative values in signed/unsigned predicate reasoning
Max Kazantsev [Mon, 20 Sep 2021 04:26:33 +0000 (11:26 +0700)]
[SCEV] Support negative values in signed/unsigned predicate reasoning

There is a piece of logic that uses the fact that signed and unsigned
versions of the same predicate are equivalent when both values are
non-negative. It's also true when both of them are negative.

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