1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 04:22:57 +02:00
Commit Graph

6465 Commits

Author SHA1 Message Date
Justin Lebar
a8dfb91650 [LangRef] Make @llvm.sqrt(x) return undef, rather than have UB, for negative x.
Summary:
Some frontends emit a speculate-and-select idiom for sqrt, wherein they compute
sqrt(x), check if x is negative, and select NaN if it is:

  %cmp = fcmp olt double %a, -0.000000e+00
  %sqrt = call double @llvm.sqrt.f64(double %a)
  %ret = select i1 %cmp, double 0x7FF8000000000000, double %sqrt

This is technically UB as the LangRef is written today if %a is ever less than
-0.  But emitting code that's compliant with the current definition of sqrt
would require a branch, which would then prevent us from matching this idiom in
SelectionDAG (which we do today -- ISD::FSQRT has defined behavior on negative
inputs), because SelectionDAG looks at one BB at a time.

Nothing in LLVM takes advantage of this undefined behavior, as far as we can
tell, and the fact that llvm.sqrt has UB dates from its initial addition to the
LangRef.

Reviewers: arsenm, mehdi_amini, hfinkel

Subscribers: wdng, llvm-commits

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

llvm-svn: 293242
2017-01-27 00:58:03 +00:00
Andrew Kaylor
b86cbf7581 Add intrinsics for constrained floating point operations
This commit introduces a set of experimental intrinsics intended to prevent
optimizations that make assumptions about the rounding mode and floating point
exception behavior.  These intrinsics will later be extended to specify
flush-to-zero behavior.  More work is also required to model instruction
dependencies in machine code and to generate these instructions from clang
(when required by pragmas and/or command line options that are not currently
supported).

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

llvm-svn: 293226
2017-01-26 23:27:59 +00:00
Zvi Rackover
b7932e32fe [Doc][LangRef] Fix typo-ish error in description of Masked Gather
Summary: Fix the example of equivalent expansion for when mask is all ones.

Reviewers: delena

Reviewed By: delena

Subscribers: llvm-commits

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

llvm-svn: 293206
2017-01-26 20:29:15 +00:00
Peter Collingbourne
83efd3d61d LangRef: Document the allowed metadata dropping transforms.
Document the current practice regarding dropping metadata on modules,
functions and global variables.

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

llvm-svn: 293101
2017-01-25 21:50:14 +00:00
Greg Parker
efc0b2cc29 Reinstate "r292904 - [lit] Allow boolean expressions in REQUIRES and XFAIL
and UNSUPPORTED"

This reverts the revert in r292942.

llvm-svn: 293007
2017-01-25 02:26:03 +00:00
Alex Lorenz
f5445306bb Revert "r292904 - [lit] Allow boolean expressions in REQUIRES and XFAIL
and UNSUPPORTED"

After r292904 llvm-lit fails to emit the test results in the XML format for
Apple's internal buildbots.

rdar://30164800

llvm-svn: 292942
2017-01-24 16:17:04 +00:00
Greg Parker
fb425c96fe [lit] Allow boolean expressions in REQUIRES and XFAIL and UNSUPPORTED
A `lit` condition line is now a comma-separated list of boolean expressions. 
Comma-separated expressions act as if each expression were on its own 
condition line:
For REQUIRES, if every expression is true then the test will run. 
For UNSUPPORTED, if every expression is false then the test will run. 
For XFAIL, if every expression is false then the test is expected to succeed. 
As a special case "XFAIL: *" expects the test to fail.

Examples:
# Test is expected fail on 64-bit Apple simulators and pass everywhere else
XFAIL: x86_64 && apple && !macosx
# Test is unsupported on Windows and on non-Ubuntu Linux 
# and supported everywhere else
UNSUPPORTED: linux && !ubuntu, system-windows

Syntax: 
* '&&', '||', '!', '(', ')'. 'true' is true. 'false' is false.
* Each test feature is a true identifier. 
* Substrings of the target triple are true identifiers for UNSUPPORTED 
 and XFAIL, but not for REQUIRES. (This matches the current behavior.)
* All other identifiers are false.
* Identifiers are [-+=._a-zA-Z0-9]+

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

llvm-svn: 292904
2017-01-24 09:58:02 +00:00
Greg Parker
49f3eceba0 Revert "[lit] Allow boolean expressions in REQUIRES and XFAIL and UNSUPPORTED"
This change needs to be better-coordinated with libc++.

llvm-svn: 292900
2017-01-24 08:58:20 +00:00
Greg Parker
1af70d3db9 [lit] Allow boolean expressions in REQUIRES and XFAIL and UNSUPPORTED
A `lit` condition line is now a comma-separated list of boolean expressions. 
Comma-separated expressions act as if each expression were on its own 
condition line:
For REQUIRES, if every expression is true then the test will run. 
For UNSUPPORTED, if every expression is false then the test will run. 
For XFAIL, if every expression is false then the test is expected to succeed. 
As a special case "XFAIL: *" expects the test to fail.

Examples:
# Test is expected fail on 64-bit Apple simulators and pass everywhere else
XFAIL: x86_64 && apple && !macosx
# Test is unsupported on Windows and on non-Ubuntu Linux 
# and supported everywhere else
UNSUPPORTED: linux && !ubuntu, system-windows

Syntax: 
* '&&', '||', '!', '(', ')'. 'true' is true. 'false' is false.
* Each test feature is a true identifier. 
* Substrings of the target triple are true identifiers for UNSUPPORTED 
  and XFAIL, but not for REQUIRES. (This matches the current behavior.)
* All other identifiers are false.
* Identifiers are [-+=._a-zA-Z0-9]+

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

llvm-svn: 292896
2017-01-24 08:45:50 +00:00
Ahmed Bougacha
a84a7cf9e8 [AArch64][GlobalISel] Legalize narrow scalar ops again.
Since r279760, we've been marking as legal operations on narrow integer
types that have wider legal equivalents (for instance, G_ADD s8).
Compared to legalizing these operations, this reduced the amount of
extends/truncates required, but was always a weird legalization decision
made at selection time.

So far, we haven't been able to formalize it in a way that permits the
selector generated from SelectionDAG patterns to be sufficient.

Using a wide instruction (say, s64), when a narrower instruction exists
(s32) would introduce register class incompatibilities (when one narrow
generic instruction is selected to the wider variant, but another is
selected to the narrower variant).

It's also impractical to limit which narrow operations are matched for
which instruction, as restricting "narrow selection" to ranges of types
clashes with potentially incompatible instruction predicates.

Concerns were also raised regarding  MIPS64's sign-extended register
assumptions, as well as wrapping behavior.
See discussions in https://reviews.llvm.org/D26878.

Instead, legalize the operations.

Should we ever revert to selecting these narrow operations, we should
try to represent this more accurately: for instance, by separating
a "concrete" type on operations, and an "underlying" type on vregs, we
could move the "this narrow-looking op is really legal" decision to the
legalizer, and let the selector use the "underlying" vreg type only,
which would be guaranteed to map to a register class.

In any case, we eventually should mitigate:
- the performance impact by selecting no-op extract/truncates to COPYs
  (which we currently do), and the COPYs to register reuses (which we
  don't do yet).
- the compile-time impact by optimizing away extract/truncate sequences
  in the legalizer.

llvm-svn: 292827
2017-01-23 21:10:05 +00:00
Sean Silva
adc7a8426a [docs] Point to upstream Sphinx install instructions.
llvm-svn: 292752
2017-01-22 03:47:49 +00:00
Peter Collingbourne
04b1dc5f67 docs: Document that !absolute_symbol { all-ones, all-ones } means the full set.
llvm-svn: 292657
2017-01-20 21:56:37 +00:00
Malcolm Parsons
a0ed49e2c8 [docs] Tell Doxygen to expand LLVM_ALIGNAS to nothing
Summary:
Docs for clang::Decl and clang::TemplateSpecializationType have
not been generated since LLVM_ALIGNAS was added to them.

Tell Doxygen to expand LLVM_ALIGNAS to nothing as described at
https://www.stack.nl/~dimitri/doxygen/manual/preprocessing.html

Reviewers: aaron.ballman, klimek, alexfh

Subscribers: ioeric, cfe-commits

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

llvm-svn: 292483
2017-01-19 13:37:42 +00:00
Graydon Hoare
88cd0769ca [lit] Support sharding testsuites, for parallel execution.
Summary:
This change equips lit.py with two new options, --num-shards=M and
--run-shard=N (set by default from env vars LIT_NUM_SHARDS and LIT_RUN_SHARD).

The options must be used together, and N must be in 1..M.

Together these options effect only test selection: they partition the testsuite
into M equal-sized "shards", then select only the Nth shard. They can be used
in a cluster of test machines to achieve a very crude (static) form of
parallelism, with minimal configuration work.

Reviewers: modocache, ddunbar

Reviewed By: ddunbar

Subscribers: llvm-commits

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

llvm-svn: 292417
2017-01-18 18:12:20 +00:00
Kostya Serebryany
29329cbba0 [libFuzzer] better link for trophies
llvm-svn: 292318
2017-01-18 00:45:02 +00:00
Mehdi Amini
88424dc88f Fix GettingStarted doc so that the example build command for cmake LLVM_ENABLE_PROJECTS works on linux
I tested the previous one on macOS, however building libc++ on Linux
requires libcxxabi as well.

llvm-svn: 292290
2017-01-17 23:23:08 +00:00
Aaron Ballman
fbc92c6824 Silence some Sphinx diagnostics in an attempt to get the documentation builder back to green (http://lab.llvm.org:8011/builders/llvm-sphinx-docs/builds/1895).
llvm-svn: 292271
2017-01-17 21:48:31 +00:00
Justin Lebar
7ebc6e53b2 [NVPTX] Add blank line to NVPTXUsage.rst to appease the Sphinx.
Fixes:

  Warning, treated as error:
  /home/buildbot/llvm-build-dir/llvm-sphinx-docs/llvm/src/docs/NVPTXUsage.rst:333:
  ERROR: Error in "code-block" directive:
  maximum 1 argument(s) allowed, 17 supplied.

llvm-svn: 292148
2017-01-16 18:39:15 +00:00
Justin Lebar
b814633873 [NVPTX] Let there be One True Way to set NVVMReflect params.
Summary:
Previously there were three ways to inform the NVVMReflect pass whether
you wanted to flush denormals to zero:

  * An LLVM command-line option
  * Parameters to the NVVMReflect constructor
  * Metadata on the module itself.

This change removes the first two, leaving only the third.

The motivation for this change, aside from simplifying things, is that
we want LLVM to be aware of whether it's operating in FTZ mode, so other
passes can use this information.  Ideally we'd have a target-generic
piece of metadata on the module.  This change moves us in that
direction.

Reviewers: tra

Subscribers: jholewinski, llvm-commits

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

llvm-svn: 292068
2017-01-15 16:54:35 +00:00
Mehdi Amini
5fa6e09708 Add a LLVM_USE_LINKER that defines the linker to use when building LLVM
Summary:
This string parameter is passed to -fuse-ld when linking. It can be
an absolute path to your custom linker, otherwise clang will look for
`ld.{name}`.

Reviewers: davide, tejohnson, pcc

Subscribers: llvm-commits, mgorny

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

llvm-svn: 292047
2017-01-15 03:21:30 +00:00
Sylvestre Ledru
f96210978c fix some typos in the doc
llvm-svn: 292014
2017-01-14 11:37:01 +00:00
Rui Ueyama
b2816798cb Add a description how to checkout the LLD repository.
Differential Revision: https://reviews.llvm.org/D28687

llvm-svn: 291948
2017-01-13 19:27:18 +00:00
Hans Wennborg
cc1385c80f Clear the release notes for 5.0.0
llvm-svn: 291836
2017-01-12 21:50:22 +00:00
Hans Wennborg
cfdc41713e Bump trunk version to 5.0.0svn
llvm-svn: 291815
2017-01-12 21:22:36 +00:00
Matt Arsenault
c06fb0049e LangRef: Note that calls also support fast math flags
This is already documented on the call instruction, but
not in the list of supported instructions in the fast math
flag section.

llvm-svn: 291578
2017-01-10 18:06:38 +00:00
Justin Lebar
a2d1155b53 [Docs] Update docs to indicate that CUDA compilation is supported on Windows.
Subscribers: cfe-commits, llvm-commits

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

llvm-svn: 291139
2017-01-05 16:54:28 +00:00
Anmol P. Paralkar
f151f2a8c0 [doc] Fix minor grammatical error in Phabricator.rst
Summary: Test commit, fix minor grammatical error in Phabricator.rst

Reviewers: delcypher

Subscribers: llvm-commits

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

llvm-svn: 291101
2017-01-05 13:08:14 +00:00
Michal Gorny
f87de988a8 [cmake] Add LLVM_ENABLE_DIA_SDK option, and expose it in LLVMConfig
Add an explicit LLVM_ENABLE_DIA_SDK option to control building support
for DIA SDK-based debugging. Control its value to match whether DIA SDK
support was found and expose it in LLVMConfig (alike LLVM_ENABLE_ZLIB).

Its value is needed for LLDB to determine whether to run tests requiring
DIA support. Currently it is obtained from llvm/Config/config.h;
however, this file is not available for standalone builds. Following
this change, LLDB will be modified to use the value from LLVMConfig.

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

llvm-svn: 290818
2017-01-02 18:19:35 +00:00
Keno Fischer
97bf60327b Reapply "[CodeGen] Fix invalid DWARF info on Win64"
This reapplies rL289013 (reverted in rL289014) with the fixes identified
in D21731. Should hopefully pass the buildbots this time.

llvm-svn: 290809
2017-01-02 03:00:19 +00:00
Florian Hahn
5742d4f24e [doc] Clarify steps for contributors without commit access.
Summary: Update the Phabricator docs to clarify how changes are merged for contributors without commit access. 

Reviewers: delcypher, aaron.ballman

Subscribers: aaron.ballman, anmol, llvm-commits

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

llvm-svn: 290767
2016-12-30 21:28:30 +00:00
Piotr Padlewski
bda08e96a0 [MemDep] Handle gep with zeros for invariant.group
Summary:
gep 0, 0 is equivalent to bitcast. LLVM canonicalizes it
to getelementptr because it make SROA can then handle it.

Simple case like

    void g(A &a) {
        z(a);
        if (glob)
            a.foo();
    }
    void testG() {
        A a;
        g(a);
    }

was not devirtualized with -fstrict-vtable-pointers because luck of
handling for gep 0 in Memory Dependence Analysis

Reviewers: dberlin, nlewycky, chandlerc

Subscribers: llvm-commits

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

llvm-svn: 290763
2016-12-30 18:45:07 +00:00
Igor Laevsky
64a0622c9c Fix documentation generator warnings after rL290708.
llvm-svn: 290709
2016-12-29 15:08:57 +00:00
Igor Laevsky
cde17c8a3e Introduce element-wise atomic memcpy intrinsic
This change adds a new intrinsic which is intended to provide memcpy functionality
with additional atomicity guarantees. Please refer to the review thread
or language reference for further details.

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

llvm-svn: 290708
2016-12-29 14:31:07 +00:00
Mehdi Amini
66b1803327 [doc] Add mention of the difference in optimization level between Release and RelWithDebInfo in Cmake.rst
This is surprising to many people.

llvm-svn: 290556
2016-12-26 23:42:12 +00:00
Amjad Aboud
144e1a2ef2 [DebugInfo] Added support for Checksum debug info feature.
Differential Revision: https://reviews.llvm.org/D27642

llvm-svn: 290514
2016-12-25 10:12:09 +00:00
Bryant Wong
12e3f3005c Test commit.
llvm-svn: 290501
2016-12-24 17:26:38 +00:00
David Blaikie
c3ab64d2bd Fix missing '>' in docs (hopefully fixes bot error... )
llvm-svn: 290187
2016-12-20 17:43:48 +00:00
David Blaikie
1d55c48177 Add some brief documentation about GDB pretty printers
llvm-svn: 290186
2016-12-20 17:33:58 +00:00
Daniel Jasper
162ffcacd6 Revert @llvm.assume with operator bundles (r289755-r289757)
This creates non-linear behavior in the inliner (see more details in
r289755's commit thread).

llvm-svn: 290086
2016-12-19 08:22:17 +00:00
Reid Kleckner
34418e533c Fix some remaining documentation references to MSVC 2013
MSVC 2015 has been the minimum supported version of VS since October.

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

llvm-svn: 289854
2016-12-15 19:08:02 +00:00
Kostya Serebryany
3fc8d1bd53 [libFuzzer] doc update
llvm-svn: 289849
2016-12-15 18:47:22 +00:00
Pavel Labath
1d2d65504a Simplify format member detection in FormatVariadic
Summary:
This replaces the format member search, which was quite complicated, with a more
direct approach to detecting whether a class should be formatted using the
format-member method. Instead we use a special type llvm::format_adapter, which
every adapter must inherit from. Then the search can be simply implemented with
the is_base_of type trait.

Aside from the simplification, I like this way more because it makes it more
explicit that you are supposed to use this type only for adapter-like
formattings, and the other approach (format_provider overloads) should be used
as a default (a mistake I made when first trying to use this library).

The only slight change in behaviour here is that now choose the format-adapter
branch even if the format member invocation will fail to compile (e.g. because it is a
non-const member function and we are passing a const adapter), whereas
previously we would have gone on to search for format_providers for the type.
However, I think that is actually a good thing, as it probably means the
programmer did something wrong.

Reviewers: zturner, inglorion

Subscribers: llvm-commits

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

llvm-svn: 289795
2016-12-15 09:40:27 +00:00
Hal Finkel
502475d4f3 Make processing @llvm.assume more efficient by using operand bundles
There was an efficiency problem with how we processed @llvm.assume in
ValueTracking (and other places). The AssumptionCache tracked all of the
assumptions in a given function. In order to find assumptions relevant to
computing known bits, etc. we searched every assumption in the function. For
ValueTracking, that means that we did O(#assumes * #values) work in InstCombine
and other passes (with a constant factor that can be quite large because we'd
repeat this search at every level of recursion of the analysis).

Several of us discussed this situation at the last developers' meeting, and
this implements the discussed solution: Make the values that an assume might
affect operands of the assume itself. To avoid exposing this detail to
frontends and passes that need not worry about it, I've used the new
operand-bundle feature to add these extra call "operands" in a way that does
not affect the intrinsic's signature. I think this solution is relatively
clean. InstCombine adds these extra operands based on what ValueTracking, LVI,
etc. will need and then those passes need only search the users of the values
under consideration. This should fix the computational-complexity problem.

At this point, no passes depend on the AssumptionCache, and so I'll remove
that as a follow-up change.

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

llvm-svn: 289755
2016-12-15 02:53:42 +00:00
Kostya Serebryany
f2bc70c266 [libFuzzer] document one more desired feature of a fuzz target
llvm-svn: 289622
2016-12-14 01:31:21 +00:00
Peter Collingbourne
a2d4395226 IR, X86: Understand !absolute_symbol metadata on global variables.
Summary:
Attaching !absolute_symbol to a global variable does two things:
1) Marks it as an absolute symbol reference.
2) Specifies the value range of that symbol's address.
Teach the X86 backend to allow absolute symbols to appear in place of
immediates by extending the relocImm and mov64imm32 matchers. Start using
relocImm in more places where it is legal.

As previously proposed on llvm-dev:
http://lists.llvm.org/pipermail/llvm-dev/2016-October/105800.html

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

llvm-svn: 289087
2016-12-08 19:01:00 +00:00
Keno Fischer
1d88090ce6 Revert "[CodeGen] Fix invalid DWARF info on Win64"
Appears to break on build bots. Reverting pending investigation.

llvm-svn: 289014
2016-12-08 01:56:23 +00:00
Keno Fischer
7c7d74df6a [CodeGen] Fix invalid DWARF info on Win64
The relocations for `DIEEntry::EmitValue` were wrong for Win64
(emitting FK_Data_4 instead of FK_SecRel_4). This corrects that
oversight so that the DWARF data is correct in Win64 COFF files.

Fixes PR15393.

Patch by Jameson Nash <jameson@juliacomputing.com> based on a patch
by David Majnemer.

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

llvm-svn: 289013
2016-12-08 01:40:21 +00:00
Mehdi Amini
5b92327564 [doc] Add .arcconfig setup to the "how to work with a monorepo" section
llvm-svn: 288562
2016-12-03 01:04:40 +00:00
Peter Collingbourne
284f83bfc7 IR: Move NumElements field from {Array,Vector}Type to SequentialType.
Now that PointerType is no longer a SequentialType, all SequentialTypes
have an associated number of elements, so we can move that information to
the base class, allowing for a number of simplifications.

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

llvm-svn: 288464
2016-12-02 03:20:58 +00:00
Peter Collingbourne
1329d17185 IR: Change PointerType to derive from Type rather than SequentialType.
As proposed on llvm-dev:
http://lists.llvm.org/pipermail/llvm-dev/2016-October/106640.html

This is for a couple of reasons:

- Values of type PointerType are unlike the other SequentialTypes (arrays
  and vectors) in that they do not hold values of the element type. By moving
  PointerType we can unify certain aspects of how the other SequentialTypes
  are handled.
- PointerType will have no place in the SequentialType hierarchy once
  pointee types are removed, so this is a necessary step towards removing
  pointee types.

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

llvm-svn: 288462
2016-12-02 03:05:41 +00:00