OSDN Git Service

android-x86/external-llvm.git
6 years ago[X86] Extend load-op-store fusion merge to ADC/SBB.
Nirav Dave [Fri, 19 Jan 2018 15:37:57 +0000 (15:37 +0000)]
[X86] Extend load-op-store fusion merge to ADC/SBB.

Summary: Add handling of EFLAG input to X86 Load-op-store fusion checking.

Reviewers: craig.topper, RKSimon

Subscribers: llvm-commits, hiraditya

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

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

6 years ago[AArch64][SVE] Asm: Add support for RDVL/ADDVL/ADDPL instructions
Sander de Smalen [Fri, 19 Jan 2018 15:22:00 +0000 (15:22 +0000)]
[AArch64][SVE] Asm: Add support for RDVL/ADDVL/ADDPL instructions

Reviewers: fhahn, rengolin, t.p.northover, echristo, olista01, SjoerdMeijer

Reviewed By: SjoerdMeijer

Subscribers: SjoerdMeijer, aemerson, javed.absar, tschuett, kristof.beyls, llvm-commits

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

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

6 years ago[X86][AVX] Add more variable permute tests for source vectors smaller than destination
Simon Pilgrim [Fri, 19 Jan 2018 14:55:22 +0000 (14:55 +0000)]
[X86][AVX] Add more variable permute tests for source vectors smaller than destination

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

6 years ago[SLP] Fix vectorization for tree with trunc to minimum required bit width.
Alexey Bataev [Fri, 19 Jan 2018 14:40:13 +0000 (14:40 +0000)]
[SLP] Fix vectorization for tree with trunc to minimum required bit width.

Summary:
If the vectorized tree has truncate to minimum required bit width and
the vector type of the cast operation after the truncation is the same
as the vector type of the cast operands, count cost of the vector cast
operation as 0, because this cast will be later removed.
Also, if the vectorization tree root operations are integer cast operations, do not consider them as candidates for truncation. It will just create extra number of the same vector/scalar operations, which will be removed by instcombiner.

Reviewers: RKSimon, spatel, mkuper, hfinkel, mssimpso

Subscribers: llvm-commits

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

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

6 years ago[Support] - Check nullptr after allocation with malloc in MallocAllocator - Different...
Klaus Kretzschmar [Fri, 19 Jan 2018 14:17:53 +0000 (14:17 +0000)]
[Support] - Check nullptr after allocation with malloc in MallocAllocator - Differential Revision: reviews.llvm.org/D34753

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

6 years ago[AMDGPU][MC] Corrected parsing of image modifiers and encoding of image atomics
Dmitry Preobrazhensky [Fri, 19 Jan 2018 13:49:53 +0000 (13:49 +0000)]
[AMDGPU][MC] Corrected parsing of image modifiers and encoding of image atomics

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

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

Reviewers: vpykhtin, artem.tamazov, arsenm

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

6 years agoFix line endings. NFCI.
Simon Pilgrim [Fri, 19 Jan 2018 12:09:17 +0000 (12:09 +0000)]
Fix line endings. NFCI.

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

6 years ago[X86] Add KNL target to slow PMULLD tests
Simon Pilgrim [Fri, 19 Jan 2018 12:07:44 +0000 (12:07 +0000)]
[X86] Add KNL target to slow PMULLD tests

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

6 years ago[X86] Add RDPID schedule test
Simon Pilgrim [Fri, 19 Jan 2018 12:06:49 +0000 (12:06 +0000)]
[X86] Add RDPID schedule test

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

6 years ago[X86] Regenerate RDPMC intrinsic test
Simon Pilgrim [Fri, 19 Jan 2018 12:05:58 +0000 (12:05 +0000)]
[X86] Regenerate RDPMC intrinsic test

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

6 years ago[CodeGen] Unify printing format of debug-location in both MIR and -debug
Francis Visoiu Mistrih [Fri, 19 Jan 2018 11:44:42 +0000 (11:44 +0000)]
[CodeGen] Unify printing format of debug-location in both MIR and -debug

Use "debug-location" instead of "; dbg:" in MI::print.

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

6 years ago[NFC] fix trivial typos in comments
Hiroshi Inoue [Fri, 19 Jan 2018 10:55:29 +0000 (10:55 +0000)]
[NFC] fix trivial typos in comments

"the the" -> "the"

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

6 years ago[ValueLattice] Use getters instead of direct accesses (NFC).
Florian Hahn [Fri, 19 Jan 2018 10:32:48 +0000 (10:32 +0000)]
[ValueLattice] Use getters instead of direct accesses (NFC).

Reviewers: reames, davide, anna

Reviewed By: reames, davide

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

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

6 years ago[ModRefInfo] Return NoModRef for Must and NoModRef.
Alina Sbirlea [Fri, 19 Jan 2018 10:26:40 +0000 (10:26 +0000)]
[ModRefInfo] Return NoModRef for Must and NoModRef.

Summary:
In ModRefInfo "Must" was introduced to track presence of MustAlias, but we still want to return NoModRef when there is neither Mod or Ref, even when MustAlias is found. Patch has small fixes to ensure this happens.
Minor cleanup to remove nesting for 2 if statements when calling getModRefInfo for 2 ImmutableCallSites.

Reviewers: sanjoy

Subscribers: jlebar, llvm-commits

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

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

6 years ago[InstCombine] Make foldSelectOpOp able to handle two-operand getelementptr
John Brawn [Fri, 19 Jan 2018 10:05:15 +0000 (10:05 +0000)]
[InstCombine] Make foldSelectOpOp able to handle two-operand getelementptr

Three (or more) operand getelementptrs could plausibly also be handled, but
handling only two-operand fits in easily with the existing BinaryOperator
handling.

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

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

6 years agoSplit MachineLICM into EarlyMachineLICM and MachineLICM; NFC
Matthias Braun [Fri, 19 Jan 2018 06:46:10 +0000 (06:46 +0000)]
Split MachineLICM into EarlyMachineLICM and MachineLICM; NFC

This avoids playing games with pseudo pass IDs and avoids using an
unreliable MRI::isSSA() check to determine whether register allocation
has happened.

Note that this renames:
- MachineLICMID -> EarlyMachineLICM
- PostRAMachineLICMID -> MachineLICMID
to be consistent with the EarlyTailDuplicate/TailDuplicate naming.

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

6 years agoSplit TailDuplicatePass into pre- and post-RA variant; NFC
Matthias Braun [Fri, 19 Jan 2018 06:08:17 +0000 (06:08 +0000)]
Split TailDuplicatePass into pre- and post-RA variant; NFC

Split TailDuplicatePass into EarlyTailDuplicate and TailDuplicate. This
avoids playing games with fake pass IDs and using MRI::isSSA() to
determine pre-/post-RA state.

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

6 years agoMove tests to the correct place
Matthias Braun [Fri, 19 Jan 2018 06:08:15 +0000 (06:08 +0000)]
Move tests to the correct place

test/CodeGen/MIR is for testing the MIR parser/printer. Tests for passes
and targets belong to test/CodeGen/TARGETNAME.

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

6 years ago[X86] Make better use of instregex for cmovcc/setcc/jcc instructions in the Intel...
Craig Topper [Fri, 19 Jan 2018 05:47:32 +0000 (05:47 +0000)]
[X86] Make better use of instregex for cmovcc/setcc/jcc instructions in the Intel scheduler models.

Combine all the separate condition codes into a singular expression when possible.

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

6 years agoRevert [CGP] Re-enable Select in complex addressing mode
Serguei Katkov [Fri, 19 Jan 2018 04:52:39 +0000 (04:52 +0000)]
Revert [CGP] Re-enable Select in complex addressing mode

One of buildbots failed. Revert for now till fix the issue.

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

6 years agoAArch64: Fix emergency spillslot being out of reach for large callframes
Matthias Braun [Fri, 19 Jan 2018 03:16:36 +0000 (03:16 +0000)]
AArch64: Fix emergency spillslot being out of reach for large callframes

Re-commit of r322200: The testcase shouldn't hit machineverifiers
anymore with r322917 in place.

Large callframes (calls with several hundreds or thousands or
parameters) could lead to situations in which the emergency spillslot is
out of range to be addressed relative to the stack pointer.
This commit forces the use of a frame pointer in the presence of large
callframes.

This commit does several things:
- Compute max callframe size at the end of instruction selection.
- Add mirFileLoaded target callback. Use it to compute the max callframe size
  after loading a .mir file when the size wasn't specified in the file.
- Let TargetFrameLowering::hasFP() return true if there exists a
  callframe > 255 bytes.
- Always place the emergency spillslot close to FP if we have a frame
  pointer.
- Note that `useFPForScavengingIndex()` would previously return false
  when a base pointer was available leading to the emergency spillslot
  getting allocated late (that's the whole effect of this callback).
  Which made no sense to me so I took this case out: Even though the
  emergency spillslot is technically not referenced by FP in this case
  we still want it allocated early.

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

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

6 years agoAArch64: Omit callframe setup/destroy when not necessary
Matthias Braun [Fri, 19 Jan 2018 02:45:38 +0000 (02:45 +0000)]
AArch64: Omit callframe setup/destroy when not necessary

Do not create CALLSEQ_START/CALLSEQ_END when there is no callframe to
setup and the callframe size is 0.

- Fixes an invalid callframe nesting for byval arguments, which would
  look like this before this patch (as in `big-byval.ll`):
    ...
    ADJCALLSTACKDOWN 32768, 0, ...   # Setup for extfunc
    ...
    ADJCALLSTACKDOWN 0, 0, ...  # setup for memcpy
    ...
    BL &memcpy ...
    ADJCALLSTACKUP 0, 0, ...    # destroy for memcpy
    ...
    BL &extfunc
    ADJCALLSTACKUP 32768, 0, ...   # destroy for extfunc

- Saves us two instructions in the common case of zero-sized stackframes.
- Remove an unnecessary scheduling barrier (hence the small unittest
  changes).

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

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

6 years ago[WebAssembly] Add test expectations for gcc C++ tests (gcc/testsuite/g++.dg)
Sam Clegg [Fri, 19 Jan 2018 01:40:52 +0000 (01:40 +0000)]
[WebAssembly] Add test expectations for gcc C++ tests (gcc/testsuite/g++.dg)

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

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

6 years ago[ORC] Revert r322913 while I investigate an ASan failure.
Lang Hames [Fri, 19 Jan 2018 01:40:26 +0000 (01:40 +0000)]
[ORC] Revert r322913 while I investigate an ASan failure.

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

6 years ago[ORC] Redesign the JITSymbolResolver interface to support bulk queries.
Lang Hames [Fri, 19 Jan 2018 01:12:40 +0000 (01:12 +0000)]
[ORC] Redesign the JITSymbolResolver interface to support bulk queries.

Bulk queries reduce IPC/RPC overhead for cross-process JITing and expose
opportunities for parallel compilation.

The two new query methods are lookupFlags, which finds the flags for each of a
set of symbols; and lookup, which finds the address and flags for each of a
set of symbols. (See doxygen comments for more details.)

The existing JITSymbolResolver class is renamed LegacyJITSymbolResolver, and
modified to extend the new JITSymbolResolver class using the following scheme:

- lookupFlags is implemented by calling findSymbolInLogicalDylib for each of the
symbols, then returning the result of calling getFlags() on each of these
symbols. (Importantly: lookupFlags does NOT call getAddress on the returned
symbols, so lookupFlags will never trigger materialization, and lookupFlags will
never call findSymbol, so only symbols that are part of the logical dylib will
return results.)

- lookup is implemented by calling findSymbolInLogicalDylib for each symbol and
falling back to findSymbol if findSymbolInLogicalDylib returns a null result.
Assuming a symbol is found its getAddress method is called to materialize it and
the result (if getAddress succeeds) is stored in the result map, or the error
(if getAddress fails) is returned immediately from lookup. If any symbol is not
found then lookup returns immediately with an error.

This change will break any out-of-tree derivatives of JITSymbolResolver. This
can be fixed by updating those classes to derive from LegacyJITSymbolResolver
instead.

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

6 years ago[X86] Add intrinsic support for the RDPID instruction
Craig Topper [Thu, 18 Jan 2018 23:52:31 +0000 (23:52 +0000)]
[X86] Add intrinsic support for the RDPID instruction

This adds a new instrinsic to support the rdpid instruction. The implementation is a bit weird because the intrinsic is defined as always returning 32-bits, but the assembler support thinks the instruction produces a 64-bit register in 64-bit mode. But really it zeros the upper 32 bits. So I had to add separate patterns where 64-bit mode uses an extract_subreg.

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

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

6 years ago[InstSimplify] regenerate checks and add tests for commutes; NFC
Sanjay Patel [Thu, 18 Jan 2018 23:11:24 +0000 (23:11 +0000)]
[InstSimplify] regenerate checks and add tests for commutes; NFC

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

6 years agoAMDGPU/SI: Fix typos in d16 support patch the buffer intrinsics.
Changpeng Fang [Thu, 18 Jan 2018 22:57:57 +0000 (22:57 +0000)]
AMDGPU/SI: Fix typos in d16 support patch the buffer intrinsics.

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

6 years ago[CodeView] Add line numbers for inlined call sites
Reid Kleckner [Thu, 18 Jan 2018 22:55:43 +0000 (22:55 +0000)]
[CodeView] Add line numbers for inlined call sites

We did this for inline call site line tables, but we hadn't done it for
regular function line tables yet. This patch copies that logic from
encodeInlineLineTable.

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

6 years ago[CodeView] Sink complex inline functions to .cpp file, NFC
Reid Kleckner [Thu, 18 Jan 2018 22:55:14 +0000 (22:55 +0000)]
[CodeView] Sink complex inline functions to .cpp file, NFC

I'm cleaning up this code before I attempt to fix a line table bug.

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

6 years agoAMDGPU/SI: Add d16 support for image intrinsics.
Changpeng Fang [Thu, 18 Jan 2018 22:08:53 +0000 (22:08 +0000)]
AMDGPU/SI: Add d16 support for image intrinsics.

Summary:
  This patch implements d16 support for image load, image store and image sample intrinsics.

Reviewers:
  Matt, Brian.

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

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

6 years agoTypo fix SIBABRT -> SIGABRT.
Eric Christopher [Thu, 18 Jan 2018 21:45:51 +0000 (21:45 +0000)]
Typo fix SIBABRT -> SIGABRT.

Based on a patch by Henry Wong!

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

6 years ago[test] Actually check the common parts in CodeGen/ARM/global-merge-external.ll. NFC.
Martin Storsjo [Thu, 18 Jan 2018 21:21:48 +0000 (21:21 +0000)]
[test] Actually check the common parts in CodeGen/ARM/global-merge-external.ll. NFC.

Previously, these parts weren't ever checked. The label patterns
need to be extended to match successfully on macho.

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

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

6 years agoSupport: Add missing #include.
Peter Collingbourne [Thu, 18 Jan 2018 20:49:33 +0000 (20:49 +0000)]
Support: Add missing #include.

This #include is necessary to provide the definitions of _fpclass
and _FPCLASS_NZ when building with libc++.

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

6 years ago[DWARFv5] Number the line-table's directory array correctly.
Paul Robinson [Thu, 18 Jan 2018 20:33:35 +0000 (20:33 +0000)]
[DWARFv5] Number the line-table's directory array correctly.

The compilation directory has always been #0, but as of DWARF v5 it is
explicitly listed in the line-table section instead of implicitly
being a reference to the compile_unit DIE's DW_AT_comp_dir attribute.
This means the dumper should number the dumped array starting with 0
or 1 depending on the DWARF version of the line table.

References in the generated DWARF are correct, it's just the dumper
that was wrong.  Also some assembler-coded tests were similarly
confused about directory numbers.

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

6 years agowe have now https support for apt.llvm.org. Updating the URL
Sylvestre Ledru [Thu, 18 Jan 2018 19:57:35 +0000 (19:57 +0000)]
we have now https support for apt.llvm.org. Updating the URL

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

6 years agoFollow-up to rL322875 by initializing the do_libcxxabi variable properly.
Dimitry Andric [Thu, 18 Jan 2018 19:30:30 +0000 (19:30 +0000)]
Follow-up to rL322875 by initializing the do_libcxxabi variable properly.

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

6 years ago[AArch64][GlobalISel] Add isel support for global values in the large code model.
Amara Emerson [Thu, 18 Jan 2018 19:21:27 +0000 (19:21 +0000)]
[AArch64][GlobalISel] Add isel support for global values in the large code model.

Fixes PR35958.

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

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

6 years ago[X86][SSE] Regenerate vector promotion tests
Simon Pilgrim [Thu, 18 Jan 2018 19:17:26 +0000 (19:17 +0000)]
[X86][SSE] Regenerate vector promotion tests

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

6 years ago[RISCV] Fixed setting predicates for compressed instructions.
Ana Pazos [Thu, 18 Jan 2018 18:54:05 +0000 (18:54 +0000)]
[RISCV] Fixed setting predicates for compressed instructions.

Summary:
Fixed setting predicates for compressed instructions.
Some instructions were being generated with C extension
enabled only, without proper checks for the other
required extensions like F, D and 32 and 64-bit target checks.
Affected instructions:
C_FLD, C_FLW, C_LD, C_FSD, C_FSW, C_SD,
C_JAL, C_ADDIW, C_SUBW, C_ADDW,
C_FLDSP, C_FLWSP, C_LDSP, C_FSDSP, C_FSWSP, C_SDSP

Reviewers: asb, shiva0217

Reviewed By: asb

Subscribers: rbar, johnrusso, simoncook, jordy.potman.lists, sabuasal, niosHD, llvm-commits

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

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

6 years agoAdd a -no-libcxxabi option to the test-release.sh script.
Dimitry Andric [Thu, 18 Jan 2018 18:39:13 +0000 (18:39 +0000)]
Add a -no-libcxxabi option to the test-release.sh script.

On FreeBSD, it is currently not possible to build libcxxabi and link
against it, so we have been building releases with -no-libs for quite
some time.

However, libcxx and libunwind should build without problems, so provide
an option to skip just libcxxabi.

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

6 years ago[X86][AVX] Add 256/512-bit slow PMULLD tests
Simon Pilgrim [Thu, 18 Jan 2018 18:38:32 +0000 (18:38 +0000)]
[X86][AVX] Add 256/512-bit slow PMULLD tests

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

6 years agoSpeed up iteration of CodeView record streams.
Zachary Turner [Thu, 18 Jan 2018 18:35:01 +0000 (18:35 +0000)]
Speed up iteration of CodeView record streams.

There's some abstraction overhead in the underlying
mechanisms that were being used, and it was leading to an
abundance of small but not-free copies being made.  This
showed up on a profile.  Eliminating this and going back to
a low-level byte-based implementation speeds up lld with
/DEBUG between 10 and 15%.

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

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

6 years ago[CodeGen][NFC] Rename IsVerbose to IsStandalone in Machine*::print
Francis Visoiu Mistrih [Thu, 18 Jan 2018 18:05:15 +0000 (18:05 +0000)]
[CodeGen][NFC] Rename IsVerbose to IsStandalone in Machine*::print

Committed r322867 too soon.

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

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

6 years ago[CodeGen] Print RegClasses on MI in verbose mode
Francis Visoiu Mistrih [Thu, 18 Jan 2018 17:59:06 +0000 (17:59 +0000)]
[CodeGen] Print RegClasses on MI in verbose mode

r322086 removed the trailing information describing reg classes for each
register.

This patch adds printing reg classes next to every register when
individual operands/instructions/basic blocks are printed. In the case
of dumping MIR or printing a full function, by default don't print it.

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

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

6 years ago[SLP] Fix test checks, NFC.
Alexey Bataev [Thu, 18 Jan 2018 17:34:27 +0000 (17:34 +0000)]
[SLP] Fix test checks, NFC.

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

6 years ago[ADT] Just give up on GCC, I can't fix this.
Benjamin Kramer [Thu, 18 Jan 2018 16:23:40 +0000 (16:23 +0000)]
[ADT] Just give up on GCC, I can't fix this.

While the memmove workaround fixed it for GCC 6.3. GCC 4.8 and GCC 7.1
are still broken. I have no clue what's going on, just blacklist GCC for
now.

Needless to say this code is ubsan, asan and msan-clean.

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

6 years ago[ADT] Add a workaround for GCC miscompiling the trivially copyable Optional
Benjamin Kramer [Thu, 18 Jan 2018 15:47:59 +0000 (15:47 +0000)]
[ADT] Add a workaround for GCC miscompiling the trivially copyable Optional

I've seen random crashes with GCC 4.8, GCC 6.3 and GCC 7.3, triggered by
my Optional change. All of them affect a different set of targets. This
change fixes the instance of the problem I'm seeing on my local machine,
let's hope it's good enough for the other instances too.

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

6 years ago[TargetLowering] add punctuation for readability; NFC
Sanjay Patel [Thu, 18 Jan 2018 15:25:32 +0000 (15:25 +0000)]
[TargetLowering] add punctuation for readability; NFC

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

6 years ago[MachineOutliner] Fix r322788 - don't write to working directory
Sam McCall [Thu, 18 Jan 2018 15:02:28 +0000 (15:02 +0000)]
[MachineOutliner] Fix r322788 - don't write to working directory

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

6 years ago[docs] Make ReleaseProcess.rst 80 column. NFCI
Joel Jones [Thu, 18 Jan 2018 14:57:55 +0000 (14:57 +0000)]
[docs] Make ReleaseProcess.rst 80 column. NFCI

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

6 years ago[CodeGen][NFC] Refactor MachineInstr::print
Francis Visoiu Mistrih [Thu, 18 Jan 2018 14:52:14 +0000 (14:52 +0000)]
[CodeGen][NFC] Refactor MachineInstr::print

* Handle more cases where the MI is not attached yet
* Add similar asserts like in MIRPrinter::print

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

6 years ago[HWAsan] Fix uninitialized variable.
Benjamin Kramer [Thu, 18 Jan 2018 14:19:04 +0000 (14:19 +0000)]
[HWAsan] Fix uninitialized variable.

Found by msan.

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

6 years ago[X86] Add PR35918 test case
Simon Pilgrim [Thu, 18 Jan 2018 13:42:02 +0000 (13:42 +0000)]
[X86] Add PR35918 test case

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

6 years agotest commit
Klaus Kretzschmar [Thu, 18 Jan 2018 12:58:50 +0000 (12:58 +0000)]
test commit

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

6 years ago[RISCV] Codegen support for the standard RV32M instruction set extension
Alex Bradbury [Thu, 18 Jan 2018 12:36:38 +0000 (12:36 +0000)]
[RISCV] Codegen support for the standard RV32M instruction set extension

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

6 years ago[RISCV] Implement frame pointer elimination
Alex Bradbury [Thu, 18 Jan 2018 11:34:02 +0000 (11:34 +0000)]
[RISCV] Implement frame pointer elimination

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

6 years ago[ADT] Split optional to only include copy mechanics and dtor for non-trivial types.
Benjamin Kramer [Thu, 18 Jan 2018 11:26:24 +0000 (11:26 +0000)]
[ADT] Split optional to only include copy mechanics and dtor for non-trivial types.

This makes uses of Optional more transparent to the compiler (and
clang-tidy) and generates slightly smaller code.

This is a re-land of r317019, which had issues with GCC 4.8 back then.
Those issues don't reproduce anymore, but I'll watch the buildbots
closely in case anything goes wrong.

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

6 years agoA new test to demostrate the current SHLD/SHRD code generation.
Andrew V. Tischenko [Thu, 18 Jan 2018 10:40:48 +0000 (10:40 +0000)]
A new test to demostrate the current SHLD/SHRD code generation.

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

6 years ago[RISCV][NFC] Add nounwind to functions in div.ll and mul.ll
Alex Bradbury [Thu, 18 Jan 2018 09:41:14 +0000 (09:41 +0000)]
[RISCV][NFC] Add nounwind to functions in div.ll and mul.ll

Committing this separately to minimise irrelevant changes for an upcoming
patch.

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

6 years ago[SelectionDAG] Convert assert to condtion
Sam Parker [Thu, 18 Jan 2018 09:22:24 +0000 (09:22 +0000)]
[SelectionDAG] Convert assert to condtion

Follow-up to r322120 which can cause assertions for AArch64 because
v1f64 and v1i64 are legal types.

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

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

6 years ago[X86] Use vmovdqu64/vmovdqa64 for unmasked integer vector stores for consistency...
Craig Topper [Thu, 18 Jan 2018 07:44:09 +0000 (07:44 +0000)]
[X86] Use vmovdqu64/vmovdqa64 for unmasked integer vector stores for consistency with loads.

Previously we used 64 for vXi64 stores and 32 for everything else. This change uses 64 for everything just like do for loads.

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

6 years ago[X86] Remove isel patterns for using unmasked vmovdqa32/vmovdqu32 for integer vector...
Craig Topper [Thu, 18 Jan 2018 07:44:06 +0000 (07:44 +0000)]
[X86] Remove isel patterns for using unmasked vmovdqa32/vmovdqu32 for integer vector loads.

These patterns were just looking for a vXi64 bitcasted to vXi32, but there is no advantage to using vmovdqa32 over vmovdqa64.

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

6 years agoRevert "Add a value_type to ArrayRef."
Clement Courbet [Thu, 18 Jan 2018 07:26:34 +0000 (07:26 +0000)]
Revert "Add a value_type to ArrayRef."

clang OOMs on arm.

This reverts commit a272b2f2ef63f7f602c9ef4d9e10dc4eb9f00aa1.

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

6 years ago[X86] Remove windows line endings from a test file. NFC
Craig Topper [Thu, 18 Jan 2018 06:47:09 +0000 (06:47 +0000)]
[X86] Remove windows line endings from a test file. NFC

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

6 years agoDon't drop dso_local in LTO.
Rafael Espindola [Thu, 18 Jan 2018 05:38:43 +0000 (05:38 +0000)]
Don't drop dso_local in LTO.

LTO sets dso_local as an optimization, so don't clear it.

This avoid clearing it from undefined hidden symbols, which would then
fail the verifier.

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

6 years ago[DAGCombiner] Add a DAG combine to turn a splat build_vector where the splat elemnt...
Craig Topper [Thu, 18 Jan 2018 04:17:06 +0000 (04:17 +0000)]
[DAGCombiner] Add a DAG combine to turn a splat build_vector where the splat elemnt is a bitcast from a vector type into a concat_vector

For example, a build_vector of i64 bitcasted from v2i32 can be turned into a concat_vectors of the v2i32 vectors with a bitcast to a vXi64 type

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

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

6 years agoMake GlobalValues with non-default visibilility dso_local.
Rafael Espindola [Thu, 18 Jan 2018 02:08:23 +0000 (02:08 +0000)]
Make GlobalValues with non-default visibilility dso_local.

This is similar to r322317, but for visibility. It is not as neat
because we have to special case extern_weak.

The idea is the same as the previous change, make the transition to
explicit dso_local easier for the frontends. With this they only have
to add dso_local to symbols where we need some external information to
decide if it is dso_local (like it being part of an ELF executable).

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

6 years agoGlobalISel: Make MachineCSE runnable in the middle of the GlobalISel
Justin Bogner [Thu, 18 Jan 2018 02:06:56 +0000 (02:06 +0000)]
GlobalISel: Make MachineCSE runnable in the middle of the GlobalISel

Right now, it is not possible to run MachineCSE in the middle of the
GlobalISel pipeline. Being able to run generic optimizations between the
core passes of GlobalISel was one of the goals of the new ISel framework.
This is the first attempt to do it.

The problem is that MachineCSE pass assumes all register operands have a
register class, which, in GlobalISel context, won't be true until after the
InstructionSelect pass. The reason for this behaviour is that before
replacing one virtual register with another, MachineCSE pass (and most of
the other optimization machine passes) must check if the virtual registers'
constraints have a (sufficiently large) intersection, and constrain the
resulting register appropriately if such intersection exists.

GlobalISel extends the representation of such constraints from just a
register class to a triple (low-level type, register bank, register
class).

This commit adds MachineRegisterInfo::constrainRegAttrs method that extends
MachineRegisterInfo::constrainRegClass to such a triple.

The idea is that going forward we should use:

- RegisterBankInfo::constrainGenericRegister within GlobalISel's
  InstructionSelect pass
- MachineRegisterInfo::constrainRegClass within SelectionDAG ISel
- MachineRegisterInfo::constrainRegAttrs everywhere else regardless
  the target and instruction selector it uses.

Patch by Roman Tereshin. Thanks!

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

6 years ago[WebAssembly] Remove duplicated RTLIB names
Derek Schuff [Thu, 18 Jan 2018 01:15:45 +0000 (01:15 +0000)]
[WebAssembly] Remove duplicated RTLIB names

Remove the tight coupling between llvm/CodeGenRuntimeLibcalls.def and
the table of supported singatures for wasm. This will allow adding new libcalls
without changing wasm's signature table.

Also, some cleanup:
Use ManagedStatics instead of const tables to avoid memory/binary bloat.
Use a StringMap instead of a linear search for name lookup.

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

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

6 years agoFix the failure caused by r322773
Volkan Keles [Thu, 18 Jan 2018 01:10:30 +0000 (01:10 +0000)]
Fix the failure caused by r322773

Do not run GlobalISel if `-fast-isel=0 -global-isel=false`.

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

6 years ago[MachineOutliner] Add DISubprograms to outlined functions.
Jessica Paquette [Thu, 18 Jan 2018 00:00:58 +0000 (00:00 +0000)]
[MachineOutliner] Add DISubprograms to outlined functions.

Before, it wasn't possible to get backtraces inside outlined functions. This
commit adds DISubprograms to the IR functions created by the outliner which
makes this possible. Also attached a test that ensures that the produced
debug information is correct. This is useful to users that want to debug
outlined code.

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

6 years ago[CodeGen] Hoist common AsmPrinter code out of X86, ARM, and AArch64
Reid Kleckner [Wed, 17 Jan 2018 23:55:23 +0000 (23:55 +0000)]
[CodeGen] Hoist common AsmPrinter code out of X86, ARM, and AArch64

Every known PE COFF target emits /EXPORT: linker flags into a .drective
section. The AsmPrinter should handle this.

While we're at it, use global_values() and emit each export flag with
its own .ascii directive. This should make the .s file output more
readable.

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

6 years ago[LangRef] Clarify Varargs forwarding for musttail calls.
Florian Hahn [Wed, 17 Jan 2018 23:29:25 +0000 (23:29 +0000)]
[LangRef] Clarify Varargs forwarding for musttail calls.

This clarification was suggested by @efriedma in D41335, which uses this
behavior to inline musttail calls with varargs.

Reviewers: hfinkel, efriedma, rnk

Reviewed By: rnk

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

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

6 years ago[hwasan] LLVM-level flags for linux kernel-compatible hwasan instrumentation.
Evgeniy Stepanov [Wed, 17 Jan 2018 23:24:38 +0000 (23:24 +0000)]
[hwasan] LLVM-level flags for linux kernel-compatible hwasan instrumentation.

Summary:
-hwasan-mapping-offset defines the non-zero shadow base address.
-hwasan-kernel disables calls to __hwasan_init in module constructors.
Unlike ASan, -hwasan-kernel does not force callback instrumentation.
This is controlled separately with -hwasan-instrument-with-calls.

Reviewers: kcc

Subscribers: srhines, hiraditya, llvm-commits

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

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

6 years agoAdd a TargetOption to enable/disable GlobalISel
Volkan Keles [Wed, 17 Jan 2018 22:34:21 +0000 (22:34 +0000)]
Add a TargetOption to enable/disable GlobalISel

Summary:
This patch adds a new target option in order to control GlobalISel.
This will allow the users to enable/disable GlobalISel prior to the
backend by calling `TargetMachine::setGlobalISel(bool Enable)`.

No test case as there is already a test to check GlobalISel
command line options.
See: CodeGen/AArch64/GlobalISel/gisel-commandline-option.ll.

Reviewers: qcolombet, aemerson, ab, dsanders

Reviewed By: qcolombet

Subscribers: rovka, javed.absar, kristof.beyls, llvm-commits

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

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

6 years agoAdd support for emitting libcalls for x86_fp80 -> fp128 and vice-versa
Benjamin Kramer [Wed, 17 Jan 2018 22:29:16 +0000 (22:29 +0000)]
Add support for emitting libcalls for x86_fp80 -> fp128 and vice-versa

compiler_rt doesn't provide them (yet), but libgcc does. PR34076.

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

6 years agoAdd a ProfileCount class to represent entry counts.
Easwaran Raman [Wed, 17 Jan 2018 22:24:23 +0000 (22:24 +0000)]
Add a ProfileCount class to represent entry counts.

Summary:
The class wraps a uint64_t and an enum to represent the type of profile
count (real and synthetic) with some helper methods.

Reviewers: davidxl

Subscribers: llvm-commits

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

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

6 years ago[X86][MMX] Add PR35982 test cases
Simon Pilgrim [Wed, 17 Jan 2018 22:19:31 +0000 (22:19 +0000)]
[X86][MMX] Add PR35982 test cases

FEMMS has the same problem as EMMS

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

6 years ago[LegalizeDAG] Fix ATOMIC_CMP_SWAP_WITH_SUCCESS legalization.
Eli Friedman [Wed, 17 Jan 2018 22:04:36 +0000 (22:04 +0000)]
[LegalizeDAG] Fix ATOMIC_CMP_SWAP_WITH_SUCCESS legalization.

The code wasn't zero-extending correctly, so the comparison could
spuriously fail.

Adds some AArch64 tests to cover this case.

Inspired by D41791.

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

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

6 years ago[SCEV] Fix typo. NFC.
Javed Absar [Wed, 17 Jan 2018 21:58:35 +0000 (21:58 +0000)]
[SCEV] Fix typo. NFC.

Fix confusing typo in comment.

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

6 years ago[globalisel][tablegen] Honour priority order within nested instructions.
Daniel Sanders [Wed, 17 Jan 2018 20:34:29 +0000 (20:34 +0000)]
[globalisel][tablegen] Honour priority order within nested instructions.

It appears that we haven't been prioritizing rules that contain nested
instructions properly. InstructionOperandMatcher didn't override
isHigherPriorityThan so it never compared the instructions/operands/predicates
inside nested instructions.

Fixes PR35926. Thanks to Diana Picus for the bug report.

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

6 years agoRevert [PowerPC] This reverts commit rL322721
Zaara Syeda [Wed, 17 Jan 2018 20:00:15 +0000 (20:00 +0000)]
Revert [PowerPC] This reverts commit rL322721

Failing build bots. Revert the commit now.

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

6 years ago[MDA] Use common code instead of reimplementing same. [NFC]
Philip Reames [Wed, 17 Jan 2018 19:57:19 +0000 (19:57 +0000)]
[MDA] Use common code instead of reimplementing same. [NFC]

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

6 years ago[GISel] Make constrainSelectedInstRegOperands() available to the legalizer. NFC
Aditya Nandakumar [Wed, 17 Jan 2018 19:31:33 +0000 (19:31 +0000)]
[GISel] Make constrainSelectedInstRegOperands() available to the legalizer. NFC

https://reviews.llvm.org/D42149

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

6 years ago[WebAssembly] Remove debug names from symbol table
Sam Clegg [Wed, 17 Jan 2018 19:28:43 +0000 (19:28 +0000)]
[WebAssembly] Remove debug names from symbol table

Get rid of DEBUG_FUNCTION_NAME symbols. When we actually debug
data, maybe we'll want somewhere to put it... but having a symbol
that just stores the name of another symbol seems odd.
It means you have multiple Symbols with the same name, one
containing the actual function and another containing the name!

Store the names in a vector on the WasmObjectFile when reading
them in. Also stash them on the WasmFunctions themselves.
The names are //not// "symbol names" or aliases or anything,
they're just the name that a debugger should show against the
function body itself. NB. The WasmObjectFile stores them so that
they can be exported in the YAML losslessly, and hence the tests
can be precise.

Enforce that the CODE section has been read in before reading
the "names" section. Requires minor adjustment to some tests.

Patch by Nicholas Wilson!

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

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

6 years agoUse a got to access a hidden weak undefined on MachO.
Rafael Espindola [Wed, 17 Jan 2018 19:19:55 +0000 (19:19 +0000)]
Use a got to access a hidden weak undefined on MachO.

Trying to link

__attribute__((weak, visibility("hidden"))) extern int foo;
int *main(void) {
  return &foo;
}

on OS X fails with

ld: 32-bit RIP relative reference out of range (-4294971318 max is +/-2GB): from _main (0x100000FAB) to _foo@0x00001000 (0x00000000) in '_main' from test.o for architecture x86_64

The problem being that 0 cannot be computed as a fixed difference from
%rip. Exactly the same issue exists on ELF and we can use the same
solution.

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

6 years ago[ARM] Optimize {s,u}mul.with.overflow.
Joel Galenson [Wed, 17 Jan 2018 19:19:05 +0000 (19:19 +0000)]
[ARM] Optimize {s,u}mul.with.overflow.

This extends my previous patches to also optimize overflow-checked multiplies during SelectionDAG.

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

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

6 years ago[ARM] Optimize {s,u}{add,sub}.with.overflow.
Joel Galenson [Wed, 17 Jan 2018 19:19:05 +0000 (19:19 +0000)]
[ARM] Optimize {s,u}{add,sub}.with.overflow.

The ARM backend contains code that tries to optimize compares by replacing them with an existing instruction that sets the flags the same way. This allows it to replace a "cmp" with a "adds", generalizing the code that replaces "cmp" with "sub". It also heuristically disables sinking of instructions that could potentially be used to replace compares (currently only if they're next to each other).

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

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

6 years ago[Attributes] Fix crash when attempting to remove alignment from an attribute list/set
Daniel Neilson [Wed, 17 Jan 2018 19:15:21 +0000 (19:15 +0000)]
[Attributes] Fix crash when attempting to remove alignment from an attribute list/set

Summary:
 Discovered while working on a patch to move alignment in
@llvm.memcpy/move/set from an arg into parameter attributes.

 The current implementations of AttributeSet::removeAttribute() and
AttributeList::removeAttribute crash when attempting to remove the
alignment attribute. Currently, these implementations add the
to-be-removed attributes to an AttrBuilder and then remove
the builder from the list/set. Alignment is special in that it
must be added to a builder with an integer value for the alignment;
attempts to add alignment to a builder without a value is an error.

 This change fixes the removeAttribute implementations for AttributeSet and
AttributeList to make them able to remove the alignment, and other similar,
attributes.

Reviewers: rnk, chandlerc, pete, javed.absar, reames

Reviewed By: rnk

Subscribers: llvm-commits

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

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

6 years ago[X86][BTVER2] Reduce instregex usage (PR35955)
Simon Pilgrim [Wed, 17 Jan 2018 19:12:48 +0000 (19:12 +0000)]
[X86][BTVER2] Reduce instregex usage (PR35955)

Most are just replaced with instrs lists, but a few regexps have been further generalized to match more instructions with a single pattern.

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

6 years ago[InstCombine] add baseline tests for D39958; NFC
Sanjay Patel [Wed, 17 Jan 2018 19:04:18 +0000 (19:04 +0000)]
[InstCombine] add baseline tests for D39958; NFC

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

6 years ago[X86] Teach LowerBUILD_VECTOR to recognize pair-wise splats of 32-bit elements and...
Craig Topper [Wed, 17 Jan 2018 18:58:22 +0000 (18:58 +0000)]
[X86] Teach LowerBUILD_VECTOR to recognize pair-wise splats of 32-bit elements and use a 64-bit broadcast

If we are splatting pairs of 32-bit elements, we can use a 64-bit broadcast to get the job done.

We could probably could probably do this with other sizes too, for example four 16-bit elements. Or we could broadcast pairs of 16-bit elements using a 32-bit element broadcast. But I've left that as a future improvement.

I've also restricted this to AVX2 only because we can only broadcast loads under AVX.

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

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

6 years ago[utils] Make .cfi_startproc optional for powerpc
Fangrui Song [Wed, 17 Jan 2018 18:48:50 +0000 (18:48 +0000)]
[utils] Make .cfi_startproc optional for powerpc

Summary: llc sometimes may not emit .cfi_startproc which makes func_dict to have less entries.

Subscribers: nemanjai, llvm-commits

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

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

6 years ago[X86] When legalizing (v64i1 select i8, v64i1, v64i1) make sure not to introduce...
Craig Topper [Wed, 17 Jan 2018 18:46:01 +0000 (18:46 +0000)]
[X86] When legalizing (v64i1 select i8, v64i1, v64i1) make sure not to introduce bitcasts to i64 in 32-bit mode

We legalize selects of masks with scalar conditions using a bitcast to an integer type. But if we are in 32-bit mode we can't convert v64i1 to i64. So instead split the v64i1 to v32i1 and concat it back together. Each half will then be legalized by bitcasting to i32 which is fine.

The test case is a little indirect. If we have the v64i1 select in IR it will get legalized by legalize vector ops which has a run of type legalization after it. That type legalization run is able to fix this i64 bitcast. So in order to avoid that we need a build_vector of a splat which legalize vector ops will ignore. Legalize DAG will then turn that into a select via LowerBUILD_VECTORvXi1. And the select will get legalized. In this case there is no type legalizer run to cleanup the bitcast.

This fixes pr35972.

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

6 years ago[X86][SSE] Add v4i16 PMULLD tests
Simon Pilgrim [Wed, 17 Jan 2018 18:41:27 +0000 (18:41 +0000)]
[X86][SSE] Add v4i16 PMULLD tests

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

6 years ago[PowerPC] Add handling for ColdCC calling convention and a pass to mark
Zaara Syeda [Wed, 17 Jan 2018 18:22:55 +0000 (18:22 +0000)]
[PowerPC] Add handling for ColdCC calling convention and a pass to mark
candidates with coldcc attribute.

This patch adds support for the coldcc calling convention for Power.
This changes the set of non-volatile registers. It includes a pass to stress
test the implementation by marking all static directly called functions with
the coldcc attribute through the option -enable-coldcc-stress-test. It also
includes an option, -ppc-enable-coldcc, to add the coldcc attribute to
functions which are cold at all call sites based on BlockFrequencyInfo when
the containing function does not call any non cold functions.

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

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

6 years agoFix MSVC "not all control paths return a value" warning.
Simon Pilgrim [Wed, 17 Jan 2018 18:16:28 +0000 (18:16 +0000)]
Fix MSVC "not all control paths return a value" warning.

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

6 years ago[ARC] Add missing condition codes.
Tatyana Krasnukha [Wed, 17 Jan 2018 17:58:28 +0000 (17:58 +0000)]
[ARC] Add missing condition codes.

Summary: Added VS and VC, required for disassembling.

Reviewers: petecoup

Reviewed By: petecoup

Subscribers: llvm-commits

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

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

6 years ago[SystemZ] Handle BRCTH branches correctly in SystemZLongBranch.cpp.
Jonas Paulsson [Wed, 17 Jan 2018 17:16:07 +0000 (17:16 +0000)]
[SystemZ]  Handle BRCTH branches correctly in SystemZLongBranch.cpp.

BRCTH is capable of a long branch which needs to be recognized during branch
relaxation. This is done by checking for ExtraRelaxSize == 0.

Review: Ulrich Weigand

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