Commit Graph

216359 Commits

Author SHA1 Message Date
Dan Gohman 7054ac1b8b [WebAssembly] Model the return value of store instructions in wasm.
llvm-svn: 253916
2015-11-23 21:16:35 +00:00
Chad Rosier a15b4b6af2 [LIR] Put includes in correct order. NFC.
llvm-svn: 253915
2015-11-23 21:09:13 +00:00
Chad Rosier c6bb4241fd Fix a warning about commas at the end of enumerator lists.
llvm-svn: 253914
2015-11-23 21:05:04 +00:00
Xinliang David Li 6f7c19a494 [PGO] Add --text option for llvm-profdata show|merge commands
The new option is similar to the SampleProfile dump option.

- dump raw/indexed format into text profile format
- merge the profile and output into text profile format.

Note that Value Profiling data text format is not yet designed. 
That functionality will be added later.

Differential Revision: http://reviews.llvm.org/D14894

llvm-svn: 253913
2015-11-23 20:47:38 +00:00
Diego Novillo 243ea6a7d6 SamplePGO - Add coverage tracking for samples.
The existing coverage tracker counts the number of records that were used
from the input profile. An alternative view of coverage is to check how
many available samples were applied.

This way, if the profile contains several records with few samples, it
doesn't really matter much that they were not applied. The more
interesting records to apply are the ones that contribute many samples.

llvm-svn: 253912
2015-11-23 20:12:21 +00:00
Xinliang David Li 39f4c2ca3b [PGO] sync up target instrument decl between runtime and llvm (NFC)
llvm-svn: 253911
2015-11-23 20:07:09 +00:00
Tobias Grosser 4745eb1aca Update format to match clang-format in trunk
llvm-svn: 253910
2015-11-23 20:04:04 +00:00
Ehsan Akhgari 93697fa755 Make clang_Cursor_getMangling not mangle if the declaration isn't mangled
Right now clang_Cursor_getMangling will attempt to mangle any
declaration, even if the declaration isn't mangled (extern C).  This
results in a partially mangled name which isn't useful for much. This
patch makes clang_Cursor_getMangling return an empty string if the
declaration isn't mangled.

Patch by Michael Wu <mwu@mozilla.com>.

llvm-svn: 253909
2015-11-23 19:56:46 +00:00
Andrew Kaylor 0615a0e65d [WinEH] Fix a case where GVN could incorrectly PRE a load into an EH pad.
Differential Revision: http://reviews.llvm.org/D14842

llvm-svn: 253908
2015-11-23 19:51:41 +00:00
Xinliang David Li d200b27f08 [PGO] Unify section name, section symbol definitions (Darwin)
Replace hard-coded references to names to key section and section
 symbols with common macro definitions.

llvm-svn: 253907
2015-11-23 19:48:25 +00:00
Oleksiy Vyalov afd6ce4d29 Prevent ProcessGDBRemote from launching local debug server in case of remote debug server connection failure.
http://reviews.llvm.org/D14895

llvm-svn: 253906
2015-11-23 19:32:24 +00:00
Dan Gohman aa0a4bd05b [WebAssembly] Don't use set_local instructions explicitly.
The current approach to using get_local and set_local is to use them
implicitly, as register uses and defs. Introduce new copy instructions
which are themselves no-ops except for the get_local and set_local
that they imply, so that we use get_local and set_local consistently.

llvm-svn: 253905
2015-11-23 19:30:43 +00:00
Yaron Keren 941ad90146 Replace loop with std::any_of, NFC.
Inspired by similar commits from Craig Topper.

llvm-svn: 253904
2015-11-23 19:28:42 +00:00
Teresa Johnson 6b92316811 [ThinLTO] Deduplicate function index loading into shared helper (NFC)
Add a shared helper routine to read the function index from a file
and create/return the function index object. Use it in llvm-link and
llvm-lto.

llvm-svn: 253903
2015-11-23 19:19:11 +00:00
Andrew Kaylor d0430e8580 [WinEH] Fix problem where CodeGenPrepare incorrectly sinks a bitcast into an EH pad.
Differential Revision: http://reviews.llvm.org/D14842

llvm-svn: 253902
2015-11-23 19:16:15 +00:00
Dan Gohman f6857223c9 [WebAssembly] Always print loop end labels
WebAssembly is currently using labels to end scopes, so for example a
loop scope looks like this:

BB0_0:
  loop BB0_1
  ...
BB0_1:

with BB0_0 being the label of the first block not in the loop. This
requires that the label be printed even when it's only reachable via
fallthrough. To arrange this, insert a no-op LOOP_END instruction in
such cases at the end of the loop.

llvm-svn: 253901
2015-11-23 19:12:37 +00:00
Daniel Jasper 8e8b4fb678 clang-format: Re-add code path deleted in r253873 and add missing test.
llvm-svn: 253900
2015-11-23 19:11:45 +00:00
Martell Malone a96925322b Fix alignment of r253898
llvm-svn: 253899
2015-11-23 19:05:19 +00:00
Martell Malone f6301faa8b Driver: fallback to the location of clang if no sysroot,
hard coding /usr makes little sense for mingw-w64.
If we have portable toolchains having /usr breaks that.
If the clang we use is in /usr/bin or /usr/sbin etc this will
still detect as though it was hard coded to /usr

This makes the most sense going forward for mingw-w64 toolchains
on both linux and mac

Differential Revision: http://reviews.llvm.org/D14164

llvm-svn: 253898
2015-11-23 18:59:48 +00:00
Xinliang David Li 7c7f120178 [PGO] Unify section name, section symbol definitions (Linux)
Replace hard-coded references to names to key section and section
 symbols with common macro definitions.

llvm-svn: 253897
2015-11-23 18:56:03 +00:00
Xinliang David Li 6376db52fe [PGO] Unify raw profile header definition
Replace duplicate definition raw header with
 common definition in InstrProfData.inc.

llvm-svn: 253896
2015-11-23 18:36:40 +00:00
Xinliang David Li 66c32f0183 [PGO] Use the alignment macro newly introduced (NFC)
llvm-svn: 253895
2015-11-23 18:09:18 +00:00
Xinliang David Li ac604eeff1 Sync up template file with master (NFC)
llvm-svn: 253894
2015-11-23 18:03:25 +00:00
Xinliang David Li c7c1f8581a [PGO] Introduce alignment macro for instr-prof control data(NFC)
llvm-svn: 253893
2015-11-23 18:02:59 +00:00
Dan Gohman e425c32224 [WebAssembly] Remove incomplete MCCodeEmitter bits.
These are parts of a separate patch that I accidentally included in r253878.

llvm-svn: 253892
2015-11-23 18:00:04 +00:00
Xinliang David Li a1bebf2987 [PGO] Unify per-function control data definition
Replace duplicate definition per-func profile control data
 with common definition in InstrProfData.inc.

llvm-svn: 253891
2015-11-23 17:50:53 +00:00
Xinliang David Li 5c7fa27b00 [PGO] Use common definition of value profile kind
Replace duplicate definition value profile kind definitions
 with common definition in InstrProfData.inc.

llvm-svn: 253890
2015-11-23 17:43:10 +00:00
Teresa Johnson ac99e28a6b Remove unused function parameter (NFC)
llvm-svn: 253889
2015-11-23 17:42:49 +00:00
Paul Robinson af19bc3a9c Add Windows error code and tidy formatting for system errors.
Differential Revision: http://reviews.llvm.org/D14892

llvm-svn: 253888
2015-11-23 17:34:20 +00:00
Sumanth Gundapaneni c61c08e618 Make tbm-builtins.c as X86 specific unit test
Differential Revision: http://reviews.llvm.org/D14887

llvm-svn: 253887
2015-11-23 17:33:49 +00:00
Xinliang David Li 4dff875259 Disable frame pointer elimination when using -pg
(Re-apply patch after bug fixing)

This diff makes sure that the driver does not pass
-fomit-frame-pointer or -momit-leaf-frame-pointer to
the frontend when -pg is used. Currently, clang gives 
an error if -fomit-frame-pointer is used in combination 
with -pg, but -momit-leaf-frame-pointer was forgotten.
Also, disable frame pointer elimination in the frontend 
when -pg is set.

Patch by Stefan Kempf.

llvm-svn: 253886
2015-11-23 17:30:31 +00:00
Xinliang David Li e95d7fac58 [PGO] Use common definition of raw magic and version
- Replace duplicate definition and use of magic in profile runtime
- Replace hard coded version reference in profile runtime

llvm-svn: 253885
2015-11-23 17:26:53 +00:00
Igor Kudrin ee252ded15 [ELF/AArch64] Factor out overflow checks into a separate function. NFC.
Differential revision: http://reviews.llvm.org/D14922

llvm-svn: 253884
2015-11-23 17:16:09 +00:00
Xinliang David Li 0ca5bd4a46 [PGO] Start use InstrProf template file in compiler-rt/lib/profile
- Replace use of __llvm_profile_value_data with common data structure.
- Remve duplicate InstrProfValueNode

llvm-svn: 253883
2015-11-23 17:09:40 +00:00
Aaron Ballman 6290fc9154 Add an AST matcher for narrowing when a type is volatile-qualified.
llvm-svn: 253882
2015-11-23 17:09:24 +00:00
Xinliang David Li 19c1922c04 Sync up InstrProfData.inc with master
llvm-svn: 253881
2015-11-23 17:06:44 +00:00
Xinliang David Li f3faad95af Fix comment not allowed in C90
llvm-svn: 253880
2015-11-23 17:05:45 +00:00
Igor Kudrin bf08749b29 [ELF/AArch64] Fix overflow checks for R_AARCH64_PREL16 and _PREL32 relocations.
llvm-svn: 253879
2015-11-23 16:56:10 +00:00
Dan Gohman 53828fd777 [WebAssembly] Emit .param, .result, and .local through MC.
This eliminates one of the main remaining uses of EmitRawText.

llvm-svn: 253878
2015-11-23 16:50:18 +00:00
Diego Novillo 1ca881c4bb SamplePGO - Clear coverage tracking when clearing per-function data.
llvm-svn: 253877
2015-11-23 16:30:17 +00:00
Dan Gohman 3280793234 [WebAssembly] Use dominator information to improve BLOCK placement
Always starting blocks at the top of their containing loops works, but creates
unnecessarily deep nesting because it makes all blocks in a loop overlap.
Refine the BLOCK placement algorithm to start blocks at nearest common
dominating points instead, which significantly shrinks them and reduces
overlapping.

llvm-svn: 253876
2015-11-23 16:19:56 +00:00
Daniel Sanders 2b561336d9 [mips] .ent and .end should also set the type and size of the symbol respectively.
Reviewers: vkalintiris

Subscribers: llvm-commits, seanbruno, emaste, vkalintiris, dsanders

Differential Revision: http://reviews.llvm.org/D14221

llvm-svn: 253875
2015-11-23 16:08:03 +00:00
Martell Malone ba0f7d2b9d Revert part of r253813
The new lld gnu frontend does not support the -target option

llvm-svn: 253874
2015-11-23 16:04:55 +00:00
Daniel Jasper 569369ce28 clang-format: Signficantly refactor the cast detection.
No functional changes intended.

llvm-svn: 253873
2015-11-23 15:55:55 +00:00
Daniel Jasper 9bb3001d53 clang-format: Fix incorrect cast detection.
Before:
  bool b = f(g<int>)&&c;

After:
  bool b = f(g<int>) && c;

llvm-svn: 253872
2015-11-23 15:55:50 +00:00
Daniel Jasper 253dad2323 clang-format: If the template list of a variable declaration spans
multiple lines, also break before the variable name.

Before:
  std::vector<aaaaaa, // wrap
              aa> aaa;

After:
  std::vector<aaaaaa, // wrap
              aa>
      aaa;

llvm-svn: 253871
2015-11-23 15:55:45 +00:00
Nathan Slingerland 8a0654836e [Support] Fix SaturatingMultiply<T>() to be correct (and fast), Re-enable Unit Tests
Summary:
This change fixes the SaturatingMultiply<T>() function template to not cause undefined behavior with T=uint16_t.
Thanks to Richard Smith's contribution, it also no longer requires an integer division.

Patch by Richard Smith.

Reviewers: silvas, davidxl

Subscribers: rsmith, davidxl, llvm-commits

Differential Revision: http://reviews.llvm.org/D14845

llvm-svn: 253870
2015-11-23 15:33:43 +00:00
Rafael Espindola e02c86812c Fix Elf_Rel processing for .eh_frame.
Thanks to Simon for the bug report.

llvm-svn: 253869
2015-11-23 15:28:28 +00:00
Diego Novillo 39ab68f39b SamplePGO - Use newly introduced local variable. NFC.
llvm-svn: 253868
2015-11-23 15:24:13 +00:00
Krzysztof Parzyszek 29d23f9f4c [Hexagon] Update instruction formats
llvm-svn: 253867
2015-11-23 14:09:26 +00:00