platform/upstream/llvm.git
6 years agoFix BNF nits in TableGen language reference.
Simon Tatham [Mon, 23 Apr 2018 09:15:47 +0000 (09:15 +0000)]
Fix BNF nits in TableGen language reference.

Summary:
In the course of writing an experimental ANTLR grammar based on this
document, I found three errors in the documented BNF:

SimpleValues of dag type are allowed to have no operands at all after
the initial DagArg specifying the operator. For example, the value
(outs) is extremely common in backends; an example in the test suite
is test/TableGen/AsmVariant.td line 30. But the BNF doesn't allow
DagArgList to expand to the empty string (it must contain at least one
DagArg), and therefore the DagArgList specifying the operands in the
dag-shaped production for SimpleValue should be optional.

In the production for BodyItem with a 'let' and an optional RangeList,
the RangeList should have braces around it if it's present, matching
code such as "let E{7-0} = ..." on test/TableGen/BitsInit.td line 42.
Those braces aren't included in the RangeList nonterminal itself, so
instead they need to be part of the optional segment of the BodyItem
production.

Finally, the identifier after 'defm' should be optional. Again, this
is very common in the real back end .td files; an example in the test
suite is in test/TableGen/defmclass.td line 49.

Reviewers: rengolin, nhaehnle, stoklund

Reviewed By: nhaehnle

Subscribers: llvm-commits

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

llvm-svn: 330570

6 years agoRevert "[clang-format] Improve Incomplete detection for (text) protos"
Krasimir Georgiev [Mon, 23 Apr 2018 08:50:36 +0000 (08:50 +0000)]
Revert "[clang-format] Improve Incomplete detection for (text) protos"

This reverts commit r330016.
The incomplete detection has too many false positives, picking up typos
for hard failures and refusing to format anything in that case.

llvm-svn: 330569

6 years ago[CMake] Gate 'dsymutil' dependency
Jonas Devlieghere [Mon, 23 Apr 2018 08:44:06 +0000 (08:44 +0000)]
[CMake] Gate 'dsymutil' dependency

Only add `dsymutil` as a test dependency when this is not a stand-alone
build (LLDB_BUILT_STANDALONE).

llvm-svn: 330568

6 years agoTest commit access.
Simon Tatham [Mon, 23 Apr 2018 08:41:53 +0000 (08:41 +0000)]
Test commit access.

Should be a harmless trimming of trailing whitespace from a
documentation file.

(There are other instances of trailing whitespace in this file alone.
I've only fixed one of them, on the basis that that way the rest are
still available for other people's commit-access tests :-)

llvm-svn: 330567

6 years ago[Atomics] warn about atomic accesses using libcalls
Tim Northover [Mon, 23 Apr 2018 08:16:24 +0000 (08:16 +0000)]
[Atomics] warn about atomic accesses using libcalls

If an atomic variable is misaligned (and that suspicion is why Clang emits
libcalls at all) the runtime support library will have to use a lock to safely
access it, with potentially very bad performance consequences. There's a very
good chance this is unintentional so it makes sense to issue a warning.

Also give it a named group so people can promote it to an error, or disable it
if they really don't care.

llvm-svn: 330566

6 years ago[AArch64][SVE] Asm: Support for structured ST2, ST3 and ST4 (scalar+imm) store instru...
Sander de Smalen [Mon, 23 Apr 2018 07:50:35 +0000 (07:50 +0000)]
[AArch64][SVE] Asm: Support for structured ST2, ST3 and ST4 (scalar+imm) store instructions.

Reviewers: fhahn, rengolin, javed.absar, SjoerdMeijer, t.p.northover, echristo, evandro, huntergr

Reviewed By: rengolin

Subscribers: tschuett, kristof.beyls, llvm-commits

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

llvm-svn: 330565

6 years ago[PM/LoopUnswitch] Remove a buggy assert in the new loop unswitch.
Chandler Carruth [Mon, 23 Apr 2018 06:58:36 +0000 (06:58 +0000)]
[PM/LoopUnswitch] Remove a buggy assert in the new loop unswitch.

The condition this was asserting doesn't actually hold. I've added
comments to explain why, removed the assert, and added a fun test case
reduced out of 403.gcc.

llvm-svn: 330564

6 years ago[X86] Add VEX_WIG to VEX encoded version of VCMPPSY/VCMPPDY.
Craig Topper [Mon, 23 Apr 2018 04:50:01 +0000 (04:50 +0000)]
[X86] Add VEX_WIG to VEX encoded version of VCMPPSY/VCMPPDY.

llvm-svn: 330563

6 years agoupdate readability-identifier-naming-objc test to use interface ivar. Implementation...
Yan Zhang [Mon, 23 Apr 2018 01:05:02 +0000 (01:05 +0000)]
update readability-identifier-naming-objc test to use interface ivar. Implementation ivars are not supported in 32-bits OS.

Reviewers: alexfh, chandlerc

Subscribers: klimek, cfe-commits

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

llvm-svn: 330562

6 years ago[XRay] Change std::sort to llvm::sort in response to r327219
Mandeep Singh Grang [Mon, 23 Apr 2018 00:49:25 +0000 (00:49 +0000)]
[XRay] Change std::sort to llvm::sort in response to r327219

r327219 added wrappers to std::sort which randomly shuffle the container before
sorting.  This will help in uncovering non-determinism caused due to undefined
sorting order of objects having the same key.

To make use of that infrastructure we need to invoke llvm::sort instead of
std::sort.

llvm-svn: 330561

6 years ago[PM/LoopUnswitch] Fix comment typo. NFC.
Chandler Carruth [Mon, 23 Apr 2018 00:48:42 +0000 (00:48 +0000)]
[PM/LoopUnswitch] Fix comment typo. NFC.

llvm-svn: 330560

6 years agoupdate test to use ivar in implementation instead of class extension
Yan Zhang [Mon, 23 Apr 2018 00:15:15 +0000 (00:15 +0000)]
update test to use ivar in implementation instead of class extension

Summary: using ivar in class extension is not supported in 32-bit architecture of MacOS.

Reviewers: alexfh, hokein

Reviewed By: alexfh

Subscribers: klimek, cfe-commits

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

llvm-svn: 330559

6 years ago[X86][Znver1] Remove unnecessary BMI1 ANDN InstRW overrides.
Simon Pilgrim [Sun, 22 Apr 2018 21:37:08 +0000 (21:37 +0000)]
[X86][Znver1] Remove unnecessary BMI1 ANDN InstRW overrides.

llvm-svn: 330558

6 years ago[python bindings] Fix Cursor.result_type for ObjC method declarations - Bug 36677
Jonathan Coe [Sun, 22 Apr 2018 20:51:05 +0000 (20:51 +0000)]
[python bindings] Fix Cursor.result_type for ObjC method declarations - Bug 36677

Summary:
In cindex.py, Cursor.result_type called into the wrong libclang
function, causing cursors for ObjC method declarations to return invalid
result types. Fixes Bug 36677.

Reviewers: jbcoe, rsmith

Reviewed By: jbcoe

Subscribers: cfe-commits, llvm-commits

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

Patch by kjteske (Kyle Teske).

llvm-svn: 330557

6 years ago[llvm-mca][X86] Add BMI/LZCNT/POPCNT resource tests to all relevant models
Simon Pilgrim [Sun, 22 Apr 2018 20:42:24 +0000 (20:42 +0000)]
[llvm-mca][X86] Add BMI/LZCNT/POPCNT resource tests to all relevant models

The SandyBridge BMI tests are actually run on IvyBridge as that's the first lowest CPU that actually support the ISAs (but still use the SandyBridge model).

llvm-svn: 330556

6 years ago[LLVM-C] Add DIBuilder Bindings For Variable Creation
Robert Widmann [Sun, 22 Apr 2018 19:24:44 +0000 (19:24 +0000)]
[LLVM-C] Add DIBuilder Bindings For Variable Creation

Summary: Wrap LLVMDIBuilderCreateAutoVariable, LLVMDIBuilderCreateParameterVariable, LLVMDIBuilderCreateExpression, and move and correct LLVMDIBuilderInsertDeclareBefore and LLVMDIBuilderInsertDeclareAtEnd from the Go bindings to the C bindings.

Reviewers: harlanhaskins, whitequark, deadalnix

Reviewed By: harlanhaskins, whitequark

Subscribers: llvm-commits

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

llvm-svn: 330555

6 years ago[X86] Remove unnecessary WriteFBlend/WriteBlend InstRW overrides.
Simon Pilgrim [Sun, 22 Apr 2018 18:35:53 +0000 (18:35 +0000)]
[X86] Remove unnecessary WriteFBlend/WriteBlend InstRW overrides.

Fixed a lot of the default classes which were being completely overridden.

llvm-svn: 330554

6 years ago[X86] Remove unnecessary WriteFMul/WriteFRcp/WriteFRsqrt InstRW overrides.
Simon Pilgrim [Sun, 22 Apr 2018 18:09:50 +0000 (18:09 +0000)]
[X86] Remove unnecessary WriteFMul/WriteFRcp/WriteFRsqrt InstRW overrides.

llvm-svn: 330553

6 years ago[X86] Remove unnecessary CVT instrw overrides.
Simon Pilgrim [Sun, 22 Apr 2018 17:54:58 +0000 (17:54 +0000)]
[X86] Remove unnecessary CVT instrw overrides.

llvm-svn: 330552

6 years agoTest commit access.
Andres Freund [Sun, 22 Apr 2018 17:53:34 +0000 (17:53 +0000)]
Test commit access.

Remove trailing whitespace.

llvm-svn: 330551

6 years ago[PatternMatch] allow undef elements when matching a vector zero
Sanjay Patel [Sun, 22 Apr 2018 17:07:44 +0000 (17:07 +0000)]
[PatternMatch] allow undef elements when matching a vector zero

This is the last step in getting constant pattern matchers to allow
undef elements in constant vectors.

I'm adding a dedicated m_ZeroInt() function and building m_Zero() from
that. In most cases, calling code can be updated to use m_ZeroInt()
directly when there's no need to match pointers, but I'm leaving that
efficiency optimization as a follow-up step because it's not always
clear when that's ok.

There are just enough icmp folds in InstSimplify that can be used for
integer or pointer types, that we probably still want a generic m_Zero()
for those cases. Otherwise, we could eliminate it (and possibly add a
m_NullPtr() as an alias for isa<ConstantPointerNull>()).

We're conservatively returning a full zero vector (zeroinitializer) in
InstSimplify/InstCombine on some of these folds (see diffs in InstSimplify),
but I'm not sure if that's actually necessary in all cases. We may be
able to propagate an undef lane instead. One test where this happens is
marked with 'TODO'.

llvm-svn: 330550

6 years ago[X86][SkylakeServer] Remove unnecessary PMULLD instrw overrides.
Simon Pilgrim [Sun, 22 Apr 2018 16:51:12 +0000 (16:51 +0000)]
[X86][SkylakeServer] Remove unnecessary PMULLD instrw overrides.

llvm-svn: 330549

6 years ago[X86][Atom] Remove unnecessary scalar/vector load/move instrw overrides.
Simon Pilgrim [Sun, 22 Apr 2018 16:49:35 +0000 (16:49 +0000)]
[X86][Atom] Remove unnecessary scalar/vector load/move instrw overrides.

llvm-svn: 330548

6 years ago[InstCombine] add vector test with undef elts; NFC
Sanjay Patel [Sun, 22 Apr 2018 15:59:14 +0000 (15:59 +0000)]
[InstCombine] add vector test with undef elts; NFC

llvm-svn: 330547

6 years ago[X86] Fix (completely overridden) WriteFHAdd/WritePHAdd classes to allow us to remove...
Simon Pilgrim [Sun, 22 Apr 2018 15:25:59 +0000 (15:25 +0000)]
[X86] Fix (completely overridden) WriteFHAdd/WritePHAdd classes to allow us to remove unnecessary instrw overrides.

llvm-svn: 330546

6 years ago[X86][MMX][SSE] Tag missed PHADD/PHSUB instructions with WritePHAdd
Simon Pilgrim [Sun, 22 Apr 2018 15:02:23 +0000 (15:02 +0000)]
[X86][MMX][SSE] Tag missed PHADD/PHSUB instructions with WritePHAdd

llvm-svn: 330545

6 years ago[X86] Remove unnecessary WriteFVarBlend/WriteVarBlend InstRW overrides.
Simon Pilgrim [Sun, 22 Apr 2018 14:43:12 +0000 (14:43 +0000)]
[X86] Remove unnecessary WriteFVarBlend/WriteVarBlend InstRW overrides.

This also fixes some of the ReadAfterLd issues due to InstRW.

llvm-svn: 330544

6 years ago[InstSimplify, InstCombine] add vector tests with undef elts; NFC
Sanjay Patel [Sun, 22 Apr 2018 14:19:37 +0000 (14:19 +0000)]
[InstSimplify, InstCombine] add vector tests with undef elts; NFC

llvm-svn: 330543

6 years ago[X86] Fix WriteMPSAD/WritePSADBW values to allow us to remove unnecessary instrw...
Simon Pilgrim [Sun, 22 Apr 2018 10:39:16 +0000 (10:39 +0000)]
[X86] Fix WriteMPSAD/WritePSADBW values to allow us to remove unnecessary instrw overrides.

llvm-svn: 330542

6 years ago[X86][SandyBridge] Remove unnecessary WritePOPCNTLd overrides by fixing load latency.
Simon Pilgrim [Sun, 22 Apr 2018 10:03:52 +0000 (10:03 +0000)]
[X86][SandyBridge] Remove unnecessary WritePOPCNTLd overrides by fixing load latency.

llvm-svn: 330541

6 years ago[llvm-mca][X86] Add POPCNT resource test
Simon Pilgrim [Sun, 22 Apr 2018 09:58:00 +0000 (09:58 +0000)]
[llvm-mca][X86] Add POPCNT resource test

llvm-svn: 330540

6 years ago[test] Fix MC/ELF/nocompression.s
Jonas Devlieghere [Sun, 22 Apr 2018 08:46:27 +0000 (08:46 +0000)]
[test] Fix MC/ELF/nocompression.s

Unbreak the linux build bots:
  http://lab.llvm.org:8011/builders/clang-lld-x86_64-2stage/builds/5165/
  http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/28775
  http://lab.llvm.org:8011/builders/clang-with-lto-ubuntu/builds/8227

llvm-svn: 330539

6 years ago[lli] Fix syntax error: missing ';'
Jonas Devlieghere [Sun, 22 Apr 2018 08:35:00 +0000 (08:35 +0000)]
[lli] Fix syntax error: missing ';'

Fixes build issue on the windows bots:
  error C2143: syntax error: missing ';'

llvm-svn: 330538

6 years ago[lli] Make error handling more consistent.
Jonas Devlieghere [Sun, 22 Apr 2018 08:02:11 +0000 (08:02 +0000)]
[lli] Make error handling more consistent.

Makes error handling more consistent by using the helpers in support.

llvm-svn: 330537

6 years ago[llvm-mc] Make error handling more consistent.
Jonas Devlieghere [Sun, 22 Apr 2018 08:01:35 +0000 (08:01 +0000)]
[llvm-mc] Make error handling more consistent.

Makes error handling more consistent by using the helpers in support.

llvm-svn: 330536

6 years ago[Support] Fix prefix logic in WithColor.
Jonas Devlieghere [Sun, 22 Apr 2018 08:01:01 +0000 (08:01 +0000)]
[Support] Fix prefix logic in WithColor.

When a prefix is passed, we need to print a colon a space after it, not
just the prefix.

llvm-svn: 330535

6 years ago[X86] Remove an unnecessary HANDLE_OPTIONAL line from the disassembler operand proces...
Craig Topper [Sun, 22 Apr 2018 06:40:37 +0000 (06:40 +0000)]
[X86] Remove an unnecessary HANDLE_OPTIONAL line from the disassembler operand processing.

llvm-svn: 330534

6 years ago[X86] Change TB to PS on LFENCE instruction.
Craig Topper [Sun, 22 Apr 2018 03:15:02 +0000 (03:15 +0000)]
[X86] Change TB to PS on LFENCE instruction.

This matches the other FENCE instructions.

llvm-svn: 330533

6 years ago[X86] Remove OpSizeIgnore, it's not implemented any differently than OpSizeFixed.
Craig Topper [Sun, 22 Apr 2018 01:24:58 +0000 (01:24 +0000)]
[X86] Remove OpSizeIgnore, it's not implemented any differently than OpSizeFixed.

llvm-svn: 330532

6 years ago[X86] Remove DATA32_PREFIX. Hack the printing for DATA16_PREFIX to print 'data32...
Craig Topper [Sun, 22 Apr 2018 00:52:02 +0000 (00:52 +0000)]
[X86] Remove DATA32_PREFIX. Hack the printing for DATA16_PREFIX to print 'data32' in 16-bit mode. Hack the asm parser to convert 'data32' to 'data16' in 16-bit mode.

Improve the error messages to match GNU assembler.

This also allows us to remove the hack from the disassembler table building.

llvm-svn: 330531

6 years agoAdd tests for llvm-bcanalyzer stream types
Brian Gesiak [Sun, 22 Apr 2018 00:04:35 +0000 (00:04 +0000)]
Add tests for llvm-bcanalyzer stream types

Summary:
Add tests for the improved stream type detection added to
`llvm-bcanalyzer` in https://reviews.llvm.org/D41979.

Test Plan: `check-clang`

Reviewers: pcc, aprantl, mehdi_amini, george.karpenkov

Reviewed By: aprantl

Subscribers: cfe-commits, a.sidorin

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

llvm-svn: 330530

6 years ago[bcanalyzer] Recognize more stream types
Brian Gesiak [Sat, 21 Apr 2018 23:52:04 +0000 (23:52 +0000)]
[bcanalyzer] Recognize more stream types

Summary:
`llvm-bcanalyzer` prints out the stream type of the file it is
analyzing. If the file begins with the LLVM IR magic number, it reports
a stream type of "LLVM IR". However, any other bitstream format is
reported as "unknown".

Add some checks for two other common bitstream formats: Clang AST
files, which begin with 'CPCH', and Clang serialized diagnostics, which
begin with 'DIAG'.

Test Plan: `check-llvm`

Reviewers: pcc, aprantl, mehdi_amini, davide, george.karpenkov, JDevlieghere

Reviewed By: JDevlieghere

Subscribers: JDevlieghere, bruno, davide, llvm-commits

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

llvm-svn: 330529

6 years agoRevert r330492: [clang-tidy] add new check to find out objc ivars which do not have...
Chandler Carruth [Sat, 21 Apr 2018 23:27:34 +0000 (23:27 +0000)]
Revert r330492: [clang-tidy] add new check to find out objc ivars which do not have prefix '_'

This commit has been breaking most bots for a day now. There is a fix
proposed in https://reviews.llvm.org/D45912 but when I applied that
I just got different errors. Reverting to get our bots back to green.

llvm-svn: 330528

6 years ago[X86] Strip unnecessary prefetch + vector move/load instrw overrides from scheduler...
Simon Pilgrim [Sat, 21 Apr 2018 21:59:36 +0000 (21:59 +0000)]
[X86] Strip unnecessary prefetch + vector move/load instrw overrides from scheduler models.

llvm-svn: 330527

6 years ago[Support] Add optional prefix to convenience helpers in WithColor.
Jonas Devlieghere [Sat, 21 Apr 2018 21:36:11 +0000 (21:36 +0000)]
[Support] Add optional prefix to convenience helpers in WithColor.

Several tools prefix the error/warning/note output with the name of the
tool. One such tool is LLD for example. This commit adds as an optional
'Prefix' argument to the convenience helpers.

llvm-svn: 330526

6 years ago[X86] Strip unnecessary WriteCvtF2I instrw overrides from scheduler models.
Simon Pilgrim [Sat, 21 Apr 2018 21:16:44 +0000 (21:16 +0000)]
[X86] Strip unnecessary WriteCvtF2I instrw overrides from scheduler models.

llvm-svn: 330525

6 years ago[tools] Use WithColor for printing errors.
Jonas Devlieghere [Sat, 21 Apr 2018 21:11:59 +0000 (21:11 +0000)]
[tools] Use WithColor for printing errors.

Use convenience helpers in WithColor to print errors, warnings and notes
in a few more tools.

llvm-svn: 330524

6 years ago[X86] Strip unnecessary broadcast/shuffle256 instrw overrides from scheduler models.
Simon Pilgrim [Sat, 21 Apr 2018 20:45:12 +0000 (20:45 +0000)]
[X86] Strip unnecessary broadcast/shuffle256 instrw overrides from scheduler models.

llvm-svn: 330523

6 years ago[X86][AVX] VPERM2F128/VINSERTF128 should be a shuffle256 schedule like VPERM2I128...
Simon Pilgrim [Sat, 21 Apr 2018 20:04:24 +0000 (20:04 +0000)]
[X86][AVX] VPERM2F128/VINSERTF128 should be a shuffle256 schedule like VPERM2I128/VINSERTI128

llvm-svn: 330522

6 years ago[X86] Strip unnecessary vector integer math, shift-imm, extend, shuffle, pack/unpack...
Simon Pilgrim [Sat, 21 Apr 2018 19:11:55 +0000 (19:11 +0000)]
[X86] Strip unnecessary vector integer math, shift-imm, extend, shuffle, pack/unpack instruction instrw overrides from scheduler models.

llvm-svn: 330521

6 years ago[X86] Add DAG combine to turn (trunc (srl (mul ext, ext), 16) into PMULHW/PMULHUW.
Craig Topper [Sat, 21 Apr 2018 18:39:21 +0000 (18:39 +0000)]
[X86] Add DAG combine to turn (trunc (srl (mul ext, ext), 16) into PMULHW/PMULHUW.

Ultimately I want to use this to remove the intrinsics for these instructions.

llvm-svn: 330520

6 years ago[X86] Add test cases that show the current codegen for (trunc (srl (mul ext, ext...
Craig Topper [Sat, 21 Apr 2018 18:39:20 +0000 (18:39 +0000)]
[X86] Add test cases that show the current codegen for (trunc (srl (mul ext, ext), 16)). NFC

A future patch will turn this into MULHU/MULHS.

llvm-svn: 330519

6 years ago[lit] Generate a single lit cfg file for tests that require dotest.py
Jonas Devlieghere [Sat, 21 Apr 2018 18:23:04 +0000 (18:23 +0000)]
[lit] Generate a single lit cfg file for tests that require dotest.py

The current way that the lit configuration is generated for the LLDB
tests that run using dotest causes cmake to fail when using a generator
which supports multiple configurations (such as Visual Studio). The
failure is because file GENERATE will create a file *per possible
configuration* resulting in the same lit configuration file being
overwritten multiple times.

To fix the issue, we need to create a single lit file that is agnostic
of the configurations and can be used for any configuration.

Patch by: Stella Stamenova

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

llvm-svn: 330518

6 years ago[X86] Add SchedWrites for LDMXCSR/STMXCSR.
Craig Topper [Sat, 21 Apr 2018 18:07:36 +0000 (18:07 +0000)]
[X86] Add SchedWrites for LDMXCSR/STMXCSR.

llvm-svn: 330517

6 years ago[InstSimplify] move tests for shifts; NFC
Sanjay Patel [Sat, 21 Apr 2018 16:58:00 +0000 (16:58 +0000)]
[InstSimplify] move tests for shifts; NFC

llvm-svn: 330516

6 years ago[InstSimplify] move/add/regenerate checks for tests; NFC
Sanjay Patel [Sat, 21 Apr 2018 16:23:47 +0000 (16:23 +0000)]
[InstSimplify] move/add/regenerate checks for tests; NFC

llvm-svn: 330515

6 years ago[X86][Haswell] Strip unnecessary WriteFAdd/WriteFHAdd instruction instrw overrides.
Simon Pilgrim [Sat, 21 Apr 2018 16:20:28 +0000 (16:20 +0000)]
[X86][Haswell] Strip unnecessary WriteFAdd/WriteFHAdd instruction instrw overrides.

llvm-svn: 330514

6 years ago[X86][Broadwell] Remove unnecessary VORPD/VORPS instrw override - missed in D45629
Simon Pilgrim [Sat, 21 Apr 2018 16:17:47 +0000 (16:17 +0000)]
[X86][Broadwell] Remove unnecessary VORPD/VORPS instrw override - missed in D45629

llvm-svn: 330513

6 years ago[llvm-mca][X86] Add AVX2 resource tests
Simon Pilgrim [Sat, 21 Apr 2018 16:12:42 +0000 (16:12 +0000)]
[llvm-mca][X86] Add AVX2 resource tests

llvm-svn: 330512

6 years ago[clang-tidy] Customize FileCheck prefix in check_clang-tidy.py
Zinovy Nis [Sat, 21 Apr 2018 15:23:56 +0000 (15:23 +0000)]
[clang-tidy] Customize FileCheck prefix in check_clang-tidy.py

The patch introduces a new command line option '-check-suffix' for check_clang_tidy.py
to allow multiple %check_clang_tidy% in a single test file.

Sample:

// RUN: %check_clang_tidy -check-suffix=FLAG-1 %s misc-unused-using-decls %t -- -- <options-set-1>
// RUN: %check_clang_tidy -check-suffix=FLAG-2 %s misc-unused-using-decls %t -- -- <options-set-2>
...
+// CHECK-MESSAGES-FLAG-1: :[[@LINE-4]]:10: warning: using decl 'B' is unused [misc-unused-using-decls]
+// CHECK-MESSAGES-FLAG-2: :[[@LINE-7]]:10: warning: using decl 'A' is unused [misc-unused-using-decls]
+// CHECK-FIXES-FLAG-1-NOT: using a::A;$
+// CHECK-FIXES-FLAG-2-NOT: using a::B;$

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

llvm-svn: 330511

6 years ago[X86] Strip unnecessary WriteFRcp/WriteFRsqrt instruction instrw overrides from sched...
Simon Pilgrim [Sat, 21 Apr 2018 15:16:59 +0000 (15:16 +0000)]
[X86] Strip unnecessary WriteFRcp/WriteFRsqrt instruction instrw overrides from scheduler models.

The required the default skylake schedules to be updated - these were being completely overriden by the InstRW and the existing values not used at all.

llvm-svn: 330510

6 years ago[clang-apply-replacements] Make clang-apply-replacements installable
Zinovy Nis [Sat, 21 Apr 2018 15:01:33 +0000 (15:01 +0000)]
[clang-apply-replacements] Make clang-apply-replacements installable

Add a new target for install: install-clang-apply-replacements.
So if you need clang-tidy and clang-apply-replacements tools only,
you may build and install only these tools:

    make install-clang-tidy install-clang-apply-replacements

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

llvm-svn: 330509

6 years ago[X86] Strip unnecessary WriteFShuffle instruction instrw overrides from scheduler...
Simon Pilgrim [Sat, 21 Apr 2018 14:56:56 +0000 (14:56 +0000)]
[X86] Strip unnecessary WriteFShuffle instruction instrw overrides from scheduler models.

llvm-svn: 330508

6 years ago[libclang] Fix LibclangReparseTest.FileName when TMPDIR is set to a symlink
Petr Pavlu [Sat, 21 Apr 2018 14:35:18 +0000 (14:35 +0000)]
[libclang] Fix LibclangReparseTest.FileName when TMPDIR is set to a symlink

Fix testing of clang_File_tryGetRealPathName() in
LibclangReparseTest.FileName when executing in an environment which has
TMPDIR set to a symbolic link that points to an actual directory. The
test would fail because the name returned by
clang_File_tryGetRealPathName() has the symlink resolved but the test
compared it to the original filename of a temporary file.

The patch addresses the problem by checking only that the value returned
by clang_File_tryGetRealPathName() ends with "main.cpp".

Additionally, the patch makes the previous assertion in the test that
checks result of clang_getFileName() stricter. It newly verifies that
the name returned by the function is exactly same as what was given to
clang_parseTranslationUnit()/clang_getFile().

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

llvm-svn: 330507

6 years ago[llvm-mca][X86] Add SSE resource tests to all models
Simon Pilgrim [Sat, 21 Apr 2018 14:16:57 +0000 (14:16 +0000)]
[llvm-mca][X86] Add SSE resource tests to all models

llvm-svn: 330506

6 years ago[X86][SandyBridge] Strip unnecessary MOVQ/CVT instruction instrw overrides.
Simon Pilgrim [Sat, 21 Apr 2018 14:03:40 +0000 (14:03 +0000)]
[X86][SandyBridge] Strip unnecessary MOVQ/CVT instruction instrw overrides.

llvm-svn: 330505

6 years agoTemporarily skip Go TestExpressions on FreeBSD as it hangs
Ed Maste [Sat, 21 Apr 2018 13:59:07 +0000 (13:59 +0000)]
Temporarily skip Go TestExpressions on FreeBSD as it hangs

llvm.org/pr37194

llvm-svn: 330504

6 years ago[X86] Strip unnecessary MMX instruction instrw overrides from scheduler models.
Simon Pilgrim [Sat, 21 Apr 2018 12:15:42 +0000 (12:15 +0000)]
[X86] Strip unnecessary MMX instruction instrw overrides from scheduler models.

llvm-svn: 330503

6 years ago[llvm-mca][X86] Add MMX resource tests
Simon Pilgrim [Sat, 21 Apr 2018 11:28:59 +0000 (11:28 +0000)]
[llvm-mca][X86] Add MMX resource tests

llvm-svn: 330502

6 years ago[X86] Strip unnecessary x87 instruction instrw overrides from scheduler models.
Simon Pilgrim [Sat, 21 Apr 2018 11:25:02 +0000 (11:25 +0000)]
[X86] Strip unnecessary x87 instruction instrw overrides from scheduler models.

llvm-svn: 330501

6 years agoFreeBSD: propagate error to user if memory access fails
Ed Maste [Sat, 21 Apr 2018 11:23:56 +0000 (11:23 +0000)]
FreeBSD: propagate error to user if memory access fails

Previously, an attempt to read an unreadable address reported zeros.
Now, if DoReadMemory or DoWriteMemory encounters error then return 0
(bytes read or written) so that the error is reported to the user.

llvm.org/pr37190

llvm-svn: 330500

6 years ago[llvm-mca][X86] Add X87 resource tests
Simon Pilgrim [Sat, 21 Apr 2018 10:36:19 +0000 (10:36 +0000)]
[llvm-mca][X86] Add X87 resource tests

llvm-svn: 330499

6 years ago[X86][X87] Add missing fldlg2 schedule test
Simon Pilgrim [Sat, 21 Apr 2018 10:35:04 +0000 (10:35 +0000)]
[X86][X87] Add missing fldlg2 schedule test

llvm-svn: 330498

6 years ago[PowerPC] fix incorrect vectorization of abs() on POWER9
Hiroshi Inoue [Sat, 21 Apr 2018 09:32:17 +0000 (09:32 +0000)]
[PowerPC] fix incorrect vectorization of abs() on POWER9

Vectorized loops with abs() returns incorrect results on POWER9. This patch fixes it.
For example the following code returns negative result if input values are negative though it sums up the absolute value of the inputs.

int vpx_satd_c(const int16_t *coeff, int length) {
  int satd = 0;
  for (int i = 0; i < length; ++i) satd += abs(coeff[i]);
  return satd;
}

This problem causes test failures for libvpx.
For vector absolute and vector absolute difference on POWER9, LLVM generates VABSDUW (Vector Absolute Difference Unsigned Word) instruction or variants.
Since these instructions are for unsigned integers, we need adjustment for signed integers.
For abs(sub(a, b)), we generate VABSDUW(a+0x80000000, b+0x80000000). Otherwise, abs(sub(-1, 0)) returns 0xFFFFFFFF(=-1) instead of 1. For abs(a), we generate VABSDUW(a+0x80000000, 0x80000000).

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

llvm-svn: 330497

6 years agoUpdate isl to isl-0.19-107-gc4fe33d8
Tobias Grosser [Sat, 21 Apr 2018 08:34:22 +0000 (08:34 +0000)]
Update isl to isl-0.19-107-gc4fe33d8

This is a regular maintenance update.

llvm-svn: 330496

6 years ago[AArch64] Don't crash trying to resolve __stack_chk_guard.
Eli Friedman [Sat, 21 Apr 2018 00:07:46 +0000 (00:07 +0000)]
[AArch64] Don't crash trying to resolve __stack_chk_guard.

In certain cases, the compiler might try to merge __stack_chk_guard with
another global variable.  (Or someone could theoretically define
__stack_chk_guard as an alias.)  In that case, make sure we don't crash.

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

llvm-svn: 330495

6 years agoFix typo in test (verify-machine-instrs -> verify-machineinstrs)
Jessica Paquette [Fri, 20 Apr 2018 23:37:48 +0000 (23:37 +0000)]
Fix typo in test (verify-machine-instrs -> verify-machineinstrs)

llvm-svn: 330494

6 years ago[MachineOutliner] XFAIL machine-outliner-noredzone.ll
Jessica Paquette [Fri, 20 Apr 2018 23:35:54 +0000 (23:35 +0000)]
[MachineOutliner] XFAIL machine-outliner-noredzone.ll

The verifier began complaining about an undefined physical register in this
test. XFAILing for the purposes of getting a bot up while I look into it.

Failure:
http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-expensive/11385/

llvm-svn: 330493

6 years ago[clang-tidy] add new check to find out objc ivars which do not have prefix '_'
Yan Zhang [Fri, 20 Apr 2018 23:18:09 +0000 (23:18 +0000)]
[clang-tidy] add new check to find out objc ivars which do not have prefix '_'

Summary:
For code of ivar declaration:

   int barWithoutPrefix;

The fix will be:

   int _barWithoutPrefix;

Reviewers: benhamilton, hokein, alexfh, aaron.ballman, ilya-biryukov

Reviewed By: alexfh

Subscribers: Eugene.Zelenko, xazax.hun, klimek, mgorny, cfe-commits

Tags: #clang-tools-extra

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

llvm-svn: 330492

6 years ago[ELF] Swap argument names: use Old to refer to original symbol and New for incoming one
Fangrui Song [Fri, 20 Apr 2018 22:50:15 +0000 (22:50 +0000)]
[ELF] Swap argument names: use Old to refer to original symbol and New for incoming one

Reviewers: ruiu, espindola

Subscribers: emaste, arichardson, llvm-commits

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

llvm-svn: 330491

6 years agoFix nullptr passed to memcpy in lld/COFF/Chunks.cpp
Bob Haarman [Fri, 20 Apr 2018 22:16:09 +0000 (22:16 +0000)]
Fix nullptr passed to memcpy in lld/COFF/Chunks.cpp

Summary:
ubsan found that we sometimes pass nullptr to memcpy in
SectionChunk::writeTo(). This change adds a check that avoids that.

Reviewers: ruiu

Reviewed By: ruiu

Subscribers: llvm-commits

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

llvm-svn: 330490

6 years ago[ObjCARC] Take BlockColors by const reference. NFC
Shoaib Meenai [Fri, 20 Apr 2018 22:14:45 +0000 (22:14 +0000)]
[ObjCARC] Take BlockColors by const reference. NFC

llvm-svn: 330489

6 years agoCOFF: Document /pdbaltpath.
Peter Collingbourne [Fri, 20 Apr 2018 22:11:28 +0000 (22:11 +0000)]
COFF: Document /pdbaltpath.

llvm-svn: 330488

6 years ago[ObjCARC] Account for funclet token in storeStrong transform
Shoaib Meenai [Fri, 20 Apr 2018 22:11:03 +0000 (22:11 +0000)]
[ObjCARC] Account for funclet token in storeStrong transform

When creating a call to storeStrong in ObjCARCContract, ensure the call
gets the correct funclet token, otherwise WinEHPrepare will turn the
call (and all subsequent instructions) into unreachable.

We already have logic to do this for the ARC autorelease elision marker;
factor that out into a common function that's used for both. These are
the only two places in this transform that create call instructions.

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

llvm-svn: 330487

6 years ago[llvm-mca][X86] Add MMX/SSE/AES/CLMUL resource SandyBridge tests
Simon Pilgrim [Fri, 20 Apr 2018 22:04:11 +0000 (22:04 +0000)]
[llvm-mca][X86] Add MMX/SSE/AES/CLMUL resource SandyBridge tests

llvm-svn: 330486

6 years agoUse /pdbaltpath to avoid a path length dependency.
Peter Collingbourne [Fri, 20 Apr 2018 21:54:55 +0000 (21:54 +0000)]
Use /pdbaltpath to avoid a path length dependency.

llvm-svn: 330485

6 years agoCOFF: Merge .xdata into .rdata by default.
Peter Collingbourne [Fri, 20 Apr 2018 21:32:37 +0000 (21:32 +0000)]
COFF: Merge .xdata into .rdata by default.

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

llvm-svn: 330484

6 years agoCOFF: Merge .bss into .data by default.
Peter Collingbourne [Fri, 20 Apr 2018 21:30:36 +0000 (21:30 +0000)]
COFF: Merge .bss into .data by default.

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

llvm-svn: 330483

6 years agoAdd -z {combreloc,copyreloc,noexecstack,lazy,relro,text}.
Rui Ueyama [Fri, 20 Apr 2018 21:24:08 +0000 (21:24 +0000)]
Add -z {combreloc,copyreloc,noexecstack,lazy,relro,text}.

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

llvm-svn: 330482

6 years agoCOFF: Preserve section type when processing /section flag.
Peter Collingbourne [Fri, 20 Apr 2018 21:23:16 +0000 (21:23 +0000)]
COFF: Preserve section type when processing /section flag.

It turns out that we were dropping this before.

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

llvm-svn: 330481

6 years ago[X86] Add WriteFSign/WriteFLogic scheduler classes
Simon Pilgrim [Fri, 20 Apr 2018 21:16:05 +0000 (21:16 +0000)]
[X86] Add WriteFSign/WriteFLogic scheduler classes

Split the fp and integer vector logical instruction scheduler classes - older CPUs especially often handled these on different pipes.

This unearthed a couple of things that are also handled in this patch:

(1) We were tagging avx512 fp logic ops as WriteFAdd, probably because of the lack of WriteFLogic
(2) SandyBridge had integer logic ops only using Port5, when afaict they can use Ports015.
(3) Cleaned up x86 FCHS/FABS scheduling as they are typically treated as fp logic ops.

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

llvm-svn: 330480

6 years agoCOFF: Use (name, output characteristics) as a key when grouping input sections into...
Peter Collingbourne [Fri, 20 Apr 2018 21:10:33 +0000 (21:10 +0000)]
COFF: Use (name, output characteristics) as a key when grouping input sections into output sections.

This is what link.exe does and lets us avoid needing to worry about
merging output characteristics while adding input sections to output
sections.

With this change we can't process /merge in the same way as before
because sections with different output characteristics can still
be merged into one another. So this change moves the processing of
/merge to just before we assign addresses. In the case where there
are multiple output sections with the same name, link.exe only merges
the first section with the source name into the first section with
the target name, and we do the same.

At the same time I also implemented transitive merging (which means
that /merge:.c=.b /merge:.b=.a merges both .c and .b into .a).

This isn't quite enough though because link.exe has a special case for
.CRT in 32-bit mode: it processes sections whose output characteristics
are DATA | R | W as though the output characteristics were DATA | R
(so that they get merged into things like constructor lists in the
expected way). Chromium has a few such sections, and it turns out
that those sections were causing the problem that resulted in r318699
(merge .xdata into .rdata) being reverted: because of the previous
permission merging semantics, the .CRT sections were causing the entire
.rdata section to become writable, which caused the SEH runtime to
crash because it apparently requires .xdata to be read-only. This
change also implements the same special case.

This should unblock being able to merge .xdata into .rdata by default,
as well as .bss into .data, both of which will be done in followups.

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

llvm-svn: 330479

6 years ago[llvm-objcopy] Fix sh_link
Alexander Shaposhnikov [Fri, 20 Apr 2018 20:46:04 +0000 (20:46 +0000)]
[llvm-objcopy] Fix sh_link

This diff fixes sh_link for various types of sections
(i.e. for SHT_ARM_EXIDX, SHT_HASH). In particular, this change enables us
to use llvm-objcopy with clang -gsplit-dwarf for the target android-arm.

Test plan: make check-all

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

llvm-svn: 330478

6 years ago[OpenMP] Make bc file compilation sensitive to LIBOMPTARGET_NVPTX_DEBUG flag
Guansong Zhang [Fri, 20 Apr 2018 20:41:00 +0000 (20:41 +0000)]
[OpenMP] Make bc file compilation sensitive to LIBOMPTARGET_NVPTX_DEBUG flag

Summary: The LIBOMPTARGET_NVPTX_DEBUG flag is inconsistent between using nvcc to generate .a file and clang to generate .bc file. Sync the two setting so we can get debug messages from the bc file path as well.

Reviewers: grokos

Subscribers: Hahnfeld, openmp-commits, mgorny

Tags: #openmp

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

llvm-svn: 330477

6 years agoRevert "[Sanitizer] Internal Printf string precision argument + padding."
Alex Shlyapnikov [Fri, 20 Apr 2018 20:24:02 +0000 (20:24 +0000)]
Revert "[Sanitizer] Internal Printf string precision argument + padding."

This reverts commit r330458.

There are existing code using string precision as 'max len', need more
work.

llvm-svn: 330476

6 years ago[HWASan] Introduce non-zero based and dynamic shadow memory (LLVM).
Alex Shlyapnikov [Fri, 20 Apr 2018 20:04:04 +0000 (20:04 +0000)]
[HWASan] Introduce non-zero based and dynamic shadow memory (LLVM).

Summary:
Support the dynamic shadow memory offset (the default case for user
space now) and static non-zero shadow memory offset
(-hwasan-mapping-offset option). Keeping the the latter case around
for functionality and performance comparison tests (and mostly for
-hwasan-mapping-offset=0 case).

The implementation is stripped down ASan one, picking only the relevant
parts in the following assumptions: shadow scale is fixed, the shadow
memory is dynamic, it is accessed via ifunc global, shadow memory address
rematerialization is suppressed.

Keep zero-based shadow memory for kernel (-hwasan-kernel option) and
calls instreumented case (-hwasan-instrument-with-calls option), which
essentially means that the generated code is not changed in these cases.

Reviewers: eugenis

Subscribers: srhines, llvm-commits

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

llvm-svn: 330475

6 years ago[HWASan] Introduce non-zero based and dynamic shadow memory (compiler-rt).
Alex Shlyapnikov [Fri, 20 Apr 2018 20:03:57 +0000 (20:03 +0000)]
[HWASan] Introduce non-zero based and dynamic shadow memory (compiler-rt).

Summary:
Retire the fixed shadow memory mapping to avoid conflicts with default
process memory mapping (currently manifests on Android).

Tests on AArch64 show <1% performance loss and code size increase,
making it possible to use dynamic shadow memory by default.

For the simplicity and unifirmity sake, use dynamic shadow memory mapping
with base address accessed via ifunc resolver on all supported platforms.

Keep the fixed shadow memory mapping around to be able to run
performance comparison tests later.

Complementing D45840.

Reviewers: eugenis

Subscribers: srhines, kubamracek, dberris, mgorny, kristof.beyls, delcypher, #sanitizers, llvm-commits

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

llvm-svn: 330474

6 years ago[PartialInlining] Fix Crash from holding a reference to a destructed ORE.
Sean Fertile [Fri, 20 Apr 2018 19:56:26 +0000 (19:56 +0000)]
[PartialInlining] Fix Crash from holding a reference to a destructed ORE.

The callback used to create an ORE for the legacy PI pass caches the allocated
object in a unique_ptr in the runOnModule function, and returns a reference to
that object. Under certian circumstances we can end up holding onto that
reference after the OREs destruction. Rather then allowing the new and legacy
passes to create ORE object in diffrent ways, create the ORE at the point of
use.

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

llvm-svn: 330473

6 years ago[Hexagon] hexagon-autohvx was left on again
Krzysztof Parzyszek [Fri, 20 Apr 2018 19:45:49 +0000 (19:45 +0000)]
[Hexagon] hexagon-autohvx was left on again

llvm-svn: 330472

6 years ago[Hexagon] Improve HVX instruction selection (bitcast, vsplat)
Krzysztof Parzyszek [Fri, 20 Apr 2018 19:38:37 +0000 (19:38 +0000)]
[Hexagon] Improve HVX instruction selection (bitcast, vsplat)

There was some unfortunate interaction between VSPLAT and BITCAST
related to the selection of constant vectors (coming from selecting
shuffles). Introduce VSPLATW that always splats a 32-bit word, and
can have arbitrary result type (to avoid BITCASTs of VSPLAT).
Clean up the previous selection of BITCAST/VSPLAT.

llvm-svn: 330471