Commit Graph

276957 Commits

Author SHA1 Message Date
Craig Topper 2c2b4c0191 [X86] Remove GCCBuiltin from intrinsics that are no longer used by clang.
llvm-svn: 318986
2017-11-25 20:00:37 +00:00
Craig Topper 9e032ed55a [X86] Use separate builtins for fma4 scalar intrinsics. Use negations to remove some of the scalar fma3 builtins.
fma4 instructions zero the upper bits of the xmm register. fma3 instructions leave the bits unmodified. This requires separate builtins for the different semantics.

While we're cleaning up the scalar builtins this also removes the fma3 fmsub/fnmadd/fnmsub builtins by using negates in the header file.

llvm-svn: 318985
2017-11-25 19:32:12 +00:00
Craig Topper e485631cd1 [X86] Add separate intrinsics for scalar FMA4 instructions.
Summary:
These instructions zero the non-scalar part of the lower 128-bits which makes them different than the FMA3 instructions which pass through the non-scalar part of the lower 128-bits.

I've only added fmadd because we should be able to derive all other variants using operand negation in the intrinsic header like we do for AVX512.

I think there are still some missed negate folding opportunities with the FMA4 instructions in light of this behavior difference that I hadn't noticed before.

I've split the tests so that we can use different intrinsics for scalar testing between the two. I just copied the tests split the RUN lines and changed out the scalar intrinsics.

fma4-fneg-combine.ll is a new test to make sure we negate the fma4 intrinsics correctly though there are a couple TODOs in it.

Reviewers: RKSimon, spatel

Reviewed By: RKSimon

Subscribers: llvm-commits

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

llvm-svn: 318984
2017-11-25 18:32:43 +00:00
Craig Topper ea37e201ec [X86] Don't report gather is legal on Skylake CPUs when AVX2/AVX512 is disabled. Allow gather on SKX/CNL/ICL when AVX512 is disabled by using AVX2 instructions.
Summary:
This adds a new fast gather feature bit to cover all CPUs that support fast gather that we can use independent of whether the AVX512 feature is enabled. I'm only using this new bit to qualify AVX2 codegen. AVX512 is still implicitly assuming fast gather to keep tests working and to match the scatter behavior.

Test command lines have been added for these two cases.

Reviewers: magabari, delena, RKSimon, zvi

Reviewed By: RKSimon

Subscribers: llvm-commits

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

llvm-svn: 318983
2017-11-25 18:09:37 +00:00
Craig Topper e7426556c1 [SelectionDAG] Remove some dead code from vector scalaring
Summary:
Currently ScalarizeVecRes_SETCC checks for the result type being a vector and jumps to ScalarizeVecRes_VSETCC. But if we're scalarizing a vector result, aren't we guaranteed to be looking at a vector type?

This patch deletes the current ScalarizeVecRes_SETCC and renames  ScalarizeVecRes_VSETCC to ScalarizeVecRes_SETCC.

Reviewers: RKSimon, arsenm, eladcohen, zvi

Reviewed By: RKSimon

Subscribers: wdng, llvm-commits

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

llvm-svn: 318982
2017-11-25 17:59:00 +00:00
Jan Kratochvil 639e799c98 Due to changes for DWZ I would need to update those such as renaming it to
SetFileOffset.

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

llvm-svn: 318981
2017-11-25 17:16:56 +00:00
Kamil Rytarowski e36f5cb480 Plug dlerror() leak for swift_demangle
Summary:
InitializeSwiftDemangler() attempts to resolve the
swift_demangle symbol. If this is not available, we
observe dlerror message leak.

Caught on NetBSD/amd64 in TSan.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, kubamracek, vitalybuka, dvyukov, eugenis

Reviewed By: dvyukov

Subscribers: llvm-commits, #sanitizers

Tags: #sanitizers

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

llvm-svn: 318980
2017-11-25 16:47:20 +00:00
Devin Coughlin cc5915a5e1 [analyzer] Teach RetainCountChecker about CoreMedia APIs
Teach the retain-count checker that CoreMedia reference types use
CoreFoundation-style reference counting. This enables the checker
to catch leaks and over releases of those types.

rdar://problem/33599757

llvm-svn: 318979
2017-11-25 14:57:42 +00:00
Sylvestre Ledru 67e60434c3 doxygen: disable the html timestamp: this is breaking the reproducible build of openmp
llvm-svn: 318978
2017-11-25 14:12:33 +00:00
Andrew V. Tischenko 198720d38e Add BTVER2 sched support for SHLD/SHRD.
Differential Revision: https://reviews.llvm.org/D40124

llvm-svn: 318977
2017-11-25 10:46:53 +00:00
Martin Probst c160cfaf66 clang-format: [JS] do not collapse short classes.
Summary:
clang-format does not collapse short records, interfaces, unions, etc.,
but fails to do so if the record is preceded by certain modifiers
(export, default, abstract, declare). This change skips over all
modifiers, and thus handles all record definitions uniformly.

Before:
    export class Foo { bar: string; }
    class Baz {
      bam: string;
    }

After:
    export class Foo {
      bar: string;
    }
    class Baz {
      bam: string;
    }

Reviewers: djasper

Subscribers: klimek

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

llvm-svn: 318976
2017-11-25 09:35:33 +00:00
Martin Probst e8e27ca866 clang-format: [JS] handle semis in generic types.
Summary:
TypeScript generic type arguments can contain object (literal) types,
which in turn can contain semicolons:

    const x: Array<{a: number; b: string;} = [];

Previously, clang-format would incorrectly categorize the braced list as
a block and terminate the line at the openening `{`, and then format the
entire expression badly.

With this change, clang-format recognizes `<` preceding a `{` as
introducing a type expression. In JS, `<` comparison with an object
literal can never be true, so the chance of introducing false positives
here is very low.

Reviewers: djasper

Subscribers: klimek, cfe-commits

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

llvm-svn: 318975
2017-11-25 09:33:47 +00:00
Martin Probst 6c38ef90fd clang-format: [JS] handle `for` as object label.
Summary: Previously, clang-format would fail formatting `{for: 1}`.

Reviewers: djasper

Subscribers: klimek

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

llvm-svn: 318974
2017-11-25 09:24:33 +00:00
Martin Probst 7e0f25b28d clang-format: [JS] disable ASI on decorators.
Summary:
Automatic Semicolon Insertion in clang-format tries to guess if a line
wrap should insert an implicit semicolong. The previous heuristic would
not trigger ASI if a token was immediately preceded by an `@` sign:

    function foo(@Bar  // <-- does not trigger due to preceding @
                baz) {}

However decorators can have arbitrary parameters:

    function foo(@Bar(param, param, param)  // <-- precending @ missed
                baz) {}

While it would be possible to precisely find the matching `@`, just
conversatively disabling ASI for the entire line is simpler, while also
not regressing ASI substatially.

Reviewers: djasper

Subscribers: klimek, cfe-commits

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

llvm-svn: 318973
2017-11-25 09:19:42 +00:00
Alexander Kornienko 1d8fa7ff3f [clang-tidy] Fix link error (http://llvm.org/PR35417).
llvm-svn: 318972
2017-11-25 08:52:42 +00:00
Alexander Kornienko b43950d4a1 [clang-tidy] Actually fix header guard handling in scripts
llvm-svn: 318971
2017-11-25 08:49:04 +00:00
Craig Topper a456f13af2 [X86] Simplify some code in combineSetCC. NFCI
Make the condition for doing a std::swap simpler so we don't have to repeat the full checks.

llvm-svn: 318970
2017-11-25 07:20:24 +00:00
Craig Topper 696bfc08d8 [X86] Qualify some vector specific code with VT.isVector(). NFCI
Other checks inside require a build_vector, but we this lets us stop earlier and makes the code more clear.

llvm-svn: 318969
2017-11-25 07:20:23 +00:00
Craig Topper c1b3269171 [X86] Support folding to andnps with SSE1 only.
With SSE1 only, we emit FAND and FXOR nodes for v4f32.

llvm-svn: 318968
2017-11-25 07:20:22 +00:00
Craig Topper 5b85df8605 [X86] Add some early DAG combines to turn v4i32 AND/OR/XOR into FAND/FOR/FXOR whe only SSE1 is available.
v4i32 isn't a legal type with sse1 only and would end up getting scalarized otherwise.

This isn't completely ideal as it doesn't handle cases like v8i32 that would get split to v4i32. But it at least helps with code written using the clang intrinsic header.

llvm-svn: 318967
2017-11-25 07:20:21 +00:00
Craig Topper 03106bb40e Recommit r318963 "[APInt] Don't print debug messages from the APInt knuth division algorithm by default"
The previous commit had the condition in the do/while backwards.

Debug builds currently print out low level details of the Knuth division algorithm when -debug is used. This information isn't useful in most cases and just adds noise to the log.

This adds a new preprocessor flag to enable the prints in the knuth division code in APInt.

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

llvm-svn: 318966
2017-11-24 20:29:04 +00:00
Craig Topper 13ed01e635 [X86] Prevent using X * rsqrt(X) to approximate sqrt when only sse1 is enabled.
This optimization can occur after type legalization and emit a vselect with v4i32 type. But that type is not legal with sse1. This ultimately gets scalarized by the second type legalization that runs after vector op legalization, but that's really intended to handle the scalar types that might be introduced by legalizing vector ops.

For now just stop this from happening by disabling the optimization with sse1.

llvm-svn: 318965
2017-11-24 19:57:48 +00:00
Craig Topper 8375bec71e Revert 318963 "[APInt] Don't print debug messages from the APInt knuth division algorithm by default"
I seem to have botched the logic when switching to push_macro

llvm-svn: 318964
2017-11-24 19:32:34 +00:00
Craig Topper 960c4e3bb4 [APInt] Don't print debug messages from the APInt knuth division algorithm by default
Debug builds currently print out low level details of the Knuth division algorithm when -debug is used. This information isn't useful in most cases and just adds noise to the log.

This adds a new preprocessor flag to enable the prints in the knuth division code in APInt.

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

llvm-svn: 318963
2017-11-24 19:13:24 +00:00
Rafael Espindola f8e405db46 Delete dead code.
The parent constructor is already setting the binding.

llvm-svn: 318962
2017-11-24 19:06:14 +00:00
Simon Pilgrim 116e3b3ca0 Fix MSVC double-float implicit truncation warning. NFCI
llvm-svn: 318961
2017-11-24 18:18:42 +00:00
Krasimir Georgiev f09c42857f [clang-format] Deduplicate using declarations
Summary: This deduplicated equivalent using declarations within a block.

Reviewers: bkramer

Reviewed By: bkramer

Subscribers: cfe-commits, klimek

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

llvm-svn: 318960
2017-11-24 18:00:01 +00:00
Martin Probst ce2bd4dfd8 clang-format: [JS] do not break in ArrayType[].
Summary:
Wrapping between the type name and the array type indicator creates
invalid syntax in TypeScript.

Before:
    const xIsALongIdent:
        YJustBarelyFitsLinex
            [];  // illegal syntax.

After:
    const xIsALongIdent:
        YJustBarelyFitsLinex[];

Reviewers: djasper

Subscribers: klimek

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

llvm-svn: 318959
2017-11-24 17:05:56 +00:00
Martin Probst a5968aad3d clang-format: [JS] do not wrap before yield.
Summary: The same rules apply as for `return`.

Reviewers: djasper

Subscribers: klimek

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

llvm-svn: 318958
2017-11-24 17:05:35 +00:00
Martin Probst a2555114b6 clang-format: [JS] space between ! assert and in.
Summary:
Before:
    x = y!in z;
After:
    x = y! in z;

Reviewers: djasper

Subscribers: klimek

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

llvm-svn: 318957
2017-11-24 17:04:40 +00:00
Simon Dardis 230f453574 [CodeGenPrepare] Check that erased sunken address are not reused
CodeGenPrepare sinks address computations from one basic block to another
and attempts to reuse address computations that have already been sunk. If
the same address computation appears twice with the first instance as an
operand of a load whose result is an operand to a simplifable select,
CodeGenPrepare simplifies the select and recursively erases the now dead
instructions. CodeGenPrepare then attempts to use the erased address
computation for the second load.

Fix this by erasing the cached address value if it has zero uses before
looking for the address value in the sunken address map.

This partially resolves PR35209.

Thanks to Alexander Richardson for reporting the issue!

This fixed version relands r318032 which was reverted in r318049 due to
sanitizer buildbot failures.

Reviewers: john.brawn

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

llvm-svn: 318956
2017-11-24 16:45:28 +00:00
Dmitry Preobrazhensky 0e8924a5c7 [AMDGPU][MC][GFX9] Added v_interp_p2_f16 and v_interp_p2_legacy_f16
See bug 33629: https://bugs.llvm.org//show_bug.cgi?id=33629

Reviewers: artem.tamazov, SamWot, arsenm

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

llvm-svn: 318955
2017-11-24 15:37:14 +00:00
Dylan McKay d3972a8f11 [AVR] Use the short form of 'clr <reg>'
r318895 made it so that the simpler instruction aliases are printed
rather than their expanded form.

llvm-svn: 318954
2017-11-24 15:36:43 +00:00
Benjamin Kramer 51ebcaaf25 Make helpers static. NFC.
llvm-svn: 318953
2017-11-24 14:55:41 +00:00
Javed Absar 72bac8f337 [SCEV] : Simplify loop to range-loop.NFC.
llvm-svn: 318952
2017-11-24 14:35:38 +00:00
Alexander Kornienko a616a55c98 [clang-tidy] rename_check.py: fix header guard handling
llvm-svn: 318951
2017-11-24 14:33:06 +00:00
Alexander Kornienko d4ac4afda7 [clang-tidy] Move a few more checks from misc to bugprone.
Summary:
clang_tidy/rename_check.py misc-assert-side-effect bugprone-assert-side-effect
clang_tidy/rename_check.py misc-bool-pointer-implicit-conversion bugprone-bool-pointer-implicit-conversion
clang_tidy/rename_check.py misc-fold-init-type bugprone-fold-init-type
clang_tidy/rename_check.py misc-forward-declaration-namespace bugprone-forward-declaration-namespace
clang_tidy/rename_check.py misc-inaccurate-erase bugprone-inaccurate-erase
clang_tidy/rename_check.py misc-move-forwarding-reference bugprone-move-forwarding-reference
clang_tidy/rename_check.py misc-multiple-statement-macro bugprone-multiple-statement-macro
clang_tidy/rename_check.py misc-use-after-move bugprone-use-after-move
clang_tidy/rename_check.py misc-virtual-near-miss bugprone-virtual-near-miss

Manually fixed a reference to UseAfterMoveCheck in the hicpp module.
Manually fixed header guards.

Reviewers: hokein

Reviewed By: hokein

Subscribers: nemanjai, mgorny, javed.absar, xazax.hun, kbarton, cfe-commits

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

llvm-svn: 318950
2017-11-24 14:16:29 +00:00
John Brawn 70cdb5b391 [CGP] Make optimizeMemoryInst able to combine more kinds of ExtAddrMode fields
This patch extends the recent work in optimizeMemoryInst to make it able to
combine more ExtAddrMode fields than just the BaseReg.

This fixes some benchmark regressions introduced by r309397, where GVN PRE is
hoisting a getelementptr such that it can no longer be combined into the
addressing mode of the load or store that uses it.

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

llvm-svn: 318949
2017-11-24 14:10:45 +00:00
Aleksandar Beserminji 590f0793e8 [mips] Set microMIPS ASE flag
This patch fixes an issue where microMIPS ASE flag is not set
when a function has micromips attribute or when .set micromips
directive is used.

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

llvm-svn: 318948
2017-11-24 14:00:47 +00:00
Dmitry Preobrazhensky dd2f1c993e [AMDGPU][MC][GFX9] Added support of 'inst_offset' modifier for compatibility with SP3
See bug 35329: https://bugs.llvm.org//show_bug.cgi?id=35329

Reviewers: arsenm, vpykhtin, artem.tamazov

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

llvm-svn: 318947
2017-11-24 13:22:38 +00:00
Ilya Biryukov 5fc214ec31 [clangd] Sort list of sources in CMakeLists.txt. NFC
llvm-svn: 318946
2017-11-24 13:13:41 +00:00
Ilya Biryukov 8318f61bb8 Avoid copying the data of in-memory preambles
Summary: Preambles are large and we should avoid copying them.

Reviewers: bkramer, klimek

Reviewed By: bkramer

Subscribers: cfe-commits

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

llvm-svn: 318945
2017-11-24 13:12:38 +00:00
Ilya Biryukov 2660cc96dd [clangd] Ensure preamble outlives the AST
Summary:
In-memory preambles will not be copied anymore, so we need to make
sure they outlive the AST.

Reviewers: bkramer, sammccall, klimek

Reviewed By: sammccall

Subscribers: cfe-commits

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

llvm-svn: 318944
2017-11-24 13:04:21 +00:00
Sam McCall b50a36c8bc [Tooling] Acknowledge that many CompilationDatabases don't support enumeration.
Summary: Provide default implementations so that only getCompileCommands() is mandatory.

Reviewers: ioeric

Subscribers: cfe-commits, bkramer, klimek

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

llvm-svn: 318943
2017-11-24 12:13:55 +00:00
Martin Probst 70cec59e23 clang-format: [JS] handle destructuring `of`.
Summary:
Previously, clang-format would drop a space character between `of` and
then following (non-identifier) token if the preceding token was part of
a destructuring assignment (`}` or `]`).

Before:
    for (const [a, b] of[]) {}

After:
    for (const [a, b] of []) {}

Reviewers: djasper

Subscribers: klimek

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

llvm-svn: 318942
2017-11-24 10:48:25 +00:00
Alexander Kornienko 4b9ee769ca [clang-tidy] rename_check.py misc-dangling-handle bugprone-dangling-handle
Reviewers: hokein

Reviewed By: hokein

Subscribers: mgorny, xazax.hun, cfe-commits

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

llvm-svn: 318941
2017-11-24 09:52:05 +00:00
Peter Smith 80e4be7eae [ELF] Rename .bss.rel.ro to .data.rel.ro.bss for some Linker Scripts.
LLD uses .bss.rel.ro for read-only copy relocations whereas the ld.bfd and
gold linkers use .data.rel.ro. In some linker scripts including ld.bfd's
internal linker script, the relro sections are placed sequentially assuming
.data.rel.ro is used. LLD's use of .bss.rel.ro means that the copy
relocations get matched into the .bss section causing the relro sections to
be non-contiguous.

This change checks for a .data.rel.ro OutputSection when a linker script
with the SECTIONS command is used. The section will match in the
.data.rel.ro output section and will maintain contiguous relro.

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

Fixes PR35265

llvm-svn: 318940
2017-11-24 08:48:29 +00:00
Igor Kudrin d95c74ec81 [ELF] Make tests with undefined symbols more explicit.
Differential Revision: https://reviews.llvm.org/D40253

llvm-svn: 318939
2017-11-24 06:42:32 +00:00
Rui Ueyama 15475e92c6 Use lambdas to store lazy-evaluated .dynamic entries.
Differential Revision: https://reviews.llvm.org/D40338

llvm-svn: 318938
2017-11-24 02:15:51 +00:00
Rafael Espindola 83f73f7908 Make a test stricter.
It now has a DT_NEEDED that could be removed by --gc-sections and one
that cannot. Without this all tests would pass if --gc-sections just
removed all DT_NEEDED.

llvm-svn: 318937
2017-11-23 23:40:33 +00:00