]> granicus.if.org Git - llvm/log
llvm
5 years ago[Attributor][Stats] Use the right statistics macro
Johannes Doerfert [Wed, 4 Sep 2019 20:34:57 +0000 (20:34 +0000)]
[Attributor][Stats] Use the right statistics macro

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370976 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Attributor][Fix] Make sure we do not delete live code
Johannes Doerfert [Wed, 4 Sep 2019 20:34:52 +0000 (20:34 +0000)]
[Attributor][Fix] Make sure we do not delete live code

Summary: Liveness needs to mark edges, not blocks as dead.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370975 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[LLD] [COFF] Implement MinGW default manifest handling
Martin Storsjo [Wed, 4 Sep 2019 20:34:00 +0000 (20:34 +0000)]
[LLD] [COFF] Implement MinGW default manifest handling

In mingw environments, resources are normally compiled to resource
object files directly, instead of letting the linker convert them to
COFF format.

Since some time, GCC supports the notion of a default manifest object.
When invoking the linker, GCC looks for the default manifest object
file, and if found in the expected path, it is added to linker commands.

The default manifest is one that indicates support for the latest known
versions of windows, to implicitly unlock the modern behaviours of certain
APIs.

Not all mingw/gcc distributions include this file, but e.g. in msys2,
the default manifest object is distributed in a separate package (which
can be but might not always be installed).

This means that even if user projects only use one single resource
object file, the linker can end up with two resource object files,
and thus needs to support merging them.

The default manifest has a language id of zero, and GNU ld has got
logic for dropping a manifest with a zero language id, if there's
another manifest present with a nonzero language id. If there are
multiple manifests with a nonzero language id, the merging process
errors out.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370974 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NewPM][Sancov] Make Sancov a Module Pass instead of 2 Passes
Leonard Chan [Wed, 4 Sep 2019 20:30:29 +0000 (20:30 +0000)]
[NewPM][Sancov] Make Sancov a Module Pass instead of 2 Passes

This patch merges the sancov module and funciton passes into one module pass.

The reason for this is because we ran into an out of memory error when
attempting to run asan fuzzer on some protobufs (pc.cc files). I traced the OOM
error to the destructor of SanitizerCoverage where we only call
appendTo[Compiler]Used which calls appendToUsedList. I'm not sure where precisely
in appendToUsedList causes the OOM, but I am able to confirm that it's calling
this function *repeatedly* that causes the OOM. (I hacked sancov a bit such that
I can still create and destroy a new sancov on every function run, but only call
appendToUsedList after all functions in the module have finished. This passes, but
when I make it such that appendToUsedList is called on every sancov destruction,
we hit OOM.)

I don't think the OOM is from just adding to the SmallSet and SmallVector inside
appendToUsedList since in either case for a given module, they'll have the same
max size. I suspect that when the existing llvm.compiler.used global is erased,
the memory behind it isn't freed. I could be wrong on this though.

This patch works around the OOM issue by just calling appendToUsedList at the
end of every module run instead of function run. The same amount of constants
still get added to llvm.compiler.used, abd we make the pass usage and logic
simpler by not having any inter-pass dependencies.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370971 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-rtdyld][llvm-jitlink] Rename struct member to remove ambiguity.
Lang Hames [Wed, 4 Sep 2019 20:26:26 +0000 (20:26 +0000)]
[llvm-rtdyld][llvm-jitlink] Rename struct member to remove ambiguity.

This ambiguity (struct member name matching struct name) was causing errors on
a few of the MSVC bots. Hopefully this should fix it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370969 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-rtdyld] Add timers to match llvm-jitlink.
Lang Hames [Wed, 4 Sep 2019 20:26:25 +0000 (20:26 +0000)]
[llvm-rtdyld] Add timers to match llvm-jitlink.

When using llvm-rtdyld to execute code, -show-times will now show the time
taken to load the object files, apply relocations, and execute the
rtdyld-linked code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370968 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] Add more test cases (NFC)
Evandro Menezes [Wed, 4 Sep 2019 20:01:09 +0000 (20:01 +0000)]
[InstCombine] Add more test cases (NFC)

Add more test cases simplifying `log()`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370966 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[WebAssembly] Initialize memory in start function
Thomas Lively [Wed, 4 Sep 2019 19:50:39 +0000 (19:50 +0000)]
[WebAssembly] Initialize memory in start function

Summary:
 - `__wasm_init_memory` is now the WebAssembly start function instead
   of being called from `__wasm_call_ctors` or called directly by the
   runtime.
 - Adds a new synthetic data symbol `__wasm_init_memory_flag` that is
   atomically incremented from zero to one by the thread responsible
   for initializing memory.
 - All threads now unconditionally perform data.drop on all passive
   segments.
 - Removes --passive-segments and --active-segments flags and controls
   segment type based on --shared-memory instead. The deleted flags
   were only present to ameliorate the upgrade path in Emscripten.

Reviewers: sbc100, aheejin

Subscribers: dschuff, jgravelle-google, sunfish, jfb, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370965 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MemorySSA] Re-enable MemorySSA use.
Alina Sbirlea [Wed, 4 Sep 2019 19:16:04 +0000 (19:16 +0000)]
[MemorySSA] Re-enable MemorySSA use.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370957 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Attributor][Fix] Ensure the attribute names are created properly
Johannes Doerfert [Wed, 4 Sep 2019 19:01:08 +0000 (19:01 +0000)]
[Attributor][Fix] Ensure the attribute names are created properly

The names of the attributes were not always created properly which
caused problems with the yaml output.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370956 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[globalisel] Support trivial COPY in GISelKnownBits
Daniel Sanders [Wed, 4 Sep 2019 18:59:43 +0000 (18:59 +0000)]
[globalisel] Support trivial COPY in GISelKnownBits

Summary: Allow GISelKnownBits to look through the trivial case of TargetOpcode::COPY

Reviewers: aditya_nandakumar

Subscribers: rovka, hiraditya, volkan, Petar.Avramovic, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370955 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[JITLink] Fix the show-timers option on llvm-jitlink.
Lang Hames [Wed, 4 Sep 2019 18:38:29 +0000 (18:38 +0000)]
[JITLink] Fix the show-timers option on llvm-jitlink.

No longer constantly shows times (even when -show-times=false). When shown,
times are now correctly grouped.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370951 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[docs] Add some comments to the inline LLJIT example.
Lang Hames [Wed, 4 Sep 2019 18:38:26 +0000 (18:38 +0000)]
[docs] Add some comments to the inline LLJIT example.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370950 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC] Switch last couple of invariant_load checks to use hasMetadata
Philip Reames [Wed, 4 Sep 2019 18:27:31 +0000 (18:27 +0000)]
[NFC] Switch last couple of invariant_load checks to use hasMetadata

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370948 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[TargetLibraryInfo] Define enumerator for no library function (NFC)
Evandro Menezes [Wed, 4 Sep 2019 18:15:58 +0000 (18:15 +0000)]
[TargetLibraryInfo] Define enumerator for no library function (NFC)

Add a null enumerator do designate no library function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370947 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] sub(xor(x, y), or(x, y)) -> neg(and(x, y))
David Bolvansky [Wed, 4 Sep 2019 18:03:21 +0000 (18:03 +0000)]
[InstCombine] sub(xor(x, y), or(x, y)) -> neg(and(x, y))

Summary:
```
Name: sub(xor(x, y), or(x, y)) -> neg(and(x, y))
%or = or i32 %y, %x
%xor = xor i32 %x, %y
%sub = sub i32 %xor, %or
  =>
%sub1 = and i32 %x, %y
%sub = sub i32 0, %sub1

Optimization: sub(xor(x, y), or(x, y)) -> neg(and(x, y))
Done: 1
Optimization is correct!
```

https://rise4fun.com/Alive/8OI

Reviewers: lebedev.ri

Reviewed By: lebedev.ri

Subscribers: llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370945 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoUpdate CodeGen to use hasMetadata as appropriate [NFC]
Philip Reames [Wed, 4 Sep 2019 17:46:55 +0000 (17:46 +0000)]
Update CodeGen to use hasMetadata as appropriate [NFC]

My intial grepping for rL370933 missed a directory worth of cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370942 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC] Added tests for new fold
David Bolvansky [Wed, 4 Sep 2019 17:37:06 +0000 (17:37 +0000)]
[NFC] Added tests for new fold

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370941 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC] Adjust test filename
David Bolvansky [Wed, 4 Sep 2019 17:33:53 +0000 (17:33 +0000)]
[NFC] Adjust test filename

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370939 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Pre-commit test cases and test run line changes for D67087
Craig Topper [Wed, 4 Sep 2019 17:33:38 +0000 (17:33 +0000)]
[X86] Pre-commit test cases and test run line changes for D67087

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370937 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdd encode and decode methods to InlineInfo and document encoding format to the GSYM...
Greg Clayton [Wed, 4 Sep 2019 17:32:51 +0000 (17:32 +0000)]
Add encode and decode methods to InlineInfo and document encoding format to the GSYM file format.

This patch adds the ability to encode and decode InlineInfo objects and adds test coverage. Error handling is introduced in the encoding and decoding which will be used from here on out for remaining patches.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370936 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] Fold sub (and A, B) (or A, B)) to neg (xor A, B)
David Bolvansky [Wed, 4 Sep 2019 17:30:53 +0000 (17:30 +0000)]
[InstCombine] Fold sub (and A, B) (or A, B)) to neg (xor A, B)

Summary:
```
Name: sub(and(x, y), or(x, y)) -> neg(xor(x, y))
%or = or i32 %y, %x
%and = and i32 %x, %y
%sub = sub i32 %and, %or
  =>
%sub1 = xor i32 %x, %y
%sub = sub i32 0, %sub1

Optimization: sub(and(x, y), or(x, y)) -> neg(xor(x, y))
Done: 1
Optimization is correct!
```

https://rise4fun.com/Alive/VI6

Found by @lebedev.ri. Also author of the proof.

Reviewers: lebedev.ri, spatel

Reviewed By: lebedev.ri

Subscribers: llvm-commits, lebedev.ri

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370934 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Instruction] Add hasMetadata(Kind) helper [NFC]
Philip Reames [Wed, 4 Sep 2019 17:28:48 +0000 (17:28 +0000)]
[Instruction] Add hasMetadata(Kind) helper [NFC]

It's a common idiom, so let's add the obvious wrapper for metadata kinds which are basically booleans.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370933 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU: Handle frame index expansion with no free SGPRs pre gfx9
Matt Arsenault [Wed, 4 Sep 2019 17:12:57 +0000 (17:12 +0000)]
AMDGPU: Handle frame index expansion with no free SGPRs pre gfx9

Since an add instruction must produce an unused carry out, this
requires additional SGPRs. This can be avoided by keeping the entire
offset computation in SGPRs. If one SGPR is still available, this only
costs one extra mov. If none are available, the entire computation can
be done in place and reversed.

This does assume the use is a VGPR operand. This was already assumed,
and we currently only select frame indexes to VALU instructions. This
should probably be fixed at some point to handle more possible MIR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370929 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoGlobalISel: Add G_BITREVERSE
Matt Arsenault [Wed, 4 Sep 2019 17:06:53 +0000 (17:06 +0000)]
GlobalISel: Add G_BITREVERSE

This is the first failing pattern for AMDGPU and is trivial to handle.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370927 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Attributor][NFC] Add assertion to guard against accidental misuse
Johannes Doerfert [Wed, 4 Sep 2019 16:36:54 +0000 (16:36 +0000)]
[Attributor][NFC] Add assertion to guard against accidental misuse

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370925 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Attributor] Look at internal functions only on-demand
Johannes Doerfert [Wed, 4 Sep 2019 16:35:20 +0000 (16:35 +0000)]
[Attributor] Look at internal functions only on-demand

Summary:
Instead of building attributes for internal functions which we do not
update as long as we assume they are dead, we now do not create
attributes until we assume the internal function to be live. This
improves the number of required iterations, as well as the number of
required updates, in real code. On our tests, the results are mixed.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370924 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Attributor] Use the white list for attributes consistently
Johannes Doerfert [Wed, 4 Sep 2019 16:26:20 +0000 (16:26 +0000)]
[Attributor] Use the white list for attributes consistently

Summary:
We create attributes on-demand so we need to check the white list
on-demand. This also unifies the location at which we create,
initialize, and eventually invalidate new abstract attributes.

The tests show mixed results, a few more call site attributes are
determined which can cause more iterations.

Reviewers: uenoku, sstefan1

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370922 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU/GlobalISel: Make 16-bit constants legal
Matt Arsenault [Wed, 4 Sep 2019 16:19:45 +0000 (16:19 +0000)]
AMDGPU/GlobalISel: Make 16-bit constants legal

This is mostly for the benefit of patterns which use 16-bit constants.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370921 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoGlobalISel/TableGen: Don't skip REG_SEQUENCE based on patterns
Matt Arsenault [Wed, 4 Sep 2019 16:19:34 +0000 (16:19 +0000)]
GlobalISel/TableGen: Don't skip REG_SEQUENCE based on patterns

This partially adds support for patterns with REG_SEQUENCE. The source
patterns are now accepted, but the pattern is still rejected due to
missing support for the instruction renderer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370920 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoGlobalISel: Define GINodeEquiv for undef
Matt Arsenault [Wed, 4 Sep 2019 16:19:29 +0000 (16:19 +0000)]
GlobalISel: Define GINodeEquiv for undef

AMDGPU uses this for undef vector elements in some patterns which will
be enabled in a future patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370918 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Attributor] Deal more explicit with non-exact definitions
Johannes Doerfert [Wed, 4 Sep 2019 16:16:13 +0000 (16:16 +0000)]
[Attributor] Deal more explicit with non-exact definitions

Summary:
Before we tried to rule out non-exact definitions early but that lead to
on-demand attributes created for them anyway. As a consequence we needed
to look at the definition in the initialize of each attribute again.
This patch centralized this lookup and tightens the condition under
which we give up on non-exact definitions.

Reviewers: uenoku, sstefan1

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370917 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Add support for avx512bf16 for __builtin_cpu_supports and compiler-rt's cpu...
Craig Topper [Wed, 4 Sep 2019 16:01:43 +0000 (16:01 +0000)]
[X86] Add support for avx512bf16 for __builtin_cpu_supports and compiler-rt's cpu indicator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370915 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Attributor] Ensure AAIsDead correctly overrides getIRPosition
Simon Pilgrim [Wed, 4 Sep 2019 16:01:09 +0000 (16:01 +0000)]
[Attributor] Ensure AAIsDead correctly overrides getIRPosition

As commented on D65712, the getIRPosition methods weren't correctly being overridden.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370914 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Hexagon] Improve generated code for test-if-bit-clear, one more time
Krzysztof Parzyszek [Wed, 4 Sep 2019 15:22:36 +0000 (15:22 +0000)]
[Hexagon] Improve generated code for test-if-bit-clear, one more time

Adjust isel patterns after recent commit. Fixes https://llvm.org/PR43194.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370913 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstSimplify] guard against unreachable code (PR43218)
Sanjay Patel [Wed, 4 Sep 2019 15:12:55 +0000 (15:12 +0000)]
[InstSimplify] guard against unreachable code (PR43218)

This would crash:
https://bugs.llvm.org/show_bug.cgi?id=43218

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370911 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Debuginfo][SROA] Need to handle dbg.value in SROA pass.
Alexey Lapshin [Wed, 4 Sep 2019 14:19:49 +0000 (14:19 +0000)]
[Debuginfo][SROA] Need to handle dbg.value in SROA pass.

SROA pass processes debug info incorrecly if applied twice.
Specifically, after SROA works first time, instcombine converts dbg.declare
intrinsics into dbg.value. Inlining creates new opportunities for SROA,
so it is called again. This time it does not handle correctly previously
inserted dbg.value intrinsics.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370906 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] add tests for insert/extract with identity shuffles; NFC
Sanjay Patel [Wed, 4 Sep 2019 13:38:49 +0000 (13:38 +0000)]
[InstCombine] add tests for insert/extract with identity shuffles; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370901 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ModuloSchedule] Fix no-asserts build
James Molloy [Wed, 4 Sep 2019 12:57:23 +0000 (12:57 +0000)]
[ModuloSchedule] Fix no-asserts build

Apologies, due to a git SNAFU this fix (dump doesn't exist and silence unused variables) stayed in my index rather than applying to rL370893.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370894 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ModuloSchedule] Introduce PeelingModuloScheduleExpander
James Molloy [Wed, 4 Sep 2019 12:54:24 +0000 (12:54 +0000)]
[ModuloSchedule] Introduce PeelingModuloScheduleExpander

This is the beginnings of a reimplementation of ModuloScheduleExpander. It works
by generating a single-block correct pipelined kernel and then peeling out the
prolog and epilogs.

This patch implements kernel generation as well as a validator that will
confirm the number of phis added is the same as the ModuloScheduleExpander.

Prolog and epilog peeling will come in a different patch.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370893 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix "enumeral and non-enumeral type in conditional expression" warnings. NFCI.
Simon Pilgrim [Wed, 4 Sep 2019 12:51:40 +0000 (12:51 +0000)]
Fix "enumeral and non-enumeral type in conditional expression" warnings. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370892 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC] Added a negative test for new fold
David Bolvansky [Wed, 4 Sep 2019 12:46:25 +0000 (12:46 +0000)]
[NFC] Added a negative test for new fold

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370890 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC] Fixed test
David Bolvansky [Wed, 4 Sep 2019 12:43:14 +0000 (12:43 +0000)]
[NFC] Fixed test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370888 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC] Adjust tests for new fold
David Bolvansky [Wed, 4 Sep 2019 12:22:28 +0000 (12:22 +0000)]
[NFC] Adjust tests for new fold

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370886 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC] Added tests for new fold
David Bolvansky [Wed, 4 Sep 2019 12:18:53 +0000 (12:18 +0000)]
[NFC] Added tests for new fold

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370885 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] Fold sub (or A, B) (and A, B) to (xor A, B)
David Bolvansky [Wed, 4 Sep 2019 12:00:33 +0000 (12:00 +0000)]
[InstCombine] Fold sub (or A, B) (and A, B) to (xor A, B)

Summary:
```
Name: sub or and to xor
%or = or i32 %y, %x
%and = and i32 %x, %y
%sub = sub i32 %or, %and
  =>
%sub = xor i32 %x, %y

Optimization: sub or and to xor
Done: 1
Optimization is correct!
```
https://rise4fun.com/Alive/eJu

Reviewers: spatel, lebedev.ri

Reviewed By: lebedev.ri

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370883 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix address sizes in the dwarfdump-debug-loc-error-cases test
Pavel Labath [Wed, 4 Sep 2019 11:47:20 +0000 (11:47 +0000)]
Fix address sizes in the dwarfdump-debug-loc-error-cases test

the test is building a 64-bit executable, so the addresses should be
64-bit too. The test was still passing even with smaller address size,
but it was hitting the "unexpected end of data" error sooner than it
should.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370882 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC] Added a new test for D67153
David Bolvansky [Wed, 4 Sep 2019 11:44:00 +0000 (11:44 +0000)]
[NFC] Added a new test for D67153

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370881 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC] Added tests for 'SUB of OR and AND to XOR' fold
David Bolvansky [Wed, 4 Sep 2019 11:17:08 +0000 (11:17 +0000)]
[NFC] Added tests for 'SUB of OR and AND to XOR' fold

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370878 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DebugInfo] LiveDebugValues: locations with different exprs should not be merged
Jeremy Morse [Wed, 4 Sep 2019 11:09:05 +0000 (11:09 +0000)]
[DebugInfo] LiveDebugValues: locations with different exprs should not be merged

When comparing variable locations, LiveDebugValues currently considers only
the machine location, ignoring any DIExpression applied to it. This is a
problem because that DIExpression can do pretty much anything to the machine
location, for example dereferencing it.

This patch adds DIExpressions to that comparison; now variables based on the
same register/memory-location but with different expressions will compare
differently, and be dropped if we attempt to merge them between blocks. This
reduces variable coverage-range a little, but only because we were producing
broken locations.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370877 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agogn build: Merge r370862
Nico Weber [Wed, 4 Sep 2019 11:08:09 +0000 (11:08 +0000)]
gn build: Merge r370862

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370876 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "[Clang Interpreter] Initial patch for the constexpr interpreter"
Roman Lebedev [Wed, 4 Sep 2019 10:57:06 +0000 (10:57 +0000)]
Revert "[Clang Interpreter] Initial patch for the constexpr interpreter"

Breaks BUILD_SHARED_LIBS build, introduces cycles in library dependency
graphs. (clangInterp depends on clangAST which depends on clangInterp)

This reverts r370839, which is an yet another recommit of D64146.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370874 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[cmake] Remove MSVC C4180 override
Simon Pilgrim [Wed, 4 Sep 2019 10:26:39 +0000 (10:26 +0000)]
[cmake] Remove MSVC C4180 override

Tested on VS2017 and VS2019 llvm/clang builds with WX enabled - its no longer necessary to disable this warning.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370871 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[LiveDebugValues][NFC] Silence an unused variable warning
Jeremy Morse [Wed, 4 Sep 2019 10:18:03 +0000 (10:18 +0000)]
[LiveDebugValues][NFC] Silence an unused variable warning

On release builds, 'MI' isn't used by anything (it's already inserted into a
block by BuildMI), while on non-release builds it's used by a LLVM_DEBUG
statement. Mark as explicitly used to avoid the warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370870 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoDWARF: Fix a regression in location list dumping
Pavel Labath [Wed, 4 Sep 2019 10:09:12 +0000 (10:09 +0000)]
DWARF: Fix a regression in location list dumping

Summary:
While fixing the handling of some error cases, r370363 introduced new
problems -- assertion failures due to unchecked errors (my excuse is that a very
early version of that patch used Optional<T> instead of Expected).

This patch adds proper handling of parsing errors encountered when
dumping location lists from inside DWARF DIEs, and adds a bunch of
additional tests.

I reorder the arguments of the location list dumping functions to make
them consistent, and also be able to dump the two kinds of location
lists generically.

Reviewers: JDevlieghere, dblaikie, probinson

Subscribers: aprantl, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370868 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[cmake] Remove MSVC C4258 override
Simon Pilgrim [Wed, 4 Sep 2019 10:01:31 +0000 (10:01 +0000)]
[cmake] Remove MSVC C4258 override

Tested on VS2017 and VS2019 llvm/clang builds with WX enabled - its no longer necessary to disable this warning.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370866 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-dwarfdump] Fix spelling in the comments. NFC
Djordje Todorovic [Wed, 4 Sep 2019 09:44:09 +0000 (09:44 +0000)]
[llvm-dwarfdump] Fix spelling in the comments. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370861 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-objcopy] Add objcopy::elf::Object::allocSections to simplify loops on SHF_ALLOC...
Fangrui Song [Wed, 4 Sep 2019 09:35:32 +0000 (09:35 +0000)]
[llvm-objcopy] Add objcopy::elf::Object::allocSections to simplify loops on SHF_ALLOC sections

Reviewed By: jhenderson

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370860 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[yaml2obj] Support PT_GNU_STACK and PT_GNU_RELRO
Fangrui Song [Wed, 4 Sep 2019 09:19:31 +0000 (09:19 +0000)]
[yaml2obj] Support PT_GNU_STACK and PT_GNU_RELRO

PT_GNU_STACK is used in an llvm-objcopy test.

I plan to use PT_GNU_RELRO in a patch to improve nested segment
processing in llvm-objcopy (PR42963).

Reviewed By: grimar

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370857 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-objcopy] Rename variable names "Section" to "Sec". NFC
Fangrui Song [Wed, 4 Sep 2019 08:43:27 +0000 (08:43 +0000)]
[llvm-objcopy] Rename variable names "Section" to "Sec". NFC

"Section" can refer to the type llvm::objcopy::elf::Section or the
variable name. Rename it to "Sec" for clarity. "Sec" is already used a
lot, so this change improves consistency as well.

Also change `auto` to `const SectionBase` for readability.

Reviewed By: grimar

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370852 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ARM][ParallelDSP] SExt mul for accumulation
Sam Parker [Wed, 4 Sep 2019 08:41:34 +0000 (08:41 +0000)]
[ARM][ParallelDSP] SExt mul for accumulation

For any unpaired muls, we accumulate them as an input to the
reduction. Check the type of the mul and perform a sext if the
existing accumlator input type is not the same.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370851 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[IRPrinting] Improve module pass printer to work better with -filter-print-funcs
Taewook Oh [Wed, 4 Sep 2019 08:08:58 +0000 (08:08 +0000)]
[IRPrinting] Improve module pass printer to work better with -filter-print-funcs

Summary: Previously module pass printer pass prints the banner even when the module doesn't include any function provided with `-filter-print-funcs` option. This introduced a lot of noise, especailly with ThinLTO. This diff addresses the issue and makes the banner printed only when the module includes functions in `-filter-print-funcs` list.

Reviewers: fedor.sergeev

Subscribers: mehdi_amini, hiraditya, dexonsmith, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370849 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[GlobalISel] Fix G_SEXT narrowScalar to bail out of unsupported type combination.
Amara Emerson [Wed, 4 Sep 2019 07:58:45 +0000 (07:58 +0000)]
[GlobalISel] Fix G_SEXT narrowScalar to bail out of unsupported type combination.

Similar to the issue with G_ZEXT that was fixed earlier, this is a quick
to fall back if the source type is not exactly half of the dest type.

Fixes the clang-cmake-aarch64-lld bot build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370847 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agogn build: Merge r370843
Nico Weber [Wed, 4 Sep 2019 07:40:03 +0000 (07:40 +0000)]
gn build: Merge r370843

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370844 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Clang Interpreter] Initial patch for the constexpr interpreter
Nandor Licker [Wed, 4 Sep 2019 05:49:41 +0000 (05:49 +0000)]
[Clang Interpreter] Initial patch for the constexpr interpreter

Summary:
This patch introduces the skeleton of the constexpr interpreter,
capable of evaluating a simple constexpr functions consisting of
if statements. The interpreter is described in more detail in the
RFC. Further patches will add more features.

Reviewers: Bigcheese, jfb, rsmith

Subscribers: bruno, uenoku, ldionne, Tyker, thegameg, tschuett, dexonsmith, mgorny, cfe-commits

Tags: #clang

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370839 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-objcopy] Fix some identifier names in comments. NFC
Fangrui Song [Wed, 4 Sep 2019 03:54:43 +0000 (03:54 +0000)]
[llvm-objcopy] Fix some identifier names in comments. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370838 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[RISCV] Enable tail call opt for variadic function
Jim Lin [Wed, 4 Sep 2019 02:03:36 +0000 (02:03 +0000)]
[RISCV] Enable tail call opt for variadic function

Summary: Tail call opt can treat variadic function call the same as normal function call

Reviewers: mgrang, asb, lenary, lewis-revill

Reviewed By: lenary

Subscribers: luismarques, pzheng, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, s.egerton, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370835 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MemorySSA] Move two verify calls under expensive checks.
Alina Sbirlea [Wed, 4 Sep 2019 00:44:54 +0000 (00:44 +0000)]
[MemorySSA] Move two verify calls under expensive checks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370831 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC][llvm-ifs] Adding .ifs files to the test list for llvm-ifs tool.
Puyan Lotfi [Wed, 4 Sep 2019 00:07:49 +0000 (00:07 +0000)]
[NFC][llvm-ifs] Adding .ifs files to the test list for llvm-ifs tool.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370830 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert [Windows] Disable TrapUnreachable for Win64, add SEH_NoReturn
Reid Kleckner [Tue, 3 Sep 2019 22:27:27 +0000 (22:27 +0000)]
Revert [Windows] Disable TrapUnreachable for Win64, add SEH_NoReturn

This reverts r370525 (git commit 0bb1630685fba255fa93def92603f064c2ffd203)
Also reverts r370543 (git commit 185ddc08eed6542781040b8499ef7ad15c8ae9f4)

The approach I took only works for functions marked `noreturn`. In
general, a call that is not known to be noreturn may be followed by
unreachable for other reasons. For example, there could be multiple call
sites to a function that throws sometimes, and at some call sites, it is
known to always throw, so it is followed by unreachable. We need to
insert an `int3` in these cases to pacify the Windows unwinder.

I think this probably deserves its own standalone, Win64-only fixup pass
that runs after block placement. Implementing that will take some time,
so let's revert to TrapUnreachable in the mean time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370829 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[WebAssembly] Compare functions by names in Emscripten Sjlj
Heejin Ahn [Tue, 3 Sep 2019 22:26:49 +0000 (22:26 +0000)]
[WebAssembly] Compare functions by names in Emscripten Sjlj

Summary:
This removes all string constants for function names and compares
functions by string directly when needed. Many of these constants are
used only once or twice so the benefit of defining them separately is
not very clear, and this actually fixes a bug.

When we already have a `malloc` declaration which is an alias to
something else within the module,
```
@malloc = weak hidden alias i8* (i32), i8* (i32)* @dlmalloc
```
(this happens compiling with emscripten with `-s WASM_OBJECT_FILES=0`
because all bc files are merged before being fed into `wasm-ld` which
runs the backend optimizations as LTO)

`Module::getFunction("malloc")` in `canLongjmp` returns `nullptr`
because `Module::getFunction` dyncasts pointer into `Function`, but the
alias is a `GlobalValue` but not a `Function`. This makes `canLongjmp`
return false for `malloc` in this case, and we end up adding a lot of
longjmp handling code around malloc. This is not only a code size
increase but actually a bug because `malloc` is used in the entry block
when preparing for setjmp tables for emscripten sjlj handling, and this
makes initial setjmp preparation, which has to happen in the entry
block, move to another split block, and this interferes with SSA update
later.

This also adds two more functions, `getTempRet0` and `setTempRet0`, in
the list of not longjmp-able functions.

Fixes https://github.com/emscripten-core/emscripten/issues/8935.

Reviewers: sbc100

Subscribers: mehdi_amini, jgravelle-google, hiraditya, sunfish, dexonsmith, dschuff, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370828 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-profdata] Add mode to recover from profile read failures
Vedant Kumar [Tue, 3 Sep 2019 22:23:16 +0000 (22:23 +0000)]
[llvm-profdata] Add mode to recover from profile read failures

Add a mode in which profile read errors are not immediately treated as
fatal. In this mode, merging makes forward progress and reports failure
only if no inputs can be read.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370827 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstrProf] Tighten a check for malformed data records in raw profiles
Vedant Kumar [Tue, 3 Sep 2019 22:23:14 +0000 (22:23 +0000)]
[InstrProf] Tighten a check for malformed data records in raw profiles

The check needs to validate a counter offset before performing pointer
arithmetic with the (potentially corrupt) offset.

Found by UBSan's pointer overflow check.

rdar://54843625

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370826 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[GVN] Remove a todo introduced w/rL370791
Philip Reames [Tue, 3 Sep 2019 21:56:17 +0000 (21:56 +0000)]
[GVN] Remove a todo introduced w/rL370791

When I dug into this, it turns out to be *much* more involved than I'd realized and doesn't actually simplify anything.

The general purpose of the leader table is that we want to find the most-dominating definition quickly.  The problem for equivalance folding is slightly different; we want to find the most dominating *value* whose definition block dominates our use quickly.

To make this change, we'd end up having to restructure the leader table (either the sorting thereof, or maybe even introducing multiple leader tables per value) and that complexity is just not worth it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370824 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AArch64][GlobalISel] Legalize 128 bit divisions to libcalls.
Amara Emerson [Tue, 3 Sep 2019 21:42:32 +0000 (21:42 +0000)]
[AArch64][GlobalISel] Legalize 128 bit divisions to libcalls.

Now that we have the infrastructure to support s128 types as parameters
we can expand these to libcalls.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370823 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[GlobalISel][CallLowering] Add support for splitting types according to calling conve...
Amara Emerson [Tue, 3 Sep 2019 21:42:28 +0000 (21:42 +0000)]
[GlobalISel][CallLowering] Add support for splitting types according to calling conventions.

On AArch64, s128 types have to be split into s64 GPRs when passed as arguments.
This change adds the generic support in call lowering for dealing with multiple
registers, for incoming and outgoing args.

Support for splitting for return types not yet implemented.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370822 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MemorySSA] Disable MemorySSA use.
Alina Sbirlea [Tue, 3 Sep 2019 21:20:46 +0000 (21:20 +0000)]
[MemorySSA] Disable MemorySSA use.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370821 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Attributor] Use the delete API for liveness
Johannes Doerfert [Tue, 3 Sep 2019 20:42:16 +0000 (20:42 +0000)]
[Attributor] Use the delete API for liveness

Reviewers: uenoku, sstefan1

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370818 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Attributor] Deduce "no-capture" argument attribute
Johannes Doerfert [Tue, 3 Sep 2019 20:37:24 +0000 (20:37 +0000)]
[Attributor] Deduce "no-capture" argument attribute

Add the no-capture argument attribute deduction to the Attributor
fixpoint framework.

The new string attributed "no-capture-maybe-returned" is introduced to
allow deduction of no-capture through functions that "capture" an
argument but only by "returning" it. It is only used by the Attributor
for testing.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370817 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CodeGen] Use FSHR in DAGTypeLegalizer::ExpandIntRes_MULFIX
Bjorn Pettersson [Tue, 3 Sep 2019 19:35:07 +0000 (19:35 +0000)]
[CodeGen] Use FSHR in DAGTypeLegalizer::ExpandIntRes_MULFIX

Summary:
Simplify the right shift of the intermediate result (given
in four parts) by using funnel shift.

There are some impact on lit tests, but that seems to be
related to register allocation differences due to how FSHR
is expanded on X86 (giving a slightly different operand order
for the OR operations compared to the old code).

Reviewers: leonardchan, RKSimon, spatel, lebedev.ri

Reviewed By: RKSimon

Subscribers: hiraditya, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, s.egerton, pzheng, bevinh, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370813 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoSkip MCJIT unit tests if LLVM is not configured for native compilation
David Blaikie [Tue, 3 Sep 2019 19:30:45 +0000 (19:30 +0000)]
Skip MCJIT unit tests if LLVM is not configured for native compilation

Patch by Sergej Jaskiewicz!

Differential Revision: D67089

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370812 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MemorySSA] Re-enable MemorySSA use.
Alina Sbirlea [Tue, 3 Sep 2019 19:28:37 +0000 (19:28 +0000)]
[MemorySSA] Re-enable MemorySSA use.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370811 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MC] Pass through .code16/32/64 and .syntax unified for COFF
Reid Kleckner [Tue, 3 Sep 2019 18:16:52 +0000 (18:16 +0000)]
[MC] Pass through .code16/32/64 and .syntax unified for COFF

These flags should simply be passed through to the target, which will do
the right thing. Add an MC/X86 test that uses these directives with the
three primary object file formats and shows that they disassemble the
same everywhere.

There is a missing test for .code32 on Windows ARM, since I'm not sure
exactly how to construct one.

Fixes PR43203

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370805 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[GVN] Propagate simple equalities from assumes within the tail of the block
Philip Reames [Tue, 3 Sep 2019 17:31:19 +0000 (17:31 +0000)]
[GVN] Propagate simple equalities from assumes within the tail of the block

This extends the existing logic for propagating constant expressions in an analogous manner for what we do across basic blocks. The core point is that we chose some order of operands, and canonicalize uses towards that one.

The heuristic used is inspired by the one used across blocks; in a follow up change, I'd plan to common them so that the cross block version uses the slightly stronger ordering herein.

As noted by the TODOs in the code, there's a good amount of room for improving the existing code and making it more powerful.  Some follow up work planned.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370791 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AArch64][GlobalISel] Don't import i64imm_32bit pattern at -O0
Jessica Paquette [Tue, 3 Sep 2019 17:21:12 +0000 (17:21 +0000)]
[AArch64][GlobalISel] Don't import i64imm_32bit pattern at -O0

This pattern, when imported at -O0 adds an extra copy via the SUBREG_TO_REG.

This is because the SUBREG_TO_REG is not eliminated. At all other opt levels,
it is eliminated.

This is a 1% geomean code size savings at -O0 on CTMark.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370789 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert r370454 "[LoopIdiomRecognize] BCmp loop idiom recognition"
Roman Lebedev [Tue, 3 Sep 2019 17:14:56 +0000 (17:14 +0000)]
Revert r370454 "[LoopIdiomRecognize] BCmp loop idiom recognition"

https://bugs.llvm.org/show_bug.cgi?id=43206 was filed,
claiming that there is a miscompilation.
Reverting until i investigate.

This reverts commit r370454

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370788 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Tests/GVN] Precommit requested test additions from D66977
Philip Reames [Tue, 3 Sep 2019 17:02:55 +0000 (17:02 +0000)]
[Tests/GVN] Precommit requested test additions from D66977

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370784 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[cmake] Improve comment describing the C4245 warning. NFCI.
Simon Pilgrim [Tue, 3 Sep 2019 16:11:37 +0000 (16:11 +0000)]
[cmake] Improve comment describing the C4245 warning. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370772 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SVE][Inline-Asm] Fix -Wimplicit-fallthrough in AArch64ISelLowering.cpp
Kerry McLaughlin [Tue, 3 Sep 2019 15:45:42 +0000 (15:45 +0000)]
[SVE][Inline-Asm] Fix -Wimplicit-fallthrough in AArch64ISelLowering.cpp

Summary: Adds break to 'x' case in getRegForInlineAsmConstraint added by D66302, fixing the unintentional fallthrough.

Reviewers: sdesmalen, rovka, cameron.mcinally, greened, gribozavr, ruiu

Reviewed By: sdesmalen

Subscribers: bjope, javed.absar, tschuett, kristof.beyls, rkruppe, psnobl, llvm-commits, cfe-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370769 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Merge 2 consecutive HasInt256 branches. NFCI.
Simon Pilgrim [Tue, 3 Sep 2019 14:39:06 +0000 (14:39 +0000)]
[X86] Merge 2 consecutive HasInt256 branches. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370761 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SystemZ] Recognize INLINEASM_BR in backend.
Jonas Paulsson [Tue, 3 Sep 2019 13:31:22 +0000 (13:31 +0000)]
[SystemZ]  Recognize INLINEASM_BR in backend.

SystemZInstrInfo::analyzeBranch() needs to check for INLINEASM_BR
instructions, or it will crash.

Review: Ulrich Weigand

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370753 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agogn build: (manually) merge r370499
Nico Weber [Tue, 3 Sep 2019 13:17:16 +0000 (13:17 +0000)]
gn build: (manually) merge r370499

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370752 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agogn build: Merge r370746
Nico Weber [Tue, 3 Sep 2019 13:01:17 +0000 (13:01 +0000)]
gn build: Merge r370746

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370749 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ARM] Ignore Implicit CPSR regs when lowering from Machine to MC operands
David Green [Tue, 3 Sep 2019 11:30:54 +0000 (11:30 +0000)]
[ARM] Ignore Implicit CPSR regs when lowering from Machine to MC operands

The code here seems to date back to r134705, when tablegen lowering was first
being added. I don't believe that we need to include CPSR implicit operands on
the MCInst. This now works more like other backends (like AArch64), where all
implicit registers are skipped.

This allows the AliasInst for CSEL's to match correctly, as can be seen in the
test changes.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370745 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SystemZ] Add support for fentry.
Jonas Paulsson [Tue, 3 Sep 2019 11:21:12 +0000 (11:21 +0000)]
[SystemZ]  Add support for fentry.

SystemZAsmPrinter now properly emits function calls to __fentry__.

Review: Ulrich Weigand

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370743 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ARM] Invert CSEL predicates if the opposite is a simpler constant to materialise
David Green [Tue, 3 Sep 2019 11:06:24 +0000 (11:06 +0000)]
[ARM] Invert CSEL predicates if the opposite is a simpler constant to materialise

This moves ConstantMaterializationCost into ARMBaseInstrInfo so that it can
also be used in ISel Lowering, adding codesize values to the computed costs, to
be able to compare either approximate instruction counts or codesize costs.

It also adds a HasLowerConstantMaterializationCost, which compares the
ConstantMaterializationCost of two values, returning true if the first is
smaller either in instruction count/codesize, or falling back to the other in
the case that they are equal.

This is used in constant CSEL lowering to invert the predicate if the opposite
is easier to materialise.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370741 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ARM] Generate 8.1-m CSINC, CSNEG and CSINV instructions.
David Green [Tue, 3 Sep 2019 10:53:07 +0000 (10:53 +0000)]
[ARM] Generate 8.1-m CSINC, CSNEG and CSINV instructions.

Arm 8.1-M adds a number of related CSEL instructions, including CSINC, CSNEG and CSINV. These choose between two values given the content in CPSR and a condition, performing an increment, negation or inverse of the false value.

This adds some selection for them, either from constant values or patterns. It does not include CSEL directly, which is currently not always making code better. It is still useful, but we will have to check more carefully where it should and shouldn't be used.

Code by Ranjeet Singh and Simon Tatham, with some modifications from me.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370739 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ARM] Add csel tests. NFC
David Green [Tue, 3 Sep 2019 10:32:46 +0000 (10:32 +0000)]
[ARM] Add csel tests. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370738 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[mips] Switch to the `.text` section after emitting asm file preamble
Simon Atanasyan [Tue, 3 Sep 2019 10:24:07 +0000 (10:24 +0000)]
[mips] Switch to the `.text` section after emitting asm file preamble

Now the last `.section` directive in the MIPS asm file preamble
is the `.section .mdebug.abi`. If assembler code injected for example
by the LLVM `module asm` or the C ` __asm` directives do not contain
explicit switching to the `.text` section it goes to the `.mdebug.abi`
section. It might be unexpected to the user and in fact for example
breaks building some existing code like FreeBSD libc [1].

The patch forces switching to the `.text` section after emitting MIPS
assembler file preamble.

[1] https://bugs.llvm.org/show_bug.cgi?id=43119

Fix PR43119.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370735 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ARM] Fix MVE ldst offset ranges
David Green [Tue, 3 Sep 2019 09:57:02 +0000 (09:57 +0000)]
[ARM] Fix MVE ldst offset ranges

We were using isShiftedInt<7, Shift>(RHSC) to detect the ranges of offsets to
fold into MVE loads/stores. The instructions actually take a 7 bit unsigned
integer which is either added or subtracted. So something more like
isShiftedUInt<7, Shift>(abs(RHSC)).

Instead I've changes this to use the isScaledConstantInRange method, same as in
SelectT2AddrModeImm7Offset used by pre/post inc, which seemed to already be
getting this correct.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370731 91177308-0d34-0410-b5e6-96231b3b80d8