1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
Commit Graph

151936 Commits

Author SHA1 Message Date
Martin Storsjo
992aad1a5d [AArch64] Force relocations for all ADRP instructions
This generalizes an existing fix from ELF to MachO and COFF.

Test that an ADRP to a local symbol whose offset is known at assembly
time still produces relocations, both for MachO and COFF. Test that
an ADRP without a @page modifier on MachO fails (previously it
didn't).

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

llvm-svn: 308518
2017-07-19 20:14:32 +00:00
Martin Storsjo
907c7d040f [AArch64, COFF] Interpret .align as power of two for COFF as well
Differential Revision: https://reviews.llvm.org/D35545

llvm-svn: 308517
2017-07-19 20:14:24 +00:00
Wolfgang Pieb
03029419be Fixing an issue with the initialization of LexicalScopes objects when mixing debug
and non-debug units.

Patch by Andrea DiBiagio.

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

llvm-svn: 308513
2017-07-19 19:36:40 +00:00
Krzysztof Parzyszek
1188abc897 [Hexagon] Fix a bug in r308502: post-inc offset is always 0
llvm-svn: 308510
2017-07-19 19:17:32 +00:00
Brian Gesiak
2866fad7f3 [cmake] GetSVN.cmake takes a list of arguments
Summary:
GetSVN.cmake currently takes one or two pairs of <source directory path,
name>, then attempts to get the remote repository URL and source control
revision of the repositories at those one or two paths.

It takes two pairs in order for Clang to get the revision of both
itself, and its dependency LLVM.

For projects that rely upon both LLVM and Clang (Apple's Swift is one
example, but there are others), GetSVN.cmake is used to fetch *three*
revisions: Swift, Clang, and LLVM.

To support this use case, change GetSVN.cmake: instead of taking one or
two pairs (specified via `FIRST_SOURCE_DIR`/`FIRST_NAME`, have it take a list
of pairs (`SOURCE_DIRS`/`NAMES`).

In order to allow Clang to migrate, have GetSVN.cmake support both sets
of arguments for now. The old arguments can be removed once Clang begins
using the new arguments, and Swift can follow when it updates its
copy of LLVM.

Test Plan:
1. Perform a clean build of Clang, verify that `clang --version` still
   prints the correct LLVM and Clang revision information.
2. Modify Clang's CMake to use the new arguments, then perform another
   clean build. `clang --version` should still print the correct
   revision information.

Reviewers: jordan_rose, beanz, probinson

Subscribers: echristo, chapuni, llvm-commits, mgorny

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

llvm-svn: 308507
2017-07-19 18:37:02 +00:00
Peter Collingbourne
8af0f7d98d LTO: Export functions referenced by the CFI jump table.
If the LowerTypeTests pass decides to add a function to a jump
table for CFI, it will add its name to the set cfiFunctionDefs,
which among other things will cause the function to be renamed in
the ThinLTO backend.

One other thing that we must do with such functions is to not
internalize them, because the jump table in the full LTO object will
contain a reference to the actual function body in the ThinLTO object.

This patch handles that by ensuring that we export any functions
whose names appear in the cfiFunctionDefs set.

Fixes PR33831.

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

llvm-svn: 308504
2017-07-19 18:18:19 +00:00
Davide Italiano
9743ca923d [X86] Don't try to scale down if that exceeds the bitwidth.
Fixes the crash reported in PR33844.

llvm-svn: 308503
2017-07-19 18:09:46 +00:00
Krzysztof Parzyszek
7c394f75f7 [Hexagon] Handle subregisters in areMemAccessesTriviallyDisjoint
llvm-svn: 308502
2017-07-19 18:03:46 +00:00
Peter Collingbourne
3d4c92eec4 ThinLTOBitcodeWriter: Do not rewrite intrinsic functions when splitting modules.
Changing the type of an intrinsic may invalidate the IR.

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

llvm-svn: 308500
2017-07-19 17:54:29 +00:00
Tim Northover
6379d1f60e GlobalISel: select G_EXTRACT and G_INSERT instructions on AArch64.
llvm-svn: 308493
2017-07-19 16:47:07 +00:00
Sylvestre Ledru
528fdc71c2 [Solaris] enable --whole-archive for shared-library build, disable --version-script for Solaris-ld
Shared-library build on Solaris requires --whole-archive to be specified (option accepted by all available linkers).

At the same time, --version-script can not be handled by Solaris-ld, so it should be skipped.
-M is of no use here, since there is no syntax in Solaris-ld mapfiles that allows to version all global symbols,
not just the named ones (at least this is my impression from digging deep into the docs).

Patch by Fedor Sergeev <fedor.sergeev@oracle.com>

llvm-svn: 308490
2017-07-19 16:07:51 +00:00
Krzysztof Parzyszek
f9472caf55 [Hexagon] Handle subregisters and non-immediates in getBaseAndOffset
llvm-svn: 308485
2017-07-19 15:39:28 +00:00
Hans Wennborg
46de941333 Defeat another -Wunused-but-set-variable warning
llvm-svn: 308484
2017-07-19 15:06:31 +00:00
Hans Wennborg
24563ac844 Defeat a GCC -Wunused-result warning
It was warning like:

../llvm-project/llvm/lib/Support/ErrorHandling.cpp:172:51: warning:
ignoring return value of ‘ssize_t write(int, const void*, size_t)’,
         declared with attribute warn_unused_result [-Wunused-result]
            (void)::write(2, OOMMessage, strlen(OOMMessage));

Work around the warning by storing the return value in a variable and
casting that to void instead. We already did this for the other write()
call in this file.

llvm-svn: 308483
2017-07-19 15:03:38 +00:00
Joel Jones
407a00e12b [docs] Document how to debug instruction scheduling model generation
Describe:

+ Exact tablegen command and how to get it
+ tablegen command debug option for subtarget generation
+ Use of schedcover.py on the debug output to determine coverage

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

llvm-svn: 308476
2017-07-19 14:10:42 +00:00
Hans Wennborg
5f3fdb3f16 Clear release notes for 6.0.0
llvm-svn: 308474
2017-07-19 14:09:16 +00:00
Simon Pilgrim
30d62424f6 {DAGCombine] Convert (Val & Mask) == Mask to Mask.isSubsetof(Val). NFCI.
llvm-svn: 308460
2017-07-19 13:39:58 +00:00
Javed Absar
ca6d1aaf93 [ARM] Unify handling of M-Class system registers
This patch cleans up and fixes issues in the M-Class system register handling:

1. It defines the system registers and the encoding (SYSm values) in one place:
   a new ARMSystemRegister.td using SearchableTable, thereby removing the
   hand-coded values which existed in multiple places.

2. Some system registers e.g. BASEPRI_MAX_NS which do not exist were being allowed!
   Ref: ARMv6/7/8M architecture reference manual.

Reviewed by: @t.p.northover, @olist01, @john.brawn
Differential Revision: https://reviews.llvm.org/D35209

llvm-svn: 308456
2017-07-19 12:57:16 +00:00
Hans Wennborg
e845d29c41 Update trunk version to 6.0.0svn
llvm-svn: 308442
2017-07-19 12:19:01 +00:00
NAKAMURA Takumi
c0aac4cb7b Recommit r274270, [CMake] Module builds depend on target intrinsics_gen to be built first.
The builder clang-x86_64-linux-selfhost-modules-2 complains. Investigating.

llvm-svn: 308439
2017-07-19 11:27:31 +00:00
NAKAMURA Takumi
218b5d2231 Revert r274270, "[CMake] Module builds depend on target intrinsics_gen to be built first."
I think modulemap is sufficient for intrinsics_gen in trunk. I won't find any issues around that.

llvm-svn: 308434
2017-07-19 10:47:38 +00:00
Simon Pilgrim
1871c33bf5 [X86][XOP] Use default AVX2 lowering for v4i64 ashr by splat constants
XOP shifts only support 128-bit vectors, so we were ending up with less optimal codegen requiring constants

llvm-svn: 308430
2017-07-19 10:29:31 +00:00
Jonas Paulsson
816413b87e [SystemZ] Minor fixing in SystemZScheduleZ14.td
Some minor corrections for recently added instructions.

Review: Ulrich Weigand
llvm-svn: 308429
2017-07-19 10:19:21 +00:00
Dinar Temirbulatov
956df253a6 [LoopUtils] Add an extra parameter OpValue to propagateIRFlags function,
If OpValue is non-null, we only consider operations similar to OpValue
when intersecting.

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

llvm-svn: 308428
2017-07-19 10:02:07 +00:00
Daniel Sanders
8f00944dee [globalisel][tablegen] 80-col corrections.
llvm-svn: 308424
2017-07-19 09:28:20 +00:00
Balaram Makam
58953554d4 [SimplifyCFG] Defer folding unconditional branches to LateSimplifyCFG if it can destroy canonical loop structure.
Summary:
When simplifying unconditional branches from empty blocks, we pre-test if the
BB belongs to a set of loop headers and keep the block to prevent passes from
destroying canonical loop structure. However, the current algorithm fails if
the destination of the branch is a loop header. Especially when such a loop's
latch block is folded into loop header it results in additional backedges and
LoopSimplify turns it into a nested loop which prevent later optimizations
from being applied (e.g., loop  unrolling and loop interleaving).

This patch augments the existing algorithm by further checking if the
destination of the branch belongs to a set of loop headers and defer
eliminating it if yes to LateSimplifyCFG.

Fixes PR33605: https://bugs.llvm.org/show_bug.cgi?id=33605

Reviewers: efriedma, mcrosier, pacxx, hsung, davidxl

Reviewed By: efriedma

Subscribers: ashutosh.nema, gberry, javed.absar, llvm-commits

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

llvm-svn: 308422
2017-07-19 08:53:34 +00:00
Ayal Zaks
fd3659df66 [LV] Test once if vector trip count is zero, instead of twice
Generate a single test to decide if there are enough iterations to jump to the
vectorized loop, or else go to the scalar remainder loop. This test compares the
Scalar Trip Count: if STC < VF * UF go to the scalar loop. If
requiresScalarEpilogue() holds, at-least one iteration must remain scalar; the
rest can be used to form vector iterations. So in this case the test checks
instead if (STC - 1) < VF * UF by comparing STC <= VF * UF, and going to the
scalar loop if so. Otherwise the vector loop is entered for at-least one vector
iteration.

This test covers the case where incrementing the backedge-taken count will
overflow leading to an incorrect trip count of zero. In this (rare) case we will
also avoid the vector loop and jump to the scalar loop.

This patch simplifies the existing tests and effectively removes the basic-block
originally named "min.iters.checked", leaving the single test in block
"vector.ph".

Original observation and initial patch by Evgeny Stupachenko.

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

llvm-svn: 308421
2017-07-19 05:16:39 +00:00
Serguei Katkov
58072411f5 [CGP] Allow cycles during Phi traversal in OptimizaMemoryInst
Allowing cycles in Phi traversal increases the scope of optimize memory instruction
in case we are in loop.

The added test shows an example of enabling optimization inside a loop.

Reviewers: loladiro, spatel, efriedma
Reviewed By: efriedma
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D35294

llvm-svn: 308419
2017-07-19 04:49:17 +00:00
Chandler Carruth
c7973d02e8 Revert r308273 to reinstate part of r308100.
That part was reverted because the underlying change necessitating it
(r308025) was reverted in r308271.

Nirav re-landed r308025 again in r308350, so re-landing this fix.

llvm-svn: 308418
2017-07-19 04:15:30 +00:00
Chandler Carruth
b6378546b8 [PM/LCG] Follow-up fix to r308088 to handle deletion of library
functions.

In the prior commit, we provide ordering to the LCG between functions
and library function definitions that they might begin to call through
transformations. But we still would delete these library functions from
the call graph if they became dead during inlining.

While this immediately crashed, it also exposed a loss of information.
We shouldn't remove definitions of library functions that can still
usefully participate in the LCG-powered CGSCC optimization process. If
new call edges are formed, we want to have definitions to be called.

We can still remove these functions if truly dead using global-dce, etc,
but removing them during the CGSCC walk is premature.

This fixes a crash in the new PM when optimizing some unusual libraries
that end up with "internal" lib functions such as the code in the "R"
language's libraries.

llvm-svn: 308417
2017-07-19 04:12:25 +00:00
James Y Knight
331d9b7566 [SPARC] Add missing variable initialization after r308343.
llvm-svn: 308415
2017-07-19 04:08:42 +00:00
Craig Topper
66c70e9248 AMD znver1 Initial Scheduler model
Summary:
This patch adds the following
1. Adds a skeleton scheduler model for AMD Znver1.
2. Introduces the znver1 execution units and pipes.
3. Caters the instructions based on the generic scheduler classes.
4. Further additions to the scheduler model with instruction itineraries will be carried out incrementally based on
        a. Instructions types
        b. Registers used
5. Since itineraries are not added based on instructions, throughput information are bound to change when incremental changes are added.
6. Scheduler testcases are modified accordingly to suit the new model.

Patch by Ganesh Gopalasubramanian. With minor formatting tweaks from me.

Reviewers: craig.topper, RKSimon

Subscribers: javed.absar, shivaram, ddibyend, vprasad

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

llvm-svn: 308411
2017-07-19 02:45:14 +00:00
Petr Hosek
72231eb582 [llvm-readobj] Install llvm-readelf alias
Install an llvm-readelf symlink to llvm-readobj.
When invoked as *readelf*, default to -elf-output-style=GNU.

Patch by Roland McGrath

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

llvm-svn: 308408
2017-07-19 02:09:37 +00:00
Saleem Abdulrasool
a0ad631f4e Object: preserve more information about DEF file
Preserve the actual library name as provided by the user.  This is
required to properly replicate link's behaviour about the module import
name handling.  This requires an associated change to lld for updating
the tests for the proper behaviour for the import library module name
handling in various cases.

Associated tests will be part of the lld change.

llvm-svn: 308406
2017-07-19 02:01:22 +00:00
Weiming Zhao
33e867b55e Fix DebugLoc propagation for unreachable LoadInst
Summary: Currently, when GVN creates a load and when InstCombine creates a new store for unreachable Load, the DebugLoc info gets lost.

Reviewers: dberlin, davide, aprantl

Reviewed By: aprantl

Subscribers: davide, llvm-commits

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

llvm-svn: 308404
2017-07-19 01:27:24 +00:00
Adrian Prantl
d9729b268c Debug Info: Add a file: field to DIImportedEntity.
DIImportedEntity has a line number, but not a file field. To determine
the decl_line/decl_file we combine the line number from the
DIImportedEntity with the file from the DIImportedEntity's scope. This
does not work correctly when the parent scope is a DINamespace or a
DIModule, both of which do not have a source file.

This patch adds a file field to DIImportedEntity to unambiguously
identify the source location of the using/import declaration.  Most
testcase updates are mechanical, the interesting one is the removal of
the FIXME in test/DebugInfo/Generic/namespace.ll.

This fixes PR33822. See https://bugs.llvm.org/show_bug.cgi?id=33822
for more context.

<rdar://problem/33357889>
https://bugs.llvm.org/show_bug.cgi?id=33822

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

llvm-svn: 308398
2017-07-19 00:09:54 +00:00
Petr Hosek
d5560f679f [llvm-readobj] Accept (and ignore) --wide (-W) command-line switch
Accept and ignore --wide/-W. In GNU readelf this switch is
necessary to get the output format that's consistent between
32-bit and 64-bit targets. llvm-readobj always produces that
output format.

Patch by Roland McGrath

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

llvm-svn: 308396
2017-07-18 23:58:15 +00:00
Petr Hosek
ef25350bba [llvm-readobj] Accept -S as an alias for --sections
In GNU readelf, the short option for --sections is upper-case -S.

Note that GNU uses lower-case -s to mean --symbols, while LLVM
uses -s to mean --sections and -t to mean --symbols (-t has yet a
different meaning in GNU). So command-line uses with -S can now
be compatible, but uses with -s or -t are still incompatible.

Patch by Roland McGrath

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

llvm-svn: 308392
2017-07-18 23:35:22 +00:00
Evandro Menezes
f510c4f89f [AArch64] Adjust the feature set for Exynos M2
Add fusion of AES operations.

llvm-svn: 308388
2017-07-18 22:51:25 +00:00
Vitaly Buka
7e3789c116 [asan] Copy arguments passed by value into explicit allocas for ASan
Summary:
  ASan determines the stack layout from alloca instructions. Since
arguments marked as "byval" do not have an explicit alloca instruction, ASan
does not produce red zones for them. This commit produces an explicit alloca
instruction and copies the byval argument into the allocated memory so that red
zones are produced.

  Submitted on behalf of @morehouse (Matt Morehouse)

  Reviewers: eugenis, vitalybuka

  Reviewed By: eugenis

  Subscribers: hiraditya, llvm-commits

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

llvm-svn: 308387
2017-07-18 22:28:03 +00:00
Saleem Abdulrasool
a300298c79 Object: rename parameter from DLLName to ImportName
When I originally wrote this code, I neglected the fact that the import
library may be created for executables.  This name is not the name of
the DLL, but rather the name for the imported module.  It will be
embedded into the IAT/ILT reference.  Rename it to make it more obvious.
NFC.

llvm-svn: 308384
2017-07-18 22:11:01 +00:00
Saleem Abdulrasool
3ba7c8d78b Object: handle extensions properly in def files
When given an extension as part of the `library` directive in a def
file, the extension is preserved/honoured by link/lib.  Behave similarly
when parsing the def file.  This requires checking if a native extension
is provided as a keyword parameter.  If no extension is present, append
a standard `.dll` or `.exe` extension.

This is best tested via lld, and I will add tests there as a follow up.

llvm-svn: 308383
2017-07-18 22:11:00 +00:00
Martell Malone
4ec77fc2c7 llvm: add llvm-dlltool support to the archiver
A PE COFF spec compliant import library generator.
Intended to be used with mingw-w64.

Supports:
PE COFF spec (section 8, Import Library Format)
PE COFF spec (Aux Format 3: Weak Externals)

Reviewed By: ruiu
Differential Revision: https://reviews.llvm.org/D29892

This reapplies rL308329, which was reverted in rL308374

llvm-svn: 308379
2017-07-18 21:26:38 +00:00
Lang Hames
3b9218a913 [RuntimeDyld][MachO/ARM] Don't add a redundant relocation entry.
We only need to add this entry once for it to be fixed up.

llvm-svn: 308375
2017-07-18 21:12:03 +00:00
Rui Ueyama
b21f190999 Revert r308329: llvm: add llvm-dlltool support to the archiver
This reverts commit r308329 because it broke buildbots.

llvm-svn: 308374
2017-07-18 21:07:13 +00:00
Martell Malone
690c7a43f6 llvm: fix -Wcast gcc warn error from rL308329
llvm-svn: 308360
2017-07-18 20:58:21 +00:00
Petr Hosek
59aa9a9aad [CMake] Set toolchain tools in cross-target runtimes build
This is needed for runtimes build to work on Darwin.

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

llvm-svn: 308359
2017-07-18 20:54:02 +00:00
Mandeep Singh Grang
a0b275cd4a [COFF, ARM64] Reserve X18 register by default
Reviewers: compnerd, rnk, ruiu, mstorsjo

Reviewed By: mstorsjo

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

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

llvm-svn: 308358
2017-07-18 20:41:33 +00:00
Jakub Kuderski
8ea3fd17cd [Dominators] Improve error checking in deleteEdge
Summary: This patch improves error detection in deleteEdge. It asserts that the edge doesn't exist in the CFG and that DomTree knew about this edge before.

Reviewers: dberlin, grosser, brzycki, sanjoy

Reviewed By: dberlin

Subscribers: llvm-commits

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

llvm-svn: 308354
2017-07-18 20:19:52 +00:00
Nirav Dave
2e307633f3 [DAG] Improve Aliasing of operations to static alloca
Re-recommiting after landing DAG extension-crash fix.

Recommiting after adding check to avoid miscomputing alias information
on addresses of the same base but different subindices.

Memory accesses offset from frame indices may alias, e.g., we
may merge write from function arguments passed on the stack when they
are contiguous. As a result, when checking aliasing, we consider the
underlying frame index's offset from the stack pointer.

Static allocs are realized as stack objects in SelectionDAG, but its
offset is not set until post-DAG causing DAGCombiner's alias check to
consider access to static allocas to frequently alias. Modify isAlias
to consider access between static allocas and access from other frame
objects to be considered aliasing.

Many test changes are included here. Most are fixes for tests which
indirectly relied on our aliasing ability and needed to be modified to
preserve their original intent.

The remaining tests have minor improvements due to relaxed
ordering. The exception is CodeGen/X86/2011-10-19-widen_vselect.ll
which has a minor degradation dispite though the pre-legalized DAG is
improved.

Reviewers: rnk, mkuper, jonpa, hfinkel, uweigand

Reviewed By: rnk

Subscribers: sdardis, nemanjai, javed.absar, llvm-commits

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

llvm-svn: 308350
2017-07-18 20:06:24 +00:00