]> granicus.if.org Git - llvm/log
llvm
5 years agogn build: Merge r235758
GN Sync Bot [Fri, 11 Oct 2019 23:12:04 +0000 (23:12 +0000)]
gn build: Merge r235758

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

5 years agogn build: Cmanually) merge r374590
Nico Weber [Fri, 11 Oct 2019 23:05:24 +0000 (23:05 +0000)]
gn build: Cmanually) merge r374590

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

5 years ago[AMDGPU] Use GCN prefix in dpp_combine.mir. NFC.
Stanislav Mekhanoshin [Fri, 11 Oct 2019 22:28:04 +0000 (22:28 +0000)]
[AMDGPU] Use GCN prefix in dpp_combine.mir. NFC.

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

5 years ago[AMDGPU] link dpp pseudos and real instructions on gfx10
Stanislav Mekhanoshin [Fri, 11 Oct 2019 22:03:36 +0000 (22:03 +0000)]
[AMDGPU] link dpp pseudos and real instructions on gfx10

This defaults to zero fi operand, but we do not expose it
anyway. Should we expose it later it needs to be added to
the pseudo.

This enables dpp combining on gfx10.

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

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

5 years ago[lit] Small cleanups in main.py
Julian Lettner [Fri, 11 Oct 2019 21:57:09 +0000 (21:57 +0000)]
[lit] Small cleanups in main.py

* Extract separate function for running tests from main
* Push single-usage imports to point of usage
* Remove unnecessary sys.exit(0) calls

Reviewed By: rnk

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

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

5 years ago[lit] Change regex filter to ignore case
Julian Lettner [Fri, 11 Oct 2019 21:57:06 +0000 (21:57 +0000)]
[lit] Change regex filter to ignore case

Make regex filter `--filter=REGEX` option more lenient via
`re.IGNORECASE`.

Reviewed By: yln

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

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

5 years agoDebugInfo: Use base address selection entries for debug_loc
David Blaikie [Fri, 11 Oct 2019 21:52:41 +0000 (21:52 +0000)]
DebugInfo: Use base address selection entries for debug_loc

Unify the range and loc emission (for both DWARFv4 and DWARFv5 style lists) and take advantage of that unification to use strategic base addresses for loclists.

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

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

5 years ago[mips] Remove unused local variables. NFC
Simon Atanasyan [Fri, 11 Oct 2019 21:51:39 +0000 (21:51 +0000)]
[mips] Remove unused local variables. NFC

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

5 years ago[mips] Store 64-bit `li.d' operand as a single 8-byte value
Simon Atanasyan [Fri, 11 Oct 2019 21:51:33 +0000 (21:51 +0000)]
[mips] Store 64-bit `li.d' operand as a single 8-byte value

Now assembler generates two consecutive `.4byte` directives to store
64-bit `li.d' operand. The first directive stores high 4-byte of the
value. The second directive stores low 4-byte of the value. But on
64-bit system we load this value at once and get wrong result if the
system is little-endian.

This patch fixes the bug. It stores the `li.d' operand as a single
8-byte value.

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

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

5 years ago[mips] Use less instruction to load zero into FPR by li.s / li.d pseudos
Simon Atanasyan [Fri, 11 Oct 2019 21:51:23 +0000 (21:51 +0000)]
[mips] Use less instruction to load zero into FPR by li.s / li.d pseudos

If `li.s` or `li.d` loads zero into a FPR, it's not necessary to load
zero into `at` GPR register and then move its value into a floating
point register. We can use as a source register the `zero / $0` one.

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

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

5 years ago[GISel][UnitTest] Fix a bunch of tests that were not doing anything
Quentin Colombet [Fri, 11 Oct 2019 20:58:26 +0000 (20:58 +0000)]
[GISel][UnitTest] Fix a bunch of tests that were not doing anything

After r368065, all the tests using GISelMITest must call setUp() before
doing anything, otherwise the TargetMachine is not going to be set up.
A few tests added after that commit were not doing that and ended up
testing effectively nothing.

Fix the setup of all the tests and fix the failing tests.

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

5 years agoRevert 374373: [Codegen] Alter the default promotion for saturating adds and subs
David Green [Fri, 11 Oct 2019 20:33:03 +0000 (20:33 +0000)]
Revert 374373: [Codegen] Alter the default promotion for saturating adds and subs

This commit is not extending the promoted integers as it should. Reverting
whilst I look into the details.

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

5 years ago[Mips][llvm-exegesis] Add a Mips target
Simon Atanasyan [Fri, 11 Oct 2019 20:26:08 +0000 (20:26 +0000)]
[Mips][llvm-exegesis] Add a Mips target

The target does just enough to be able to run llvm-exegesis in latency
mode for at least some opcodes.

Patch by MiloÅ¡ Stojanović.

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

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

5 years ago[GISel][CallLowering] Enable vector support in argument lowering
Quentin Colombet [Fri, 11 Oct 2019 20:22:57 +0000 (20:22 +0000)]
[GISel][CallLowering] Enable vector support in argument lowering

The exciting code is actually already enough to handle the splitting
of vector arguments but we were lacking a test case.

This commit adds a test case for vector argument lowering involving
splitting and enable the related support in call lowering.

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

5 years ago[MachineIRBuilder] Fix an assertion failure with buildMerge
Quentin Colombet [Fri, 11 Oct 2019 20:22:47 +0000 (20:22 +0000)]
[MachineIRBuilder] Fix an assertion failure with buildMerge

Teach buildMerge how to deal with scalar to vector kind of requests.

Prior to this patch, buildMerge would issue either a G_MERGE_VALUES
when all the vregs are scalars or a G_CONCAT_VECTORS when the destination
vreg is a vector.
G_CONCAT_VECTORS was actually not the proper instruction when the source
vregs were scalars and the compiler would assert that the sources must
be vectors. Instead we want is to issue a G_BUILD_VECTOR when we are
in this situation.

This patch fixes that.

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

5 years agollvm-dwarfdump: Add verbose printing for debug_loclists
David Blaikie [Fri, 11 Oct 2019 19:06:35 +0000 (19:06 +0000)]
llvm-dwarfdump: Add verbose printing for debug_loclists

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

5 years ago[X86][SSE] Add support for v4i8 add reduction
Simon Pilgrim [Fri, 11 Oct 2019 17:54:15 +0000 (17:54 +0000)]
[X86][SSE] Add support for v4i8 add reduction

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

5 years agogn build: (manually) merge r374110
Nico Weber [Fri, 11 Oct 2019 17:42:24 +0000 (17:42 +0000)]
gn build: (manually) merge r374110

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

5 years ago[AArch64] add tests for (v)select-of-constants; NFC
Sanjay Patel [Fri, 11 Oct 2019 16:10:23 +0000 (16:10 +0000)]
[AArch64] add tests for (v)select-of-constants; NFC

These are copied from existing test files in x86/PPC.

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

5 years ago[AArch64][SVE] Implement sdot and udot (lane) intrinsics
Kerry McLaughlin [Fri, 11 Oct 2019 15:53:41 +0000 (15:53 +0000)]
[AArch64][SVE] Implement sdot and udot (lane) intrinsics

Summary:
Implements the following arithmetic intrinsics:
  - int_aarch64_sve_sdot
  - int_aarch64_sve_sdot_lane
  - int_aarch64_sve_udot
  - int_aarch64_sve_udot_lane

This patch includes tests for the Subdivide4Argument type added by D67549

Reviewers: sdesmalen, SjoerdMeijer, greened, rengolin, rovka

Reviewed By: sdesmalen

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

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

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

5 years ago[VPlan] Add moveAfter to VPRecipeBase.
Florian Hahn [Fri, 11 Oct 2019 15:36:55 +0000 (15:36 +0000)]
[VPlan] Add moveAfter to VPRecipeBase.

This patch adds a moveAfter method to VPRecipeBase, which can be used to
move elements after other elements, across VPBasicBlocks, if necessary.

Reviewers: dcaballe, hsaito, rengolin, hfinkel

Reviewed By: dcaballe

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

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

5 years ago[AIX] Use .space instead of .zero in assembly
David Tenty [Fri, 11 Oct 2019 15:07:28 +0000 (15:07 +0000)]
[AIX] Use .space instead of .zero in assembly

Summary:
The AIX system assembler does not understand .zero, so we should prefer
emitting .space.

Subscribers: nemanjai, hiraditya, kbarton, MaskRay, jsji, llvm-commits

Tags: #llvm

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

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

5 years ago[AMDGPU][MC][GFX9][GFX10] Corrected number of src operands for ds_[read/write]_addtid_b32
Dmitry Preobrazhensky [Fri, 11 Oct 2019 14:53:26 +0000 (14:53 +0000)]
[AMDGPU][MC][GFX9][GFX10] Corrected number of src operands for ds_[read/write]_addtid_b32

See https://bugs.llvm.org/show_bug.cgi?id=37941

Reviewers: arsenm, rampitec

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

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

5 years agogn build: Merge r374558
GN Sync Bot [Fri, 11 Oct 2019 14:48:31 +0000 (14:48 +0000)]
gn build: Merge r374558

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

5 years ago[AMDGPU][MC][GFX6][GFX7][GFX10] Added instructions buffer_atomic_[fcmpswap/fmin/fmax]*
Dmitry Preobrazhensky [Fri, 11 Oct 2019 14:44:51 +0000 (14:44 +0000)]
[AMDGPU][MC][GFX6][GFX7][GFX10] Added instructions buffer_atomic_[fcmpswap/fmin/fmax]*

See https://bugs.llvm.org/show_bug.cgi?id=28232

Reviewers: arsenm, rampitec

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

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

5 years ago[AMDGPU][MC][GFX10] Enabled null for 64-bit dst operands
Dmitry Preobrazhensky [Fri, 11 Oct 2019 14:35:11 +0000 (14:35 +0000)]
[AMDGPU][MC][GFX10] Enabled null for 64-bit dst operands

See https://bugs.llvm.org/show_bug.cgi?id=43524

Reviewers: arsenm, rampitec

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

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

5 years ago[llvm] [ocaml] Support linking against dylib
Michal Gorny [Fri, 11 Oct 2019 14:32:43 +0000 (14:32 +0000)]
[llvm] [ocaml] Support linking against dylib

Support linking OCaml modules against LLVM dylib when requested,
rather than against static libs that might not be installed at all.

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

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

5 years ago[DAGCombiner] fold vselect-of-constants to shift
Sanjay Patel [Fri, 11 Oct 2019 14:17:56 +0000 (14:17 +0000)]
[DAGCombiner] fold vselect-of-constants to shift

The diffs suggest that we are missing some more basic
analysis/transforms, but this keeps the vector path in
sync with the scalar (rL374397). This is again a
preliminary step for introducing the reverse transform
in IR as proposed in D63382.

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

5 years agoFix compilation warnings. NFC.
Michael Liao [Fri, 11 Oct 2019 14:09:44 +0000 (14:09 +0000)]
Fix compilation warnings. NFC.

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

5 years ago[AMDGPU][MC] Corrected parsing of optional operands
Dmitry Preobrazhensky [Fri, 11 Oct 2019 14:05:09 +0000 (14:05 +0000)]
[AMDGPU][MC] Corrected parsing of optional operands

See https://bugs.llvm.org/show_bug.cgi?id=43486

Reviewers: artem.tamazov, arsenm

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

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

5 years ago[mips] Follow-up to r374544. Fix test case.
Simon Atanasyan [Fri, 11 Oct 2019 12:58:37 +0000 (12:58 +0000)]
[mips] Follow-up to r374544. Fix test case.

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

5 years ago[Tests] Output of od can be lower or upper case (llvm-objcopy/yaml2obj).
Kai Nacke [Fri, 11 Oct 2019 12:50:57 +0000 (12:50 +0000)]
[Tests] Output of od can be lower or upper case (llvm-objcopy/yaml2obj).

The command `od -t x` is used to dump data in hex format.
The LIT tests assumes that the hex characters are in lowercase.
However, there are also platforms which use uppercase letter.

To solve this issue the tests are updated to use the new
`--ignore-case` option of FileCheck.

Reviewers: Bigcheese, jakehehrlich, rupprecht, espindola, alexshap, jhenderson

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

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

5 years ago[mips] Fix loading "double" immediate into a GPR and FPR
Simon Atanasyan [Fri, 11 Oct 2019 12:33:12 +0000 (12:33 +0000)]
[mips] Fix loading "double" immediate into a GPR and FPR

If a "double" (64-bit) value has zero low 32-bits, it's possible to load
such value into a GP/FP registers as an instruction immediate. But now
assembler loads only high 32-bits of the value.

For example, if a target register is GPR the `li.d $4, 1.0` instruction
converts into the `lui $4, 16368` one. As a result, we get `0x3FF00000`
in the register. While a correct representation of the `1.0` value is
`0x3FF0000000000000`. The patch fixes that.

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

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

5 years ago[llvm-readobj] - Remove excessive fields when dumping "Version symbols".
George Rimar [Fri, 11 Oct 2019 12:27:11 +0000 (12:27 +0000)]
[llvm-readobj] - Remove excessive fields when dumping "Version symbols".

This removes a few fields that are not useful:
"Section Name", "Address", "Offset" and "Link"
(they duplicated the information available under
the "Sections [" tag).

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

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

5 years agoDead Virtual Function Elimination
Oliver Stannard [Fri, 11 Oct 2019 11:59:55 +0000 (11:59 +0000)]
Dead Virtual Function Elimination

Currently, it is hard for the compiler to remove unused C++ virtual
functions, because they are all referenced from vtables, which are referenced
by constructors. This means that if the constructor is called from any live
code, then we keep every virtual function in the final link, even if there
are no call sites which can use it.

This patch allows unused virtual functions to be removed during LTO (and
regular compilation in limited circumstances) by using type metadata to match
virtual function call sites to the vtable slots they might load from. This
information can then be used in the global dead code elimination pass instead
of the references from vtables to virtual functions, to more accurately
determine which functions are reachable.

To make this transformation safe, I have changed clang's code-generation to
always load virtual function pointers using the llvm.type.checked.load
intrinsic, instead of regular load instructions. I originally tried writing
this using clang's existing code-generation, which uses the llvm.type.test
and llvm.assume intrinsics after doing a normal load. However, it is possible
for optimisations to obscure the relationship between the GEP, load and
llvm.type.test, causing GlobalDCE to fail to find virtual function call
sites.

The existing linkage and visibility types don't accurately describe the scope
in which a virtual call could be made which uses a given vtable. This is
wider than the visibility of the type itself, because a virtual function call
could be made using a more-visible base class. I've added a new
!vcall_visibility metadata type to represent this, described in
TypeMetadata.rst. The internalization pass and libLTO have been updated to
change this metadata when linking is performed.

This doesn't currently work with ThinLTO, because it needs to see every call
to llvm.type.checked.load in the linkage unit. It might be possible to
extend this optimisation to be able to use the ThinLTO summary, as was done
for devirtualization, but until then that combination is rejected in the
clang driver.

To test this, I've written a fuzzer which generates random C++ programs with
complex class inheritance graphs, and virtual functions called through object
and function pointers of different types. The programs are spread across
multiple translation units and DSOs to test the different visibility
restrictions.

I've also tried doing bootstrap builds of LLVM to test this. This isn't
ideal, because only classes in anonymous namespaces can be optimised with
-fvisibility=default, and some parts of LLVM (plugins and bugpoint) do not
work correctly with -fvisibility=hidden. However, there are only 12 test
failures when building with -fvisibility=hidden (and an unmodified compiler),
and this change does not cause any new failures for either value of
-fvisibility.

On the 7 C++ sub-benchmarks of SPEC2006, this gives a geomean code-size
reduction of ~6%, over a baseline compiled with "-O2 -flto
-fvisibility=hidden -fwhole-program-vtables". The best cases are reductions
of ~14% in 450.soplex and 483.xalancbmk, and there are no code size
increases.

I've also run this on a set of 8 mbed-os examples compiled for Armv7M, which
show a geomean size reduction of ~3%, again with no size increases.

I had hoped that this would have no effect on performance, which would allow
it to awlays be enabled (when using -fwhole-program-vtables). However, the
changes in clang to use the llvm.type.checked.load intrinsic are causing ~1%
performance regression in the C++ parts of SPEC2006. It should be possible to
recover some of this perf loss by teaching optimisations about the
llvm.type.checked.load intrinsic, which would make it worth turning this on
by default (though it's still dependent on -fwhole-program-vtables).

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

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

5 years ago[FileCheck] Implement --ignore-case option.
Kai Nacke [Fri, 11 Oct 2019 11:59:14 +0000 (11:59 +0000)]
[FileCheck] Implement --ignore-case option.

The FileCheck utility is enhanced to support a `--ignore-case`
option. This is useful in cases where the output of Unix tools
differs in case (e.g. case not specified by Posix).

Reviewers: Bigcheese, jakehehrlich, rupprecht, espindola, alexshap, jhenderson, MaskRay

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

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

5 years ago[SCEV] Add stricter verification option.
Florian Hahn [Fri, 11 Oct 2019 11:46:40 +0000 (11:46 +0000)]
[SCEV] Add stricter verification option.

Currently -verify-scev only fails if there is a constant difference
between two BE counts. This misses a lot of cases.

This patch adds a -verify-scev-strict options, which fails for any
non-zero differences, if used together with -verify-scev.

With the stricter checking, some unit tests fail because
of mis-matches, especially around IndVarSimplify.

If there is no reason I am missing for just checking constant deltas, I
am planning on looking into the various failures.

Reviewers: efriedma, sanjoy.google, reames, atrick

Reviewed By: sanjoy.google

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

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

5 years ago[X86] isFNEG - add recursion depth limit
Simon Pilgrim [Fri, 11 Oct 2019 11:34:18 +0000 (11:34 +0000)]
[X86] isFNEG - add recursion depth limit

Now that its used by isNegatibleForFree we should try to avoid costly deep recursion

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

5 years ago[llvm-exegesis] Show noise cluster in analysis output.
Clement Courbet [Fri, 11 Oct 2019 11:33:18 +0000 (11:33 +0000)]
[llvm-exegesis] Show noise cluster in analysis output.

Reviewers: gchatelet

Subscribers: tschuett, llvm-commits

Tags: #llvm

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

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

5 years ago[Windows] Use information from the PE32 exceptions directory to construct unwind...
Aleksandr Urakov [Fri, 11 Oct 2019 09:03:29 +0000 (09:03 +0000)]
[Windows] Use information from the PE32 exceptions directory to construct unwind plans

This patch adds an implementation of unwinding using PE EH info. It allows to
get almost ideal call stacks on 64-bit Windows systems (except some epilogue
cases, but I believe that they can be fixed with unwind plan disassembly
augmentation in the future).

To achieve the goal the CallFrameInfo abstraction was made. It is based on the
DWARFCallFrameInfo class interface with a few changes to make it less
DWARF-specific.

To implement the new interface for PECOFF object files the class PECallFrameInfo
was written. It uses the next helper classes:

- UnwindCodesIterator helps to iterate through UnwindCode structures (and
  processes chained infos transparently);
- EHProgramBuilder with the use of UnwindCodesIterator constructs EHProgram;
- EHProgram is, by fact, a vector of EHInstructions. It creates an abstraction
  over the low-level unwind codes and simplifies work with them. It contains
  only the information that is relevant to unwinding in the unified form. Also
  the required unwind codes are read from the object file only once with it;
- EHProgramRange allows to take a range of EHProgram and to build an unwind row
  for it.

So, PECallFrameInfo builds the EHProgram with EHProgramBuilder, takes the ranges
corresponding to every offset in prologue and builds the rows of the resulted
unwind plan. The resulted plan covers the whole range of the function except the
epilogue.

Reviewers: jasonmolenda, asmith, amccarth, clayborg, JDevlieghere, stella.stamenova, labath, espindola

Reviewed By: jasonmolenda

Subscribers: leonid.mashinskiy, emaste, mgorny, aprantl, arichardson, MaskRay, lldb-commits, llvm-commits

Tags: #lldb

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

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

5 years agoInsert module constructors in a module pass
Vitaly Buka [Fri, 11 Oct 2019 08:47:03 +0000 (08:47 +0000)]
Insert module constructors in a module pass

Summary:
If we insert them from function pass some analysis may be missing or invalid.
Fixes PR42877.

Reviewers: eugenis, leonardchan

Reviewed By: leonardchan

Subscribers: hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

llvm-svn: 374481
Signed-off-by: Vitaly Buka <vitalybuka@google.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374527 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[TableGen] Fix a bug that MCSchedClassDesc is interfered between different SchedModel
QingShan Zhang [Fri, 11 Oct 2019 08:36:54 +0000 (08:36 +0000)]
[TableGen] Fix a bug that MCSchedClassDesc is interfered between different SchedModel

Assume that, ModelA has scheduling resource for InstA and ModelB has scheduling resource for InstB. This is what the llvm::MCSchedClassDesc looks like:

llvm::MCSchedClassDesc ModelASchedClasses[] = {
...
InstA, 0, ...
InstB, -1,...
};

llvm::MCSchedClassDesc ModelBSchedClasses[] = {
...
InstA, -1,...
InstB, 0,...
};
The -1 means invalid num of macro ops, while it is valid if it is >=0. This is what we look like now:

llvm::MCSchedClassDesc ModelASchedClasses[] = {
...
InstA, 0, ...
InstB, 0,...
};

llvm::MCSchedClassDesc ModelBSchedClasses[] = {
...
InstA, 0,...
InstB, 0,...
};
And compiler hit the assertion here because the SCDesc is valid now for both InstA and InstB.

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

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

5 years ago[X86] Add v8i64->v8i8 ssat/usat/packus truncate tests to min-legal-vector-width.ll
Craig Topper [Fri, 11 Oct 2019 07:24:36 +0000 (07:24 +0000)]
[X86] Add v8i64->v8i8 ssat/usat/packus truncate tests to min-legal-vector-width.ll

I wonder if we should split the v8i8 stores in order to form
two v4i8 saturating truncating stores. This would remove the
unpckl needed to concatenated the v4i8 results to make a
single store.

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

5 years ago[ADT][Statistics] Fix test after rL374490
Kadir Cetinkaya [Fri, 11 Oct 2019 07:19:54 +0000 (07:19 +0000)]
[ADT][Statistics] Fix test after rL374490

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

5 years agoFix modules build for r374337
Pavel Labath [Fri, 11 Oct 2019 07:16:19 +0000 (07:16 +0000)]
Fix modules build for r374337

A modules build failed with the following error:
  call to function 'operator&' that is neither visible in the template definition nor found by argument-dependent lookup

Fix that by declaring the appropriate operators in the llvm::minidump
namespace.

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

5 years ago[PowerPC] Remove assertion "Shouldn't overwrite a register before it is killed"
Yi-Hong Lyu [Fri, 11 Oct 2019 05:32:29 +0000 (05:32 +0000)]
[PowerPC] Remove assertion "Shouldn't overwrite a register before it is killed"

The assertion is everzealous and fail tests like:

  renamable $x3 = LI8 0
  STD renamable $x3, 16, $x1
  renamable $x3 = LI8 0

Remove the assertion since killed flag of $x3 is not mandentory.

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

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

5 years ago[NFC] run specific pass instead of whole -O3 pipeline for popcount recoginzation...
Chen Zheng [Fri, 11 Oct 2019 05:30:18 +0000 (05:30 +0000)]
[NFC] run specific pass instead of whole -O3 pipeline for popcount recoginzation testcase.

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

5 years ago[InstCombine] recognize popcount.
Chen Zheng [Fri, 11 Oct 2019 05:13:56 +0000 (05:13 +0000)]
[InstCombine] recognize popcount.

  This patch recognizes popcount intrinsic according to algorithm from website
  http://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetParallel

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

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

5 years ago[X86] Add a DAG combine to turn v16i16->v16i8 VTRUNCUS+store into a saturating trunca...
Craig Topper [Fri, 11 Oct 2019 04:16:49 +0000 (04:16 +0000)]
[X86] Add a DAG combine to turn v16i16->v16i8 VTRUNCUS+store into a saturating truncating store.

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

5 years ago[X86] Add test case for trunc_packus_v16i32_v16i8_store to min-legal-vector-width.ll
Craig Topper [Fri, 11 Oct 2019 04:02:04 +0000 (04:02 +0000)]
[X86] Add test case for trunc_packus_v16i32_v16i8_store to min-legal-vector-width.ll

We aren't folding the vpmovuswb into the store.

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

5 years ago[CVP] Remove a masking operation if range information implies it's a noop
Philip Reames [Fri, 11 Oct 2019 03:48:56 +0000 (03:48 +0000)]
[CVP] Remove a masking operation if range information implies it's a noop

This is really a known bits style transformation, but known bits isn't context sensitive. The particular case which comes up happens to involve a range which allows range based reasoning to eliminate the mask pattern, so handle that case specifically in CVP.

InstCombine likes to generate the mask-by-low-bits pattern when widening an arithmetic expression which includes a zext in the middle.

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

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

5 years ago[X86] Add more packus/ssat/usat truncate tests from legal vectors to less than 128...
Craig Topper [Fri, 11 Oct 2019 03:46:39 +0000 (03:46 +0000)]
[X86] Add more packus/ssat/usat truncate tests from legal vectors to less than 128-bit vectors.

Some of these have sub-optimal codegen for avx512 relative to avx2.

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

5 years agoRevert 374481 "[tsan,msan] Insert module constructors in a module pass"
Nico Weber [Fri, 11 Oct 2019 02:44:20 +0000 (02:44 +0000)]
Revert 374481 "[tsan,msan] Insert module constructors in a module pass"

CodeGen/sanitizer-module-constructor.c fails on mac and windows, see e.g.
http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/11424

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

5 years ago[JITLink] Disable the MachO/AArch64 testcase while investigating bot failures.
Lang Hames [Fri, 11 Oct 2019 01:58:12 +0000 (01:58 +0000)]
[JITLink] Disable the MachO/AArch64 testcase while investigating bot failures.

The windows bots are failing due to a memory layout error. Temporarily disabling
while I investigate whether this can be worked around, or whether the test
should be disabled on Windows.

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

5 years ago[JITLink] Fix MachO/arm64 GOTPAGEOFF encoding.
Lang Hames [Fri, 11 Oct 2019 01:50:31 +0000 (01:50 +0000)]
[JITLink] Fix MachO/arm64 GOTPAGEOFF encoding.

The original implementation failed to shift the immediate down.

This should fix some of the bot failures due to r374476.

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

5 years ago[Attributor][FIX] Do not replace musstail calls with constant
Johannes Doerfert [Fri, 11 Oct 2019 01:45:32 +0000 (01:45 +0000)]
[Attributor][FIX] Do not replace musstail calls with constant

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

5 years agoAMDGPU: Move SelectFlatOffset back into AMDGPUISelDAGToDAG
Matt Arsenault [Fri, 11 Oct 2019 01:28:27 +0000 (01:28 +0000)]
AMDGPU: Move SelectFlatOffset back into AMDGPUISelDAGToDAG

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

5 years ago[Stats] Add ALWAYS_ENABLED_STATISTIC enabled regardless of LLVM_ENABLE_STATS.
Volodymyr Sapsai [Fri, 11 Oct 2019 00:57:41 +0000 (00:57 +0000)]
[Stats] Add ALWAYS_ENABLED_STATISTIC enabled regardless of LLVM_ENABLE_STATS.

The intended usage is to measure relatively expensive operations. So the
cost of the statistic is negligible compared to the cost of a measured
operation and can be enabled all the time without impairing the
compilation time.

rdar://problem/55715134

Reviewers: dsanders, bogner, rtereshin

Reviewed By: dsanders

Subscribers: hiraditya, jkorous, dexonsmith, ributzka, cfe-commits, llvm-commits

Tags: #llvm

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

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

5 years ago[X86] Improve the AVX512 bailout in combineTruncateWithSat to allow pack instructions...
Craig Topper [Fri, 11 Oct 2019 00:38:51 +0000 (00:38 +0000)]
[X86] Improve the AVX512 bailout in combineTruncateWithSat to allow pack instructions in more situations.

If we don't have VLX we won't end up selecting a saturating
truncate for 256-bit or smaller vectors so we should just use
the pack lowering.

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

5 years ago[X86] Update trunc_packus_v32i32_v32i8 test in min-legal-vector-width.ll to use a...
Craig Topper [Fri, 11 Oct 2019 00:38:41 +0000 (00:38 +0000)]
[X86] Update trunc_packus_v32i32_v32i8 test in min-legal-vector-width.ll to use a load for the large type and add the min-legal-vector-width attribute.

The attribute is needed to avoid zmm registers. Using memory
avoids argument splitting for large vectors.

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

5 years agogn build: Merge r374476
GN Sync Bot [Thu, 10 Oct 2019 23:49:59 +0000 (23:49 +0000)]
gn build: Merge r374476

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

5 years ago[tsan,msan] Insert module constructors in a module pass
Vitaly Buka [Thu, 10 Oct 2019 23:49:10 +0000 (23:49 +0000)]
[tsan,msan] Insert module constructors in a module pass

Summary:
If we insert them from function pass some analysis may be missing or invalid.
Fixes PR42877.

Reviewers: eugenis, leonardchan

Reviewed By: leonardchan

Subscribers: hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

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

5 years ago[msan, NFC] Move option parsing into constructor
Vitaly Buka [Thu, 10 Oct 2019 23:49:07 +0000 (23:49 +0000)]
[msan, NFC] Move option parsing into constructor

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

5 years agoFix compilation warning due to typo.
Michael Liao [Thu, 10 Oct 2019 23:48:56 +0000 (23:48 +0000)]
Fix compilation warning due to typo.

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

5 years ago[JITLink] Add an initial implementation of JITLink for MachO/AArch64.
Lang Hames [Thu, 10 Oct 2019 23:37:51 +0000 (23:37 +0000)]
[JITLink] Add an initial implementation of JITLink for MachO/AArch64.

This implementation has support for all relocation types except TLV.

Compact unwind sections are not yet supported, so exceptions/unwinding will not
work.

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

5 years ago[JITLink] Move MachO/x86 got test further down in the data section.
Lang Hames [Thu, 10 Oct 2019 23:37:49 +0000 (23:37 +0000)]
[JITLink] Move MachO/x86 got test further down in the data section.

'named_data' should be the first symbol in the data section.

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

5 years agodocs/DeveloperPolicy: Add instructions for requesting GitHub commit access
Tom Stellard [Thu, 10 Oct 2019 23:36:06 +0000 (23:36 +0000)]
docs/DeveloperPolicy: Add instructions for requesting GitHub commit access

Subscribers: mehdi_amini, jtony, xbolva00, llvm-commits

Tags: #llvm

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

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

5 years ago[MemorySSA] Update Phi simplification.
Alina Sbirlea [Thu, 10 Oct 2019 23:27:21 +0000 (23:27 +0000)]
[MemorySSA] Update Phi simplification.

When simplifying a Phi to the unique value found incoming, check that
there wasn't a Phi already created to break a cycle. If so, remove it.
Resolves PR43541.

Some additional nits included.

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

5 years ago[GISel] Simplifying return from else in function. NFC
Marcello Maggioni [Thu, 10 Oct 2019 21:51:30 +0000 (21:51 +0000)]
[GISel] Simplifying return from else in function. NFC

Forgot to integrate this little change in previous commit

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

5 years ago[X86] Guard against leaving a dangling node in combineTruncateWithSat.
Craig Topper [Thu, 10 Oct 2019 21:46:52 +0000 (21:46 +0000)]
[X86] Guard against leaving a dangling node in combineTruncateWithSat.

When handling the packus pattern for i32->i8 we do a two step
process using a packss to i16 followed by a packus to i8. If the
final i8 step is a type with less than 64-bits the packus step
will return SDValue(), but the i32->i16 step might have succeeded.
This leaves the nodes from the middle step dangling.

Guard against this by pre-checking that the number of elements is
at least 8 before doing the middle step.

With that check in place this should mean the only other
case the middle step itself can fail is when SSE2 is disabled. So
add an early SSE2 check then just assert that neither the middle
or final step ever fail.

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

5 years ago[X86] Add test cases for packus/ssat/usat 32i32->v32i8 test cases. NFC
Craig Topper [Thu, 10 Oct 2019 21:46:44 +0000 (21:46 +0000)]
[X86] Add test cases for packus/ssat/usat 32i32->v32i8 test cases. NFC

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

5 years ago[GISel] Allow getConstantVRegVal() to return G_FCONSTANT values.
Marcello Maggioni [Thu, 10 Oct 2019 21:46:26 +0000 (21:46 +0000)]
[GISel] Allow getConstantVRegVal() to return G_FCONSTANT values.

In GISel we have both G_CONSTANT and G_FCONSTANT, but because
in GISel we don't really have a concept of Float vs Int value
the only difference between the two is where the data originates
from.

What both G_CONSTANT and G_FCONSTANT return is just a bag of bits
with the constant representation in it.

By making getConstantVRegVal() return G_FCONSTANTs bit representation
as well we allow ConstantFold and other things to operate with
G_FCONSTANT.

Adding tests that show ConstantFolding to work on mixed G_CONSTANT
and G_FCONSTANT sources.

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

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

5 years ago[AMDGPU] Handle undef old operand in DPP combine
Stanislav Mekhanoshin [Thu, 10 Oct 2019 21:32:41 +0000 (21:32 +0000)]
[AMDGPU] Handle undef old operand in DPP combine

It was missing an undef flag.

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

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

5 years ago[ValueTracking] Improve pointer offset computation for cases of same base
Rong Xu [Thu, 10 Oct 2019 21:30:43 +0000 (21:30 +0000)]
[ValueTracking] Improve pointer offset computation for cases of same base

This patch improves the handling of pointer offset in GEP expressions where
one argument is the base pointer. isPointerOffset() is being used by memcpyopt
where current code synthesizes consecutive 32 bytes stores to one store and
two memset intrinsic calls. With this patch, we convert the stores to one
memset intrinsic.

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

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

5 years ago[InstCombine] Add test case for PR43617 (NFC)
Evandro Menezes [Thu, 10 Oct 2019 21:29:10 +0000 (21:29 +0000)]
[InstCombine] Add test case for PR43617 (NFC)

Also, refactor check in `LibCallSimplifier::optimizeLog()`.

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

5 years ago[lit] Break main into smaller functions
Julian Lettner [Thu, 10 Oct 2019 21:24:41 +0000 (21:24 +0000)]
[lit] Break main into smaller functions

This change is purely mechanical.  I will do further cleanups of
parameter usages.

Reviewed By: rnk

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

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

5 years ago[MemorySSA] Additional handling of unreachable blocks.
Alina Sbirlea [Thu, 10 Oct 2019 20:43:06 +0000 (20:43 +0000)]
[MemorySSA] Additional handling of unreachable blocks.

Summary:
Whenever we get the previous definition, the assumption is that the
recursion starts ina  reachable block.
If the recursion starts in an unreachable block, we may recurse
indefinitely. Handle this case by returning LoE if the block is
unreachable.

Resolves PR43426.

Reviewers: george.burgess.iv

Subscribers: Prazek, sanjoy.google, llvm-commits

Tags: #llvm

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

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

5 years ago[System Model] [TTI] Move default cache/prefetch implementations
David Greene [Thu, 10 Oct 2019 20:39:27 +0000 (20:39 +0000)]
[System Model] [TTI] Move default cache/prefetch implementations

Move the default implementations of cache and prefetch queries to
TargetTransformInfoImplBase and delete them from NoTIIImpl.  This brings these
interfaces in line with how other TTI interfaces work.

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

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

5 years agoFix a documentation warning from GSYM commit.
Greg Clayton [Thu, 10 Oct 2019 20:29:11 +0000 (20:29 +0000)]
Fix a documentation warning from GSYM commit.

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

5 years ago[PDB] Fix bug when using multiple PCH header objects with the same name.
Zachary Turner [Thu, 10 Oct 2019 20:25:51 +0000 (20:25 +0000)]
[PDB] Fix bug when using multiple PCH header objects with the same name.

A common pattern in Windows is to have all your precompiled headers
use an object named stdafx.obj.  If you've got a project with many
different static libs, you might use a separate PCH for each one of
these.

During the final link step, a file from A might reference the PCH
object from A, but it will have the same name (stdafx.obj) as any
other PCH from another project.  The only difference will be the
path.  For example, A might be A/stdafx.obj while B is B/stdafx.obj.

The existing algorithm checks only the filename that was passed on
the command line (or stored in archive), but this is insufficient in
the case where relative paths are used, because depending on the
command line object file / library order, it might find the wrong
PCH object first resulting in a signature mismatch.

The fix here is to simply check whether the absolute path of the
PCH object (which is stored in the input obj file for the file that
references the PCH) *ends with* the full relative path of whatever
is specified on the command line (or is in the archive).

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

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

5 years ago[lit] Add comment explaining the LIT_OPTS env var overrides command line options
Julian Lettner [Thu, 10 Oct 2019 20:23:28 +0000 (20:23 +0000)]
[lit] Add comment explaining the LIT_OPTS env var overrides command line options

Normally, command line options override environment variables.  Add
comment to state that we are doing the reverse on purpose.

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

5 years agoADT: Save a word in every StringSet entry
Jordan Rose [Thu, 10 Oct 2019 20:22:53 +0000 (20:22 +0000)]
ADT: Save a word in every StringSet entry

Add a specialization to StringMap (actually StringMapEntry) for a
value type of NoneType (the type of llvm::None), and use it for
StringSet. This'll save us a word from every entry in a StringSet,
used for alignment with the size_t that stores the string length.

I could have gone all the way to some kind of empty base class
optimization, but that seemed like overkill. Someone can consider
adding that in the future, though.

https://reviews.llvm.org/D68586

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

5 years ago[x86] reduce duplicate test assertions; NFC
Sanjay Patel [Thu, 10 Oct 2019 19:52:27 +0000 (19:52 +0000)]
[x86] reduce duplicate test assertions; NFC

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

5 years ago[lit] Bring back `--threads` option alias
Julian Lettner [Thu, 10 Oct 2019 19:43:57 +0000 (19:43 +0000)]
[lit] Bring back `--threads` option alias

Bring back `--threads` option which was lost in the move of the
command line argument parsing code to cl_arguments.py.  Update docs
since `--workers` is preferred.

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

5 years ago[X86] Use packusdw+vpmovuswb to implement v16i32->V16i8 that clamps signed inputs...
Craig Topper [Thu, 10 Oct 2019 19:40:44 +0000 (19:40 +0000)]
[X86] Use packusdw+vpmovuswb to implement v16i32->V16i8 that clamps signed inputs to be between 0 and 255 when zmm registers are disabled on SKX.

If we've disable zmm registers, the v16i32 will need to be split. This split will propagate through min/max the truncate. This creates two sequences that need to be concatenated back to v16i8. We can instead use packusdw to do part of the clamping, truncating, and concatenating all at once. Then we can use a vpmovuswb to finish off the clamp.

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

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

5 years agoRevert r374388: "[lit] Make internal diff work in pipelines"
Joel E. Denny [Thu, 10 Oct 2019 19:25:39 +0000 (19:25 +0000)]
Revert r374388: "[lit] Make internal diff work in pipelines"

This breaks a Windows bot.

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

5 years ago[PowerPC][docs] Update IBM official docs in Compiler Writers Info page
Jinsong Ji [Thu, 10 Oct 2019 19:25:30 +0000 (19:25 +0000)]
[PowerPC][docs] Update IBM official docs in Compiler Writers Info page

Summary:
Just realized that most of the links in this page are deprecated.
So update some important reference here:
* adding PowerISA 3.0B/2.7B
* adding P8/P9 User Manual
* ELFv2 ABI and errata

Move deprecated ones into "Other documents..".

Reviewers: #powerpc, hfinkel, nemanjai

Reviewed By: hfinkel

Subscribers: shchenz, llvm-commits

Tags: #llvm

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

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

5 years agoRevert r374389: "[lit] Clean up internal diff's encoding handling"
Joel E. Denny [Thu, 10 Oct 2019 19:25:24 +0000 (19:25 +0000)]
Revert r374389: "[lit] Clean up internal diff's encoding handling"

This breaks a Windows bot.

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

5 years agoRevert r374390: "[lit] Extend internal diff to support `-` argument"
Joel E. Denny [Thu, 10 Oct 2019 19:25:11 +0000 (19:25 +0000)]
Revert r374390: "[lit] Extend internal diff to support `-` argument"

This breaks a Windows bot.

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

5 years agoRevert r374392: "[lit] Extend internal diff to support -U"
Joel E. Denny [Thu, 10 Oct 2019 19:24:57 +0000 (19:24 +0000)]
Revert r374392: "[lit] Extend internal diff to support -U"

This breaks a Windows bot.

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

5 years agowin: Move Parallel.h off concrt to cross-platform code
Nico Weber [Thu, 10 Oct 2019 18:57:23 +0000 (18:57 +0000)]
win: Move Parallel.h off concrt to cross-platform code

r179397 added Parallel.h and implemented it terms of concrt in 2013.

In 2015, a cross-platform implementation of the functions has appeared
and is in use everywhere but on Windows (r232419).  r246219 hints that
<thread> had issues in MSVC2013, but r296906 suggests they've been fixed
now that we require 2015+.

So remove the concrt code. It's less code, and it sounds like concrt has
conceptual and performance issues, see PR41198.

I built blink_core.dll in a debug component build with full symbols and
in a release component build without any symbols.  I couldn't measure a
performance difference for linking blink_core.dll before and after this
patch.

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

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

5 years ago[NFC][PowerPC]Clean up PPCAsmPrinter for TOC related pseudo opcode
Xiangling Liao [Thu, 10 Oct 2019 18:56:42 +0000 (18:56 +0000)]
[NFC][PowerPC]Clean up PPCAsmPrinter for TOC related pseudo opcode

Add a helper function getMCSymbolForTOCPseudoMO to clean up PPCAsmPrinter
a little bit.

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

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

5 years agoPrint quoted backslashes in LLVM IR as \\ instead of \5C
Reid Kleckner [Thu, 10 Oct 2019 18:31:57 +0000 (18:31 +0000)]
Print quoted backslashes in LLVM IR as \\ instead of \5C

This improves readability of Windows path string literals in LLVM IR.
The LLVM assembler has supported \\ in IR strings for a long time, but
the lexer doesn't tolerate escaped quotes, so they have to be printed as
\22 for now.

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

5 years agoFix Windows build after r374381
Nico Weber [Thu, 10 Oct 2019 18:20:16 +0000 (18:20 +0000)]
Fix Windows build after r374381

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

5 years agoRemove strings.h include to fix GSYM Windows build
Reid Kleckner [Thu, 10 Oct 2019 18:17:24 +0000 (18:17 +0000)]
Remove strings.h include to fix GSYM Windows build

Fifth time's the charm.

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

5 years agoUnbreak buildbots.
Greg Clayton [Thu, 10 Oct 2019 18:13:13 +0000 (18:13 +0000)]
Unbreak buildbots.

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

5 years agoFix buildbots by using memset instead of bzero.
Greg Clayton [Thu, 10 Oct 2019 18:11:49 +0000 (18:11 +0000)]
Fix buildbots by using memset instead of bzero.

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

5 years agoFix build by adding the missing dependency.
Michael Liao [Thu, 10 Oct 2019 18:04:52 +0000 (18:04 +0000)]
Fix build by adding the missing dependency.

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

5 years ago[lit] Leverage argparse features to remove some code
Julian Lettner [Thu, 10 Oct 2019 18:03:37 +0000 (18:03 +0000)]
[lit] Leverage argparse features to remove some code

Reviewed By: rnk, serge-sans-paille

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

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

5 years agoFix test to avoid check-not matching the temp file absolute path
Reid Kleckner [Thu, 10 Oct 2019 18:01:27 +0000 (18:01 +0000)]
Fix test to avoid check-not matching the temp file absolute path

Fix for PR43636

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