Commit Graph

271553 Commits

Author SHA1 Message Date
Hiroshi Yamauchi a43913cfaf Add options to dump PGO counts in text.
Summary:
Added text options to -pgo-view-counts and -pgo-view-raw-counts that dump block frequency and branch probability info in text.

This is useful when the graph is very large and complex (the dot command crashes, lines/edges too close to tell apart, hard to navigate without textual search) or simply when text is preferred.

Reviewers: davidxl

Reviewed By: davidxl

Subscribers: llvm-commits

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

llvm-svn: 313159
2017-09-13 17:20:38 +00:00
Teresa Johnson cbdc5ff628 [ThinLTO] AliasSummary should not have any references
Summary: References should only be on the aliasee.

Reviewers: pcc

Subscribers: llvm-commits, inglorion

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

llvm-svn: 313158
2017-09-13 17:10:24 +00:00
Peter Collingbourne d067c8ed59 ThinLTO: Correctly follow aliasee references when dead stripping.
We were previously handling aliases during dead stripping by adding
the aliased global's "original name" GUID to the worklist. This will
lead to incorrect behaviour if the global has local linkage because
the original name GUID will not correspond to the global's GUID in
the summary.

Because an alias is just another name for the global that it
references, there is no need to mark the referenced global as used,
or to follow references from any other copies of the global. So all
we need to do is to follow references from the aliasee's summary
instead of the alias.

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

llvm-svn: 313157
2017-09-13 17:09:20 +00:00
Alexander Kornienko 9707aa74d6 Update users of llvm::sys::ExecuteAndWait etc.
Summary: Clang part of https://reviews.llvm.org/D37563

Reviewers: bkramer

Subscribers: vsk, cfe-commits

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

llvm-svn: 313156
2017-09-13 17:03:58 +00:00
Alexander Kornienko 208eecd57f Convenience/safety fix for llvm::sys::Execute(And|No)Wait
Summary:
Change the type of the Redirects parameter of llvm::sys::ExecuteAndWait,
ExecuteNoWait and other APIs that wrap them from `const StringRef **` to
`ArrayRef<Optional<StringRef>>`, which is safer and simplifies the use of these
APIs (no more local StringRef variables just to get a pointer to).

Corresponding clang changes will be posted as a separate patch.

Reviewers: bkramer

Reviewed By: bkramer

Subscribers: vsk, llvm-commits

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

llvm-svn: 313155
2017-09-13 17:03:37 +00:00
Rafael Espindola f6c74c472d Remove CopyRelSecOff from SharedSymbol.
This reduces the size of SharedSymbol which in turn reduces the size
of Symbol from 88 to 80 bytes.

llvm-svn: 313154
2017-09-13 16:59:12 +00:00
Teresa Johnson b1bb468aa9 Fix bot failures by requiring x86 target in new test
The test added in r313151 requires a target triple since it is
running through code generation. Fix bot failures by requiring
an x86 target.

llvm-svn: 313153
2017-09-13 15:35:35 +00:00
Sjoerd Meijer c05609ca36 This adds the _Float16 preprocessor macro definitions.
Differential Revision: https://reviews.llvm.org/D34695

llvm-svn: 313152
2017-09-13 15:23:19 +00:00
Teresa Johnson 1958083d35 [ThinLTO] For SamplePGO, need to handle ICP targets consistently in thin link
Summary:
SamplePGO indirect call profiles record the target as the original GUID
for statics. The importer had special handling to map to the normal GUID
in that case. The dead global analysis needs the same treatment or
inconsistencies arise, resulting in linker unsats due to some dead
symbols being exported and kept, leaving in references to other dead
symbols that are removed.

This can happen when a SamplePGO profile collected by one binary is used
for a different binary, so the indirect call profiles may not accurately
reflect live targets.

Reviewers: danielcdh

Subscribers: mehdi_amini, inglorion, llvm-commits, eraman

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

llvm-svn: 313151
2017-09-13 15:16:38 +00:00
Alexander Kornienko e5590927d6 [clang-tidy] fixed misc-unused-parameters omitting parameters default value
Summary:
Bug: https://bugs.llvm.org/show_bug.cgi?id=34450

**Problem:**

Clang-tidy check misc-unused-parameters omits parameter default value what results in its complete removal. Compilation errors might occur after clang-tidy fix.

**Patch description:**

Changed removal range. The range should end after parameter declarator, not after whole parameter declaration (which might contain a default value).

Reviewers: alexfh, xazax.hun

Reviewed By: alexfh

Subscribers: JDevlieghere, cfe-commits

Tags: #clang-tools-extra

Patch by Pawel Maciocha!

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

llvm-svn: 313150
2017-09-13 14:55:13 +00:00
Petar Jovanovic 50e068158b [mips] correct operand range for DINSM instruction
This patch corrects the definition of the DINSM instruction.
Specification for DINSM instruction for Mips64 says that size operand should
be 2 <= size <= 64, but it is defined as uimm5_inssize_plus1 which gives
range of 1 .. 32.

Patch by Aleksandar Beserminji.

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

llvm-svn: 313149
2017-09-13 14:09:13 +00:00
Mikael Holmen 4eb2a96e7f [MachineScheduler] Put SchedRegion in an anonymous namespace.
Summary: It pollutes the global namespace otherwise.

Patch by: Bevin Hansson

Reviewers: jonpa

Reviewed By: jonpa

Subscribers: MatzeB, javed.absar, llvm-commits

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

llvm-svn: 313148
2017-09-13 14:07:47 +00:00
Stefan Pintilie dff606ec3e [Power9] Add missing instructions: extswsli, popcntb
Added the following P9 instructions: extswsli, extswsli., popcntb

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

llvm-svn: 313147
2017-09-13 14:05:27 +00:00
Francis Ricci 1bae0ac4c2 [llvm-objdump] Fix memory leaks in macho dump
Summary: Detected by LeakSanitizer for Darwin

Reviewers: enderby, rafael

Subscribers: llvm-commits

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

llvm-svn: 313146
2017-09-13 13:57:45 +00:00
Jonas Devlieghere 81f5abe1ad [MachO] Prevent heap overflow when load command extends past EOF
This patch fixes a heap-buffer-overflow when a malformed Mach-O has a
load command who's size extends past the end of the binary.

Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3225

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

llvm-svn: 313145
2017-09-13 13:43:01 +00:00
Gadi Haber 35f4d7ca46 [X86][Skylake] Replacing -mcpu=skx by -mattr in a codegen test. NFC.
NFC.
Replacing -mcpu=skx by -mattr in the run command of the codegen test: avx512-gather-scatter-intrin.ll.

Reviewers: delena
Revision: https://reviews.llvm.org/D37799
llvm-svn: 313144
2017-09-13 12:39:18 +00:00
Simon Pilgrim f613a45bf3 [X86][FMA4] Test FMA4 commutation with repeated ops as well as FMA3
llvm-svn: 313143
2017-09-13 11:21:38 +00:00
Simon Pilgrim 322fc53725 [X86][FMA] Added *213 fma instructions to scheduling tests
Annoyingly the 132/231 variants are pretty tricky to create when you need to due to weak FMA commutation patterns.

llvm-svn: 313142
2017-09-13 11:12:56 +00:00
Alexey Bataev ed94bd9223 [OPENMP] Allow all classes as mappable types.
According to upcoming OpenMP 5.0 all classes/structs are now considered
as mappable, even polymorphic and with static members.

llvm-svn: 313141
2017-09-13 11:12:35 +00:00
Javed Absar 67b042c207 [MiSched|TableGen] : Tidy up and modernise. NFC.
Replacing with range-based loop and substituting 'using'.

Reviewed by: @MatzeB
Differential Revision: https://reviews.llvm.org/D37748

llvm-svn: 313140
2017-09-13 10:31:10 +00:00
Jonas Devlieghere 27476ce24b [dwarfdump] Rename Brief to Verbose in DIDumpOptions
This patches renames "brief" to "verbose" in de DIDumpOptions and
inverts the logic to match the new behavior where brief is the default.
Changing the default value uncovered some bugs related to the
DIDumpOptions not being propagated and have been fixed as well.

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

llvm-svn: 313139
2017-09-13 09:43:05 +00:00
Gadi Haber a753080d1e [X86][Skylake][KNL] Updating code gen regression test to use the KNL and SKYLAKE prefixes. NFC.
NFC.
Updating the code gen regression test bmi2-schedule.ll to use the KNL and SKYLAKE prefixes for the run commands that use the knl and Skylake mcpu options.
The fix is in preparation for a large patch of adding all SKL scheduling information.

Reviewers: delena, zvi, RKSimon
Revision: https://reviews.llvm.org/D37796
llvm-svn: 313138
2017-09-13 09:28:25 +00:00
Gadi Haber 04de4ce9e2 [X86][Skylake][KNL] Updating code gen regression test to use the KNL and SKYLAKE prefixes. NFC.
NFC.
Updating the code gen regression test bmi2-schedule.ll to use the KNL and SKYLAKE prefixes for the run commands that use the knl and Skylake mcpu options.
The fix is in preparation for a large patch of adding all SKL scheduling information.

Reviewers: delena, zvi
Revision: https://reviews.llvm.org/D37796
llvm-svn: 313137
2017-09-13 09:28:18 +00:00
Gadi Haber fb47ab7cdd NFC.
Updating codegen test bmi2-schedule.ll to use the SKYLAKE and KNL prefix as preparatipn for an upcoming patch to add all SKL scheduling information.

llvm-svn: 313136
2017-09-13 09:27:39 +00:00
Igor Breger 5c721199dd [GlobalISel][X86] support G_FPEXT operation.
Summary: Support G_FPEXT operation. Selection done via TableGen'erated code.

Reviewers: zvi, guyblank, aymanmus, m_zuckerman

Reviewed By: zvi

Subscribers: rovka, kristof.beyls, llvm-commits

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

llvm-svn: 313135
2017-09-13 09:05:23 +00:00
Uriel Korach 5d5da5f531 [X86] [PATCH] [intrinsics] Lowering X86 ABS intrinsics to IR. (llvm)
This patch, together with a matching clang patch (https://reviews.llvm.org/D37694), implements the lowering of X86 ABS intrinsics to IR.

differential revision: https://reviews.llvm.org/D37693.

llvm-svn: 313134
2017-09-13 09:02:36 +00:00
Uriel Korach 3fba3c3b0c [X86] [PATCH] [intrinsics] Lowering X86 ABS intrinsics to IR. (clang)
This patch, together with a matching llvm patch (https://reviews.llvm.org/D37693), implements the lowering of X86 ABS intrinsics to IR.

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

llvm-svn: 313133
2017-09-13 09:02:02 +00:00
Mohammed Agabaria e9aebf26af [X86] Adding X86 Processor Families
Adding x86 Processor families to initialize several uArch properties (based on the family)
This patch shows how gather cost can be initialized based on the proc. family

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

llvm-svn: 313132
2017-09-13 09:00:27 +00:00
Uriel Korach 53872a2d89 [X86] Add explicit mc-encoding checks to X86/viabs.ll. NFC.
Add explicit mc-encoding checks showing that the AVX512VL ABS intrinsics are actually mapped to EVEX encoding.
This is a pre-commit for a soon to come patch which will lower x86 target specific ABS intrinsics to IR.

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

llvm-svn: 313131
2017-09-13 08:33:55 +00:00
Vitaly Buka c40f5ceca0 [compiler-rt] Compile signal specific functions only for !SANITIZER_GO
llvm-svn: 313130
2017-09-13 08:10:16 +00:00
NAKAMURA Takumi 34fc973b08 lldMinGW itself doesn't require libpthread.
llvm-svn: 313129
2017-09-13 07:59:07 +00:00
NAKAMURA Takumi 43965b0123 clang/lib/Driver/ToolChains/Darwin.h: Add proper style to comments. [-Wdocumentation]
llvm-svn: 313128
2017-09-13 07:58:46 +00:00
George Rimar cb888a620d [ELF] - Refactor of Writer<ELFT>::forEachRelSec.
There is no need to scan over all input sections for relocatable output.
As we do not process or scan relocations anyways.
Patch moves check for Config->Relocatable out to avoid that and also removes
excessive check for isa<EhInputSection> from first for loop. 
It is excessive because we handle all of them in a second for loop below.
That all allowed to simplify code.

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

llvm-svn: 313127
2017-09-13 07:54:47 +00:00
Craig Topper 2b6bfda561 [X86] Make sure we emit a SUBREG_TO_REG after the MOV32ri when creating a BEXTR64rr instruction from a shift/and pair.
Fixes PR34589.

llvm-svn: 313126
2017-09-13 07:53:21 +00:00
Martin Storsjo 064b0fac93 [MinGW] Support creating DLLs with a def file
Differential Revision: https://reviews.llvm.org/D37761

llvm-svn: 313125
2017-09-13 07:28:13 +00:00
Martin Storsjo 32e1626a2e [MinGW] Add support for the options --[no-]whole-archive
Differential Revision: https://reviews.llvm.org/D37769

llvm-svn: 313124
2017-09-13 07:28:09 +00:00
Martin Storsjo 8278ba51d3 [COFF] Add support for the -wholearchive option
This fixes PR31824.

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

llvm-svn: 313123
2017-09-13 07:28:03 +00:00
Martin Storsjo fb8eb6fce8 Use CMAKE_AR instead of the system default 'ar' for merging static libraries
Using the system default 'ar' might not be the right choice when
cross compiling.

Don't prepend the ar options by a dash, not all ar implementations
support that (llvm-ar doesn't).

Also pass the 's' option when creating the merged library, to create
an index.

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

llvm-svn: 313122
2017-09-13 06:55:44 +00:00
Elena Demikhovsky 6cab129464 [X86 CodeGen] Optimization of ZeroExtendLoad for v2i8 vector
Load with zero-extend and sign-extend from v2i8 to v2i32 is "Legal" since SSE4.1 and may be performed using PMOVZXBD , PMOVSXBD instructions.

llvm-svn: 313121
2017-09-13 06:40:26 +00:00
Vitaly Buka 6570c1d8b8 [compiler-rt] Add test for not fully implemented dump_registers
Reviewers: eugenis, alekseyshl

Subscribers: kubamracek, dberris, llvm-commits

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

llvm-svn: 313120
2017-09-13 06:33:43 +00:00
Ayal Zaks e2a8c0758f [LV] Fix PR34523 - avoid generating redundant selects
When converting a PHI into a series of 'select' instructions to combine the
incoming values together according their edge masks, initialize the first
value to the incoming value In0 of the first predecessor, instead of
generating a redundant assignment 'select(Cond[0], In0, In0)'. The latter
fails when the Cond[0] mask is null, representing a full mask, which can
happen only when there's a single incoming value.

No functional changes intended nor expected other than surviving null Cond[0]'s.

This fix follows D35725, which introduced using null to represent full masks.

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

llvm-svn: 313119
2017-09-13 06:28:37 +00:00
Vitaly Buka 20562abc1c Fix line breaks.
llvm-svn: 313118
2017-09-13 06:25:09 +00:00
Vitaly Buka ecc44ecdbc [compiler-rt] Move dump_instruction_bytes and dump_registers into sanitizer_common
Summary: Part of https://github.com/google/sanitizers/issues/637

Reviewers: eugenis, alekseyshl

Subscribers: kubamracek, llvm-commits, dberris

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

llvm-svn: 313117
2017-09-13 06:24:59 +00:00
Aditya Kumar dfa8741c96 [GVNHoist] Factor out reachability to search for anticipable instructions quickly
Factor out the reachability such that multiple queries to find reachability of values are fast. This is based on finding
the ANTIC points
in the CFG which do not change during hoisting. The ANTIC points are basically the dominance-frontiers in the inverse
graph. So we introduce a data structure (CHI nodes)
to keep track of values flowing out of a basic block. We only do this for values with multiple occurrences in the
function as they are the potential hoistable candidates.

This patch allows us to hoist instructions to a basic block with >2 successors, as well as deal with infinite loops in a
trivial way.
Relevant test cases are added to show the functionality as well as regression fixes from PR32821.

Regression from previous GVNHoist:
We do not hoist fully redundant expressions because fully redundant expressions are already handled by NewGVN

Differential Revision: https://reviews.llvm.org/D35918
Reviewers: dberlin, sebpop, gberry,

llvm-svn: 313116
2017-09-13 05:28:03 +00:00
Vitaly Buka d9d2a89e50 [compiler-rt] Move *Sanitizer:DEADLYSIGNAL printing into common part
Summary: Part of https://github.com/google/sanitizers/issues/637

Reviewers: eugenis, alekseyshl

Subscribers: kubamracek, llvm-commits, dberris

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

llvm-svn: 313115
2017-09-13 04:46:37 +00:00
Petr Hosek c113577d15 [llvm-objcopy] Add e_machine validity check for reserved section indexes
As discussed on llvm-commits it was decided it would be best to check
e_machine before declaring that a reserved section index is valid. The
only special e_machine value that matters here is EM_HEXAGON. This
change adds a special check for EM_HEXAGON.

Patch by Jake Ehrlich

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

llvm-svn: 313114
2017-09-13 03:04:50 +00:00
Eugene Zemtsov a2aa64760d Fix test_attach_to_process_from_different_dir_by_id test on Windows
On Windows a process can't delete its own current direcotry, that's why the test
needs to return to the original direcotry before removing newdir.

llvm-svn: 313113
2017-09-13 02:44:24 +00:00
Craig Topper 0a3bcebcc2 [X86] Use isUInt<32> to simplify some code. NFC
llvm-svn: 313112
2017-09-13 02:29:59 +00:00
Saleem Abdulrasool 50bc565f3f libclang: expose `clang_getCursorTLSKind`
Introduce the 'TLS Kind' property of variable declarations through
libclang. Additionally, provide a Python accessor for it, and test that
functionality.

Patch by Masud Rahman!

llvm-svn: 313111
2017-09-13 02:15:09 +00:00
Reid Kleckner feda6a0496 Fix dwarfdump cmdline test on Windows
llvm-svn: 313110
2017-09-13 01:50:27 +00:00