platform/upstream/llvm.git
6 years agoOpenBSD Ubsan support / interception
Kamil Rytarowski [Fri, 2 Mar 2018 07:32:30 +0000 (07:32 +0000)]
OpenBSD Ubsan support / interception

Summary: Interception, enabling OpenBSD platform

Patch by: David CARLIER

Reviewers: krytarowski, vitalybuka, visa

Reviewed By: vitalybuka

Subscribers: srhines, fedor.sergeev, llvm-commits, #sanitizers

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

llvm-svn: 326544

6 years agoOpenBSD UBsan support / ubsan part
Kamil Rytarowski [Fri, 2 Mar 2018 07:30:22 +0000 (07:30 +0000)]
OpenBSD UBsan support / ubsan part

Summary: UBsan, enable OpenBSD platform

Patch by: David CARLIER

Reviewers: krytarowski, kettenis, visa, vitalybuka

Reviewed By: vitalybuka

Subscribers: kubamracek, fedor.sergeev, llvm-commits, #sanitizers

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

llvm-svn: 326543

6 years ago[Frontend] Avoid including default system header paths on Fuchsia
Petr Hosek [Fri, 2 Mar 2018 07:19:42 +0000 (07:19 +0000)]
[Frontend] Avoid including default system header paths on Fuchsia

These paths aren't used and don't make sense on Fuchsia.

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

llvm-svn: 326542

6 years ago[WebAssembly] More uses of uint8_t for single byte values
Heejin Ahn [Fri, 2 Mar 2018 06:51:35 +0000 (06:51 +0000)]
[WebAssembly] More uses of uint8_t for single byte values

Summary: It looks like this was missing from D43921.

Reviewers: sbc100

Subscribers: jfb, dschuff, jgravelle-google, sunfish, llvm-commits

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

llvm-svn: 326541

6 years ago[ThinLTO] Added a couple of C LTO API interfaces to control the cache policy.
Ekaterina Romanova [Fri, 2 Mar 2018 03:51:27 +0000 (03:51 +0000)]
[ThinLTO] Added a couple of C LTO API interfaces to control the cache policy.
- thinlto_codegen_set_cache_size_bytes to control the absolute size of cache directory.
- thinlto_codegen_set_cache_size_files the size and amount of files in cache directory.
These functions have been supported in C++ LTO API for a long time, but were absent in C LTO API.

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

llvm-svn: 326537

6 years agoUpdate man page for long opts that accept = after r326506
Ed Maste [Fri, 2 Mar 2018 02:57:12 +0000 (02:57 +0000)]
Update man page for long opts that accept = after r326506

Also remove the space between --lto-O and value, as the option with a
space is not accepted at present.

Leave --opt-remarks-filename as it does not currently accept the = form.

llvm.org/pr36563

llvm-svn: 326536

6 years agoAMDGPU/GCN: Promote i16 ctpop
Jan Vesely [Fri, 2 Mar 2018 02:50:22 +0000 (02:50 +0000)]
AMDGPU/GCN: Promote i16 ctpop

i16 capable ASICs do not support i16 operands for this instruction.
Add tablegen pattern to merge chained i16 additions.

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

llvm-svn: 326535

6 years agoAMDGPU/GlobalISel: Define instruction mapping for G_FPTOSI
Matt Arsenault [Fri, 2 Mar 2018 02:19:16 +0000 (02:19 +0000)]
AMDGPU/GlobalISel: Define instruction mapping for G_FPTOSI

Patch by Tom Stellard

llvm-svn: 326534

6 years agoAMDGPU/GlobalISel: Define instruction mapping for G_FPTOUI
Matt Arsenault [Fri, 2 Mar 2018 02:19:11 +0000 (02:19 +0000)]
AMDGPU/GlobalISel: Define instruction mapping for G_FPTOUI

Patch by Tom Stellard

llvm-svn: 326533

6 years agoAMDGPU/GlobalISel: Define instruction mapping for G_FMUL
Matt Arsenault [Fri, 2 Mar 2018 02:17:01 +0000 (02:17 +0000)]
AMDGPU/GlobalISel: Define instruction mapping for G_FMUL

llvm-svn: 326532

6 years agoRemove debugging code I accidentally committed in r326530.
Akira Hatanaka [Fri, 2 Mar 2018 02:03:21 +0000 (02:03 +0000)]
Remove debugging code I accidentally committed in r326530.

llvm-svn: 326531

6 years agoAdd an option to disable tail-call optimization for escaping blocks.
Akira Hatanaka [Fri, 2 Mar 2018 01:53:15 +0000 (01:53 +0000)]
Add an option to disable tail-call optimization for escaping blocks.

This makes it easier to debug crashes and hangs in block functions since
users can easily find out where the block is called from. The option
doesn't disable tail-calls from non-escaping blocks since non-escaping
blocks are not as hard to debug as escaping blocks.

rdar://problem/35758207

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

llvm-svn: 326530

6 years ago[analyzer] [tests] Again, make tests more resilient to changes in exploration strategy
George Karpenkov [Fri, 2 Mar 2018 01:41:19 +0000 (01:41 +0000)]
[analyzer] [tests] Again, make tests more resilient to changes in exploration strategy

llvm-svn: 326529

6 years ago[InstCombine] Add more test case to fpextend.ll.
Craig Topper [Fri, 2 Mar 2018 01:34:42 +0000 (01:34 +0000)]
[InstCombine] Add more test case to fpextend.ll.

This includes the test cases from D43970 and additional tests for combining (fptrunc (binop (fpext), (fpext))) where the pre-extended types don't match the trunc and therefore can't be completely removed.

llvm-svn: 326528

6 years agoAlways set dso_local in CodeGenModule::setDSOLocal.
Rafael Espindola [Fri, 2 Mar 2018 01:29:51 +0000 (01:29 +0000)]
Always set dso_local in CodeGenModule::setDSOLocal.

This shouldn't change any results for now, but is more consistent with
how we set dllimport/dllexport and will make future changes easier.

Since clang produces IR as it parses, it can find out mid file that
something is dllimport. When that happens we have to drop
dso_local. This is not a problem right now because
CodeGenModule::setDSOLocal is called from relatively few places at
the moment.

llvm-svn: 326527

6 years agoAMDGPU/GlobalISel: Define instruction mapping for G_FADD
Matt Arsenault [Fri, 2 Mar 2018 01:22:13 +0000 (01:22 +0000)]
AMDGPU/GlobalISel: Define instruction mapping for G_FADD

Patch by Tom Stellard

llvm-svn: 326526

6 years agoAMDGPU/GlobalISel: Define instruction mapping for G_SHL
Matt Arsenault [Fri, 2 Mar 2018 01:22:10 +0000 (01:22 +0000)]
AMDGPU/GlobalISel: Define instruction mapping for G_SHL

Patch by Tom Stellard

llvm-svn: 326525

6 years agoAMDGPU/GlobalISel: Define instruction mapping for G_XOR
Matt Arsenault [Fri, 2 Mar 2018 01:22:06 +0000 (01:22 +0000)]
AMDGPU/GlobalISel: Define instruction mapping for G_XOR

llvm-svn: 326524

6 years agoAMDGPU/GlobalISel: Define instruction mapping for G_AND
Matt Arsenault [Fri, 2 Mar 2018 01:22:01 +0000 (01:22 +0000)]
AMDGPU/GlobalISel: Define instruction mapping for G_AND

Patch by Tom Stellard

llvm-svn: 326523

6 years ago[WebAssembly] Gather EH instructions in one place. NFC.
Heejin Ahn [Fri, 2 Mar 2018 01:03:40 +0000 (01:03 +0000)]
[WebAssembly] Gather EH instructions in one place. NFC.

Summary:
- Gather EH instructions in one place for easy tracking (more will be
  added later)
- Variable name change

Reviewers: dschuff

Subscribers: jfb, sbc100, jgravelle-google, sunfish, llvm-commits

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

llvm-svn: 326522

6 years ago[ArgumentPromotion] don't break musttail invariant PR36543
Fedor Indutny [Fri, 2 Mar 2018 00:59:27 +0000 (00:59 +0000)]
[ArgumentPromotion] don't break musttail invariant PR36543

Summary:
Do not break musttail invariant by promoting arguments of musttail
callee or caller.

Reviewers: sanjoy, dberlin, hfinkel, george.burgess.iv, fhahn, rnk

Reviewed By: rnk

Subscribers: rnk, llvm-commits

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

llvm-svn: 326521

6 years ago[analyzer] Prevent crashing in NonNullParamChecker
George Karpenkov [Fri, 2 Mar 2018 00:55:59 +0000 (00:55 +0000)]
[analyzer] Prevent crashing in NonNullParamChecker

https://bugs.llvm.org/show_bug.cgi?id=36381
rdar://37543426

Turns out, the type passed for the lambda capture was incorrect.
One more argument to abandon the getSVal overload which does not require the
type information.

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

llvm-svn: 326520

6 years ago[StaticAnalyzer] Fix some Clang-tidy modernize and Include What You Use warnings...
Eugene Zelenko [Fri, 2 Mar 2018 00:54:51 +0000 (00:54 +0000)]
[StaticAnalyzer] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

llvm-svn: 326519

6 years ago[analyzer] [NFC] [tests] Make test more resilient to changes in exploration strategy
George Karpenkov [Fri, 2 Mar 2018 00:54:05 +0000 (00:54 +0000)]
[analyzer] [NFC] [tests] Make test more resilient to changes in exploration strategy

llvm-svn: 326518

6 years ago[WebAssembly] Add exception handling option
Heejin Ahn [Fri, 2 Mar 2018 00:39:16 +0000 (00:39 +0000)]
[WebAssembly] Add exception handling option

Summary: Add exception handling option to clang.

Reviewers: dschuff

Subscribers: jfb, sbc100, jgravelle-google, sunfish, cfe-commits

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

llvm-svn: 326517

6 years agoUtility functions for checked arithmetic
George Karpenkov [Fri, 2 Mar 2018 00:30:43 +0000 (00:30 +0000)]
Utility functions for checked arithmetic

Provide checkedAdd and checkedMul functions, providing checked
arithmetic on signed integers.

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

llvm-svn: 326516

6 years ago[InstCombine] Simplify test cases by removing loads/stores that aren't required for...
Craig Topper [Fri, 2 Mar 2018 00:27:44 +0000 (00:27 +0000)]
[InstCombine] Simplify test cases by removing loads/stores that aren't required for what is being tested.

The loads and stores were getting the data and storing the results. There's no reason we can't just use function arguments and return.

llvm-svn: 326515

6 years agoSpeed up TestWatchpointMultipleThreads
Pavel Labath [Fri, 2 Mar 2018 00:17:05 +0000 (00:17 +0000)]
Speed up TestWatchpointMultipleThreads

Summary:
The inferior was sleeping before doing any interesting work. I remove that
to make the test faster.

While looking at the purpose of the test (to check that watchpoints are
propagated to all existing threads - r140757) I noticed that the test has
diverged from the original intention and now it creates the threads *after* the
watchpoint is set (this probably happened during the std::thread refactor).
After some discussion, we decided both scenarios make sense, so I modify the
test to test both.

The watchpoint propagation functionality is not really debug info depenent, so
I also stop replication of this test. This brings the test's time from ~108s
down to 4s.

Reviewers: davide, jingham

Subscribers: aprantl, lldb-commits

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

llvm-svn: 326514

6 years ago[InstCombine] allow fmul fold with less than 'fast'
Sanjay Patel [Fri, 2 Mar 2018 00:14:51 +0000 (00:14 +0000)]
[InstCombine] allow fmul fold with less than 'fast'

This is a retry of r326502 with updates to the reassociate
test file that I missed the first time.

@test15_reassoc in the supposed -reassociate test file
(except that it tests 2 other passes too...) shows that
there's no clear responsiblity for reassociation transforms.

Instcombine now gets that case, but only because the
constant values are identical. Otherwise, it would still
miss that pattern.

Reassociate doesn't get that case because it hasn't been
updated to use less than 'fast' FMF.

llvm-svn: 326513

6 years ago[NFC] Move CommentOpts checks to the call sites that depend on it. (Re-applying r326501.)
David L. Jones [Fri, 2 Mar 2018 00:07:45 +0000 (00:07 +0000)]
[NFC] Move CommentOpts checks to the call sites that depend on it. (Re-applying r326501.)

When parsing comments, for example, for -Wdocumentation, slightly different
behaviour occurs when -fparse-all-comments is specified. However, these
differences are subtle:

1. All comments are saved during parsing, regardless of whether they are doc
   comments or not.
2. "Maybe-doc" comments, like <, !, etc, are saved as such, instead of marking
   them as ordinary comments. The maybe-doc type of comment is never saved
   otherwise. (Warning on these is the impetus of -Wdocumentation.)
3. All comments are treated as doc comments in ASTContext, even if they are ordinary.

This change moves the logic for checking CommentOptions.ParseAllComments closer
to where it has an effect. The overall logic is unchanged, but checks of the
ParseAllComments flag are now done where the effect will be clearer.

Subscribers: cfe-commits
llvm-svn: 326512

6 years ago[Reassociate] regenerate checks; NFC
Sanjay Patel [Thu, 1 Mar 2018 23:41:03 +0000 (23:41 +0000)]
[Reassociate] regenerate checks; NFC

llvm-svn: 326511

6 years agorevert r326502: [InstCombine] allow fmul fold with less than 'fast'
Sanjay Patel [Thu, 1 Mar 2018 23:39:24 +0000 (23:39 +0000)]
revert r326502: [InstCombine] allow fmul fold with less than 'fast'

I forgot that I added tests for 'reassoc' to -reassociate, but
suprisingly that file calls -instcombine too, so it is affected.
I'll update that file and try again.

llvm-svn: 326510

6 years ago[WebAssembly] Simplify COMDAT handling.
Rui Ueyama [Thu, 1 Mar 2018 23:29:05 +0000 (23:29 +0000)]
[WebAssembly] Simplify COMDAT handling.

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

llvm-svn: 326509

6 years agoRevert r326501 due to buildbot breakage.
David L. Jones [Thu, 1 Mar 2018 23:14:00 +0000 (23:14 +0000)]
Revert r326501 due to buildbot breakage.

Original change:

[NFC] Move CommentOpts checks to the call sites that depend on it.

When parsing comments, for example, for -Wdocumentation, slightly different
behaviour occurs when -fparse-all-comments is specified. However, these
differences are subtle:

1. All comments are saved during parsing, regardless of whether they are doc comments or not.
2. "Maybe-doc" comments, like //<, //!, etc, are saved as such, instead of marking them as ordinary comments. The maybe-doc type of comment is never saved otherwise. (Warning on these is the impetus of -Wdocumentation.)
3. All comments are treated as doc comments in ASTContext, even if they are ordinary.

This change moves the logic for checking CommentOptions.ParseAllComments closer
to where it has an effect. The overall logic is unchanged, but checks of the
ParseAllComments flag are now done where the effect will be clearer.

llvm-svn: 326508

6 years agoReport an error if you try to link against .dll instead of .lib.
Rui Ueyama [Thu, 1 Mar 2018 23:11:30 +0000 (23:11 +0000)]
Report an error if you try to link against .dll instead of .lib.

It is a usage error to feed a .dll file instead of a .dll to COFF linker.
Previously, lld failed with a mysterious error message. Now we reject
it at the driver.

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

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

llvm-svn: 326507

6 years agoAccept both `--foo bar` and `--foo=bar` styles options.
Rui Ueyama [Thu, 1 Mar 2018 23:06:10 +0000 (23:06 +0000)]
Accept both `--foo bar` and `--foo=bar` styles options.

GNU linkers by convention supports both `--foo bar` and `--foo=bar` styles
for all long options that take arguments.

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

llvm-svn: 326506

6 years agobpf: introduce -mattr=dwarfris to disable DwarfUsesRelocationsAcrossSections
Yonghong Song [Thu, 1 Mar 2018 23:04:59 +0000 (23:04 +0000)]
bpf: introduce -mattr=dwarfris to disable DwarfUsesRelocationsAcrossSections

Commit e4507fb8c94b ("bpf: disable DwarfUsesRelocationsAcrossSections")
disables MCAsmInfo DwarfUsesRelocationsAcrossSections unconditionally
so that dwarf will not use cross section (between dwarf and symbol table)
relocations. This new debug format enables pahole to dump structures
correctly as libdwarves.so does not have BPF backend support yet.

This new debug format, however, breaks bcc (https://github.com/iovisor/bcc)
source debug output as llvm in-memory Dwarf support has some issues to
handle it. More specifically, with DwarfUsesRelocationsAcrossSections
disabled, JIT compiler does not generate .debug_abbrev and Dwarf
DIE (debug info entry) processing is not happy about this.

This patch introduces a new flag -mattr=dwarfris
(dwarf relocation in section) to disable DwarfUsesRelocationsAcrossSections.
DwarfUsesRelocationsAcrossSections is true by default.

Signed-off-by: Yonghong Song <yhs@fb.com>
llvm-svn: 326505

6 years agoRename a test file and fix indentation.
Rui Ueyama [Thu, 1 Mar 2018 23:01:41 +0000 (23:01 +0000)]
Rename a test file and fix indentation.

llvm-svn: 326504

6 years agoSet DF_TEXTREL to executables that need text relocations.
Rui Ueyama [Thu, 1 Mar 2018 22:56:52 +0000 (22:56 +0000)]
Set DF_TEXTREL to executables that need text relocations.

Summary:
If an executable needs text relocations, it should be marked as such so
that the loader can prepare for text relocations. We currently create a
dummy segment with DT_TEXTREL for that purpose.

Generic ABI as of 2000 [1] mentioned that "Its [DT_TEXTREL's] use
has been superseded by the DF_TEXTREL flag". However, it's actually not
superseded even after 18 years. OpenBSD and musl recognize only DT_TEXTREL.
So we still need to set both.

[1] http://www.sco.com/developers/gabi/2000-07-17/ch5.dynamic.html

Reviewers: rafael

Subscribers: emaste, llvm-commits, arichardson

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

llvm-svn: 326503

6 years ago[InstCombine] allow fmul fold with less than 'fast'
Sanjay Patel [Thu, 1 Mar 2018 22:53:47 +0000 (22:53 +0000)]
[InstCombine] allow fmul fold with less than 'fast'

llvm-svn: 326502

6 years ago[NFC] Move CommentOpts checks to the call sites that depend on it.
David L. Jones [Thu, 1 Mar 2018 22:41:53 +0000 (22:41 +0000)]
[NFC] Move CommentOpts checks to the call sites that depend on it.

When parsing comments, for example, for -Wdocumentation, slightly different
behaviour occurs when -fparse-all-comments is specified. However, these
differences are subtle:

 1. All comments are saved during parsing, regardless of whether they are doc
    comments or not.
 2. "Maybe-doc" comments, like //<, //!, etc, are saved as such, instead of
    marking them as ordinary comments. The maybe-doc type of comment is never
    saved otherwise. (Warning on these is the impetus of -Wdocumentation.)
 3. All comments are treated as doc comments in ASTContext, even if they are
    ordinary.

This change moves the logic for checking CommentOptions.ParseAllComments closer
to where it has an effect. The overall logic is unchanged, but checks of the
ParseAllComments flag are now done where the effect will be clearer.

Reviewers: rsmith

Subscribers: cfe-commits

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

llvm-svn: 326501

6 years ago[DAGCombiner] When combining zero_extend of a truncate, only mask before extending...
Craig Topper [Thu, 1 Mar 2018 22:32:25 +0000 (22:32 +0000)]
[DAGCombiner] When combining zero_extend of a truncate, only mask before extending for vectors.

Masking first, prevents the extend from being combine with loads. Its also interfering with some vXi1 extraction code.

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

llvm-svn: 326500

6 years ago[Driver] Pass -f[no-]emulated-tls and set up ExplicitEmulatedTLS
Chih-Hung Hsieh [Thu, 1 Mar 2018 22:26:19 +0000 (22:26 +0000)]
[Driver] Pass -f[no-]emulated-tls and set up ExplicitEmulatedTLS

Since LLVM r326341, default EmulatedTLS mode is decided in backend
according to target triple. Any front-end should pass -f[no]-emulated-tls
to backend and set up ExplicitEmulatedTLS only when the flags are used.

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

llvm-svn: 326499

6 years agoDon't ingoned --enable-new-dtags.
Rafael Espindola [Thu, 1 Mar 2018 22:23:51 +0000 (22:23 +0000)]
Don't ingoned --enable-new-dtags.

llvm-svn: 326498

6 years ago[X86][MMX] Improve handling of 64-bit MMX constants
Simon Pilgrim [Thu, 1 Mar 2018 22:22:31 +0000 (22:22 +0000)]
[X86][MMX] Improve handling of 64-bit MMX constants

64-bit MMX constant generation usually ends up lowering into SSE instructions before being spilled/reloaded as a MMX type.

This patch bitcasts the constant to a double value to allow correct loading directly to the MMX register.

I've added MMX constant asm comment support to improve testing, it's better to always print the double values as hex constants as MMX is mainly an integer unit (and even with 3DNow! its just floats).

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

llvm-svn: 326497

6 years ago[modules] Don't diagnose "redefinition" of a friend with a pending definition
Richard Smith [Thu, 1 Mar 2018 22:20:13 +0000 (22:20 +0000)]
[modules] Don't diagnose "redefinition" of a friend with a pending definition
if the other definition is a merged copy of the same function.

llvm-svn: 326496

6 years ago[SelectionDAG] Support some SimplifySetCC cases for comparing against vector splats...
Craig Topper [Thu, 1 Mar 2018 22:15:39 +0000 (22:15 +0000)]
[SelectionDAG] Support some SimplifySetCC cases for comparing against vector splats of constants.

This supports things like

(setcc ugt X, 0) -> (setcc ne X, 0)

I've restricted to only make changes to vectors before legalize ops because I doubt all targets have accurate condition code legality information for vectors given how little we did before.

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

llvm-svn: 326495

6 years ago[X86][AVX] Add v2f32 <-> v2i8/v2i16/v2i32 vector tests
Simon Pilgrim [Thu, 1 Mar 2018 22:05:40 +0000 (22:05 +0000)]
[X86][AVX] Add v2f32 <-> v2i8/v2i16/v2i32 vector tests

llvm-svn: 326494

6 years ago[www] Capitalize "Clang" when referring to the project, and generalize the
Richard Smith [Thu, 1 Mar 2018 22:01:06 +0000 (22:01 +0000)]
[www] Capitalize "Clang" when referring to the project, and generalize the
introduction on the front page page.

We still use the lowercase "clang" spelling when referring to the driver binary.

llvm-svn: 326493

6 years ago[Hexagon] Add trap1 instruction
Krzysztof Parzyszek [Thu, 1 Mar 2018 21:54:08 +0000 (21:54 +0000)]
[Hexagon] Add trap1 instruction

llvm-svn: 326492

6 years agoAdd an llc testcase analogous to test/LTO/X86/strip-debug-info.ll
Adrian Prantl [Thu, 1 Mar 2018 21:53:17 +0000 (21:53 +0000)]
Add an llc testcase analogous to test/LTO/X86/strip-debug-info.ll

rdar://problem/37963669

llvm-svn: 326491

6 years agoAMDGPU/GlobalISel: Define instruction mapping for @llvm.amdgcn.cvt.pkrtz
Matt Arsenault [Thu, 1 Mar 2018 21:25:30 +0000 (21:25 +0000)]
AMDGPU/GlobalISel: Define instruction mapping for @llvm.amdgcn.cvt.pkrtz

Patch by Tom Stellard

llvm-svn: 326490

6 years agoAMDGPU/GlobalISel: Define instruction mapping for G_OR
Matt Arsenault [Thu, 1 Mar 2018 21:25:25 +0000 (21:25 +0000)]
AMDGPU/GlobalISel: Define instruction mapping for G_OR

Patch by Tom Stellard

llvm-svn: 326489

6 years ago[X86][SSE] Regenerate float to/from i8/i16 vector tests
Simon Pilgrim [Thu, 1 Mar 2018 21:21:30 +0000 (21:21 +0000)]
[X86][SSE] Regenerate float to/from i8/i16 vector tests

llvm-svn: 326488

6 years agoAMDGPU/GlobalISel: Remove default register mapping
Matt Arsenault [Thu, 1 Mar 2018 21:20:44 +0000 (21:20 +0000)]
AMDGPU/GlobalISel: Remove default register mapping

This crashes for some opcodes, which prevents the SelectionDAG
fallback from working.

Patch by Tom Stellard

llvm-svn: 326487

6 years ago[AArch64] Clean up code (NFC)
Evandro Menezes [Thu, 1 Mar 2018 21:17:36 +0000 (21:17 +0000)]
[AArch64] Clean up code (NFC)

Clean up a couple of functions in `AArch64TargetLowering` by removing
redundant statements.

llvm-svn: 326486

6 years agoAdded P0805 to the list of ready bits
Marshall Clow [Thu, 1 Mar 2018 21:16:07 +0000 (21:16 +0000)]
Added P0805 to the list of ready bits

llvm-svn: 326485

6 years ago[X86][SSE] Regenerate odd sized sext/zext tests
Simon Pilgrim [Thu, 1 Mar 2018 21:13:26 +0000 (21:13 +0000)]
[X86][SSE] Regenerate odd sized sext/zext tests

llvm-svn: 326484

6 years agoAMDGPU/GlobalISel: Use a more correct getValueMapping
Matt Arsenault [Thu, 1 Mar 2018 21:08:51 +0000 (21:08 +0000)]
AMDGPU/GlobalISel: Use a more correct getValueMapping

This was finding the wrong size registers for anything with
more than 2 components.

Patch by Tom Stellard

llvm-svn: 326483

6 years agoAMDGPU/GlobalISel: Define instruction mapping for G_BITCAST
Matt Arsenault [Thu, 1 Mar 2018 20:59:44 +0000 (20:59 +0000)]
AMDGPU/GlobalISel: Define instruction mapping for G_BITCAST

Patch by Tom Stellard

llvm-svn: 326482

6 years agoAMDGPU/GlobalISel: Mark i32->i64 zext as legal
Matt Arsenault [Thu, 1 Mar 2018 20:56:21 +0000 (20:56 +0000)]
AMDGPU/GlobalISel: Mark i32->i64 zext as legal

llvm-svn: 326481

6 years ago[AArch64] Add support for secrel add/load/store relocations for COFF
Martin Storsjo [Thu, 1 Mar 2018 20:42:28 +0000 (20:42 +0000)]
[AArch64] Add support for secrel add/load/store relocations for COFF

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

llvm-svn: 326480

6 years agoAMDGPU/GlobalISel: InstrMapping for llvm.amdgcn.exp.compr
Matt Arsenault [Thu, 1 Mar 2018 20:40:55 +0000 (20:40 +0000)]
AMDGPU/GlobalISel: InstrMapping for llvm.amdgcn.exp.compr

Patch by Tom Stellard

llvm-svn: 326479

6 years ago[MinGW] Fix --{start,end}-group.
Rui Ueyama [Thu, 1 Mar 2018 20:38:38 +0000 (20:38 +0000)]
[MinGW] Fix --{start,end}-group.

Currently --start-group=foo is accidentally accepted by the MinGW driver.

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

llvm-svn: 326478

6 years agoAMDGPU/GlobalISel: Define instruction mapping for @llvm.amdgcn.exp
Matt Arsenault [Thu, 1 Mar 2018 20:24:37 +0000 (20:24 +0000)]
AMDGPU/GlobalISel: Define instruction mapping for @llvm.amdgcn.exp

Patch by Tom Stellard

llvm-svn: 326477

6 years ago[RecordLayout] Only assert that fundamental type sizes are power of two on MSVC
Martin Storsjo [Thu, 1 Mar 2018 20:22:57 +0000 (20:22 +0000)]
[RecordLayout] Only assert that fundamental type sizes are power of two on MSVC

Make types with sizes that aren't a power of two an error (that can
be disabled) in structs with ms_struct layout, except on mingw where
the situation is quite likely to occur and GCC handles it silently.

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

llvm-svn: 326476

6 years ago[SimplifyLibCalls] Update an obviously copy and pasted header comment to match this...
Craig Topper [Thu, 1 Mar 2018 20:05:09 +0000 (20:05 +0000)]
[SimplifyLibCalls] Update an obviously copy and pasted header comment to match this file. NFC

llvm-svn: 326475

6 years ago[InstCombine] Auto-generate complete checks. NFC
Craig Topper [Thu, 1 Mar 2018 20:05:07 +0000 (20:05 +0000)]
[InstCombine] Auto-generate complete checks. NFC

llvm-svn: 326474

6 years agoAMDGPU/GlobalISel: Define InstrMappings for G_ICMP
Matt Arsenault [Thu, 1 Mar 2018 19:27:10 +0000 (19:27 +0000)]
AMDGPU/GlobalISel: Define InstrMappings for G_ICMP

Patch by Tom Stellard

llvm-svn: 326472

6 years agoAMDGPU/GlobalISel: Make i32 mul legal
Matt Arsenault [Thu, 1 Mar 2018 19:22:05 +0000 (19:22 +0000)]
AMDGPU/GlobalISel: Make i32 mul legal

llvm-svn: 326471

6 years agoAMDGPU/GlobalISel: Define instruction mapping for G_IMPLICIT_DEF
Matt Arsenault [Thu, 1 Mar 2018 19:16:52 +0000 (19:16 +0000)]
AMDGPU/GlobalISel: Define instruction mapping for G_IMPLICIT_DEF

Patch by Tom Stellard

llvm-svn: 326470

6 years agoDriver: hoist `-fno-rtti-data` to a driver flag
Saleem Abdulrasool [Thu, 1 Mar 2018 19:13:43 +0000 (19:13 +0000)]
Driver: hoist `-fno-rtti-data` to a driver flag

This is needed for building with the GNU driver (`clang++`) when
targeting Windows and using msvcprt.  This flag is the equivalent of
`/GR-`.

llvm-svn: 326469

6 years agoAMDGPU/GlobalISel: Define instruction mapping for G_FCONSTANT
Matt Arsenault [Thu, 1 Mar 2018 19:13:30 +0000 (19:13 +0000)]
AMDGPU/GlobalISel: Define instruction mapping for G_FCONSTANT

Patch by Tom Stellard

llvm-svn: 326468

6 years agoAMDGPU/GlobalISel: Add copyCost for VGPR->SGPR copies
Matt Arsenault [Thu, 1 Mar 2018 19:09:25 +0000 (19:09 +0000)]
AMDGPU/GlobalISel: Add copyCost for VGPR->SGPR copies

Patch by Tom Stellard

llvm-svn: 326467

6 years agoAMDGPU/GlobalISel: Make i32 xor legal
Matt Arsenault [Thu, 1 Mar 2018 19:09:21 +0000 (19:09 +0000)]
AMDGPU/GlobalISel: Make i32 xor legal

llvm-svn: 326466

6 years agoAMDGPU/GlobalISel: Mark 32/64-bit G_FCMP as legal
Matt Arsenault [Thu, 1 Mar 2018 19:09:16 +0000 (19:09 +0000)]
AMDGPU/GlobalISel: Mark 32/64-bit G_FCMP as legal

Patch by Tom Stellard

llvm-svn: 326465

6 years agoAMDGPU/GlobalISel: Mark 32-bit G_FPTOSI as legal
Matt Arsenault [Thu, 1 Mar 2018 19:04:25 +0000 (19:04 +0000)]
AMDGPU/GlobalISel: Mark 32-bit G_FPTOSI as legal

Patch by Tom Stellard

llvm-svn: 326464

6 years agoCorrect man page description for --section-start
Ed Maste [Thu, 1 Mar 2018 19:02:41 +0000 (19:02 +0000)]
Correct man page description for --section-start

The argument is section=address, not just address.

(For compatibility with GNU linkers we need to, but do not yet, accept
--section-start=section=address.)

llvm-svn: 326463

6 years ago[analyzer] Enable cfg-temporary-dtors by default.
Artem Dergachev [Thu, 1 Mar 2018 18:53:13 +0000 (18:53 +0000)]
[analyzer] Enable cfg-temporary-dtors by default.

Don't enable c++-temp-dtor-inlining by default yet, due to this reference
counting pointe problem.

Otherwise the new mode seems stable and allows us to incrementally fix C++
problems in much less hacky ways.

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

llvm-svn: 326461

6 years ago[WebAssembly] Fix broken gcc build after rL326454
Sam Clegg [Thu, 1 Mar 2018 18:48:08 +0000 (18:48 +0000)]
[WebAssembly] Fix broken gcc build after rL326454

The gcc builders were broken by rL326454
See: https://reviews.llvm.org/D43921

llvm-svn: 326460

6 years agoWhere possible use --long-opt=value in lld man page
Ed Maste [Thu, 1 Mar 2018 18:40:11 +0000 (18:40 +0000)]
Where possible use --long-opt=value in lld man page

We intend to maintain compatibility with GNU ld, and in the GNU world
long options are conventionally specified as --long-option=value. For
whatever reason GNU ld.bfd accepts both --long-option value and
--long-option=value, but documents the former. Follow suit.

Some lld long options do not accept the = form; this is probably a bug
to be fixed (along with a man page update).

Reported by Ingo Schwarze, for --entry.

llvm-svn: 326459

6 years ago[clangd] Make symbol name a required parameter for CanonicalIncludes::mapHeader
Eric Liu [Thu, 1 Mar 2018 18:30:48 +0000 (18:30 +0000)]
[clangd] Make symbol name a required parameter for CanonicalIncludes::mapHeader

llvm-svn: 326458

6 years ago[NVPTX] use pattern matching to lower int_nvvm_match_all_sync*.
Artem Belevich [Thu, 1 Mar 2018 18:28:45 +0000 (18:28 +0000)]
[NVPTX] use pattern matching to lower int_nvvm_match_all_sync*.

Now that patterns can handle intrinsics returning multiple results,
use tablegen'ed pattern matching instead of custom lowering.

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

llvm-svn: 326457

6 years ago[clangd] Support include canonicalization in symbol leve.
Eric Liu [Thu, 1 Mar 2018 18:06:40 +0000 (18:06 +0000)]
[clangd] Support include canonicalization in symbol leve.

Summary:
Symbols with different canonical includes might be defined in the same header
(e.g. symbols defined in STL <iosfwd>). This patch adds support for mapping from
qualified symbol names to canonical headers and special mapping for symbols in <iosfwd>

Reviewers: sammccall, hokein

Reviewed By: sammccall

Subscribers: klimek, ilya-biryukov, jkorous-apple, cfe-commits

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

llvm-svn: 326456

6 years ago[WebAssembly] Use uint8_t for single byte values to match the spec
Sam Clegg [Thu, 1 Mar 2018 18:06:39 +0000 (18:06 +0000)]
[WebAssembly] Use uint8_t for single byte values to match the spec

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

llvm-svn: 326455

6 years ago[WebAssembly] Use uint8_t for single byte values to match the spec
Sam Clegg [Thu, 1 Mar 2018 18:06:21 +0000 (18:06 +0000)]
[WebAssembly] Use uint8_t for single byte values to match the spec

The original BinaryEncoding.md document used to specify that
these values were `varint7`, but the official spec lists them
explicitly as single byte values and not LEB.

A similar change for wabt is in flight:
 https://github.com/WebAssembly/wabt/pull/782

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

llvm-svn: 326454

6 years ago[PDB] Defer writing the build id until the rest of the PDB is written.
Zachary Turner [Thu, 1 Mar 2018 18:00:29 +0000 (18:00 +0000)]
[PDB] Defer writing the build id until the rest of the PDB is written.

For now this is NFC, but this small refactor opens the door to
letting us embed a hash of the PDB in the build id field of the
PDB.

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

llvm-svn: 326453

6 years ago[clangd] Forward all environment variables along with CLANGD_TRACE to clangd.
Eric Liu [Thu, 1 Mar 2018 17:42:27 +0000 (17:42 +0000)]
[clangd] Forward all environment variables along with CLANGD_TRACE to clangd.

llvm-svn: 326452

6 years ago[AMDGPU] : fix for the crash in SIRegisterInfo when the regiser class not found
Alexander Timofeev [Thu, 1 Mar 2018 17:36:43 +0000 (17:36 +0000)]
[AMDGPU] : fix for the crash in SIRegisterInfo when the regiser class not found

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

llvm-svn: 326451

6 years ago[Hexagon] Add guest registers
Krzysztof Parzyszek [Thu, 1 Mar 2018 17:03:26 +0000 (17:03 +0000)]
[Hexagon] Add guest registers

llvm-svn: 326450

6 years agoMake TestDynamicValueSameBase gcc-compatible
Pavel Labath [Thu, 1 Mar 2018 16:56:28 +0000 (16:56 +0000)]
Make TestDynamicValueSameBase gcc-compatible

gcc will say that the type of "this" is "T * const", clang "T *".
Compare the unqualified type names to erase the difference between the
two, as the constness is not a part of this test.

FWIW, I think that the gcc behavior makes more sense here.

llvm-svn: 326449

6 years ago[InstCombine] remove stale comments for tests; NFC
Sanjay Patel [Thu, 1 Mar 2018 16:28:32 +0000 (16:28 +0000)]
[InstCombine] remove stale comments for tests; NFC

llvm-svn: 326448

6 years ago[Power9] Add missing instructions to the Power 9 scheduler
Stefan Pintilie [Thu, 1 Mar 2018 16:16:08 +0000 (16:16 +0000)]
[Power9] Add missing instructions to the Power 9 scheduler

Adding more instructions using InstRW so that we can move away from ItinRW
and ultimately have a complete Power 9 scheduler.

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

llvm-svn: 326447

6 years agoCorrect markup and nits in ld.lld man page
Ed Maste [Thu, 1 Mar 2018 16:02:19 +0000 (16:02 +0000)]
Correct markup and nits in ld.lld man page

Patch by Ingo Schwarze

llvm-svn: 326446

6 years ago[WebAssembly] Update pre-generated test files to match latest llc output. NFC.
Nicholas Wilson [Thu, 1 Mar 2018 15:55:59 +0000 (15:55 +0000)]
[WebAssembly] Update pre-generated test files to match latest llc output. NFC.

The ordering of llc's output was changed in rL326334.

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

llvm-svn: 326445

6 years ago[InstCombine] simplify code for (X*Y) * X => (X*X) * Y ; NFCI
Sanjay Patel [Thu, 1 Mar 2018 15:50:26 +0000 (15:50 +0000)]
[InstCombine] simplify code for (X*Y) * X => (X*X) * Y ; NFCI

llvm-svn: 326444

6 years ago[AArch64] generate vuzp instead of mov
Sebastian Pop [Thu, 1 Mar 2018 15:47:39 +0000 (15:47 +0000)]
[AArch64] generate vuzp instead of mov

when a BUILD_VECTOR is created out of a sequence of EXTRACT_VECTOR_ELT with a
specific pattern sequence, either <0, 2, 4, ...> or <1, 3, 5, ...>, replace the
BUILD_VECTOR with either vuzp1 or vuzp2.

With this patch LLVM generates the following code for the first function fun1 in the testcase:
adrp x8, .LCPI0_0
ldr  q0, [x8, :lo12:.LCPI0_0]
tbl  v0.16b, { v0.16b }, v0.16b
ext  v1.16b, v0.16b, v0.16b, #8
uzp1 v0.8b, v0.8b, v1.8b
str  d0, [x8]
ret

Without this patch LLVM currently generates this code:
adrp    x8, .LCPI0_0
ldr     q0, [x8, :lo12:.LCPI0_0]
tbl     v0.16b, { v0.16b }, v0.16b
mov     v1.16b, v0.16b
mov     v1.b[1], v0.b[2]
mov     v1.b[2], v0.b[4]
mov     v1.b[3], v0.b[6]
mov     v1.b[4], v0.b[8]
mov     v1.b[5], v0.b[10]
mov     v1.b[6], v0.b[12]
mov     v1.b[7], v0.b[14]
str     d1, [x8]
ret

llvm-svn: 326443

6 years ago[InstCombine] move/add tests for fmul reassociation; NFC
Sanjay Patel [Thu, 1 Mar 2018 15:30:44 +0000 (15:30 +0000)]
[InstCombine] move/add tests for fmul reassociation; NFC

This transform may be out-of-scope for instcombine,
but this is only documenting the current behavior.

llvm-svn: 326442

6 years agoDon't allocate a header bellow address 0.
Rafael Espindola [Thu, 1 Mar 2018 15:25:46 +0000 (15:25 +0000)]
Don't allocate a header bellow address 0.

With the current code if the script has a PHDRS we always obey and try
to allocate a header. This can cause Min - HeaderSize to underflow.

It looks like bfd actually prints an error for this case. With this
patch we do the same.

Found while looking at pr36515.

llvm-svn: 326441

6 years ago[InstCombine] auto-generate full checks; NFC
Sanjay Patel [Thu, 1 Mar 2018 15:13:42 +0000 (15:13 +0000)]
[InstCombine] auto-generate full checks; NFC

llvm-svn: 326440