platform/upstream/llvm.git
7 years agoRecommit r308327 3rd time: Add a warning for missing
Alex Lorenz [Fri, 28 Jul 2017 14:41:21 +0000 (14:41 +0000)]
Recommit r308327 3rd time: Add a warning for missing
'#pragma pack (pop)' and suspicious uses of '#pragma pack' in included files

The second recommit (r309106) was reverted because the "non-default #pragma
pack value chages the alignment of struct or union members in the included file"
warning proved to be too aggressive for external projects like Chromium
(https://bugs.chromium.org/p/chromium/issues/detail?id=749197). This recommit
makes the problematic warning a non-default one, and gives it the
-Wpragma-pack-suspicious-include warning option.

The first recommit (r308441) caused a "non-default #pragma pack value might
change the alignment of struct or union members in the included file" warning
in LLVM itself. This recommit tweaks the added warning to avoid warnings for
#includes that don't have any records that are affected by the non-default
alignment. This tweak avoids the previously emitted warning in LLVM.

Original message:

This commit adds a new -Wpragma-pack warning. It warns in the following cases:

- When a translation unit is missing terminating #pragma pack (pop) directives.
- When entering an included file if the current alignment value as determined
  by '#pragma pack' directives is different from the default alignment value.
- When leaving an included file that changed the state of the current alignment
  value.

rdar://10184173

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

llvm-svn: 309386

7 years ago[ValueTracking] Remove a number of unused arguments. NFC.
Chad Rosier [Fri, 28 Jul 2017 14:39:06 +0000 (14:39 +0000)]
[ValueTracking] Remove a number of unused arguments. NFC.

llvm-svn: 309385

7 years ago[AArch64] Standardize suffixes for LSE Atomics mnemonics (NFCI)
Joel Jones [Fri, 28 Jul 2017 14:09:24 +0000 (14:09 +0000)]
[AArch64] Standardize suffixes for LSE Atomics mnemonics (NFCI)

This NFC changeset standardizes the suffixes used for LSE Atomics
instructions.

It changes the existing suffixes - 'b', 'h', 's', 'd' - to the existing
standard 'B', 'H', 'W' and 'X'.

This changeset is the result of the code review discussion for D35319.

Patch by: steleman

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

llvm-svn: 309384

7 years agoStrip trailing whitespace. NFCI.
Simon Pilgrim [Fri, 28 Jul 2017 14:01:51 +0000 (14:01 +0000)]
Strip trailing whitespace. NFCI.

llvm-svn: 309383

7 years ago[X86] Add tests showing inability of vector non-temporal load/store intrinsic to...
Simon Pilgrim [Fri, 28 Jul 2017 13:47:02 +0000 (13:47 +0000)]
[X86] Add tests showing inability of vector non-temporal load/store intrinsic to force pointer alignment (PR33830)

Clang specifies a max type alignment of 16 bytes on darwin targets, meaning that the builtin nontemporal stores don't correctly align the loads/stores to 32 or 64 bytes when required, resulting in lowering to temporal unaligned loads/stores.

llvm-svn: 309382

7 years ago[ARM] Add the option to directly access TLS pointer
Strahinja Petrovic [Fri, 28 Jul 2017 12:54:57 +0000 (12:54 +0000)]
[ARM] Add the option to directly access TLS pointer

This patch enables choice for accessing thread local
storage pointer (like '-mtp' in gcc).

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

llvm-svn: 309381

7 years ago[clang-tidy] Expand readability-redundant-function-ptr-dereference test
Alexander Kornienko [Fri, 28 Jul 2017 12:46:08 +0000 (12:46 +0000)]
[clang-tidy] Expand readability-redundant-function-ptr-dereference test

llvm-svn: 309380

7 years ago[clang-tidy] readability-redundant-declaration: ignore friends and macros
Alexander Kornienko [Fri, 28 Jul 2017 12:46:02 +0000 (12:46 +0000)]
[clang-tidy] readability-redundant-declaration: ignore friends and macros

llvm-svn: 309379

7 years ago[clangd] Workaround for a test failure on Windows.
Ilya Biryukov [Fri, 28 Jul 2017 12:25:51 +0000 (12:25 +0000)]
[clangd] Workaround for a test failure on Windows.

Previous workaround (r308959) didn't account for a case when system drive
letter is not 'C:'.

llvm-svn: 309378

7 years ago[ScopDetect] add `-polly-ignore-func` flag to ignore functions by name.
Siddharth Bhat [Fri, 28 Jul 2017 11:47:24 +0000 (11:47 +0000)]
[ScopDetect] add `-polly-ignore-func` flag to ignore functions by name.

Ignore all functions whose name match a regex. Useful because creating a
regex that does *not* match a string is somewhat hard.

Example:
https://stackoverflow.com/questions/1240275/how-to-negate-specific-word-in-regex

llvm-svn: 309377

7 years ago[ELF] - Cleanup MapFile.cpp. NFC.
George Rimar [Fri, 28 Jul 2017 11:13:21 +0000 (11:13 +0000)]
[ELF] - Cleanup MapFile.cpp. NFC.

* Removed redundant templating.
* Added missing `static` keyword.

llvm-svn: 309376

7 years ago[X86] Add test case for PR33290
Simon Pilgrim [Fri, 28 Jul 2017 09:43:52 +0000 (09:43 +0000)]
[X86] Add test case for PR33290

llvm-svn: 309375

7 years ago[X86][AVX] Cleanup shuffle combine tests - remove old prefixes.
Simon Pilgrim [Fri, 28 Jul 2017 09:41:55 +0000 (09:41 +0000)]
[X86][AVX] Cleanup shuffle combine tests - remove old prefixes.

llvm-svn: 309374

7 years agoAdd missing namespace comment
Tobias Grosser [Fri, 28 Jul 2017 09:33:06 +0000 (09:33 +0000)]
Add missing namespace comment

llvm-svn: 309373

7 years ago[ELF] - Do not crash when ALIGN/DATA_SEGMENT_ALIGN expression used with zero value.
George Rimar [Fri, 28 Jul 2017 09:27:49 +0000 (09:27 +0000)]
[ELF] - Do not crash when ALIGN/DATA_SEGMENT_ALIGN expression used with zero value.

Previously we would crash when tried to ALIGN(0).
Patch uses value 1 instead in this case, that
looks to be consistent with GNU linkers
and reasonable and simple behavior itself.

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

llvm-svn: 309372

7 years ago[ARM] Add test to check pcs of ARM ABI runtime floating point helpers
Peter Smith [Fri, 28 Jul 2017 09:21:00 +0000 (09:21 +0000)]
[ARM] Add test to check pcs of ARM ABI runtime floating point helpers

The ARM Runtime ABI document (IHI0043) defines the AEABI floating point
helper functions in section 4.1.2 The floating-point helper functions.
The functions listed in this section must always use the base AAPCS calling
convention.

This test generates calls to all the helper functions that llvm supports
and checks that the base AAPCS calling convention has been used. We test
the equivalent of -mfloat-abi=soft, -mfloat-abi=softfp, -mfloat-abi=hardfp
with an FPU that supports single and double precision, and one that only
supports double precision.

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

llvm-svn: 309371

7 years agoclang-format: merge short case labels with trailing comments
Francois Ferrand [Fri, 28 Jul 2017 07:56:18 +0000 (07:56 +0000)]
clang-format: merge short case labels with trailing comments

Summary:
Allow merging short case labels when they actually end with a comment
(like a comment after the ``break``) and when followed by switch-level
comments (e.g. aligned with next case):

  switch(a) {
  case 0: break; // comment at end of case
  case 1: return value;
  // comment related to next case
  // comment related to next case
  case 2:
  }

Reviewers: krasimir, djasper

Reviewed By: krasimir

Subscribers: klimek, cfe-commits

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

llvm-svn: 309370

7 years agoclang-format: fix block OpeningLineIndex around preprocessor
Francois Ferrand [Fri, 28 Jul 2017 07:56:14 +0000 (07:56 +0000)]
clang-format: fix block OpeningLineIndex around preprocessor

Summary:
The current code would return an incorrect value when a preprocessor
directive is present immediately after the opening brace: this causes
the nanespace end comment fixer to break in some places, for exemple it
would not add the comment in this case:

  namespace a {
  #define FOO
  }

Fixing the computation is simple enough, but it was breaking a feature,
as it would cause comments to be added also when the namespace
declaration was dependant on conditional compilation.

To fix this, a hash of the current preprocessor stack/branches is
computed at the beginning of parseBlock(), so that we explicitely do not
store the OpeningLineIndex when the beginning and end of the block are
not in the same preprocessor conditions.

Tthe hash is computed based on the line, but this could propbably be
improved by using the actual condition, so that clang-format would be
able to match multiple identical #ifdef blocks.

Reviewers: krasimir, djasper

Reviewed By: krasimir

Subscribers: klimek, cfe-commits

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

llvm-svn: 309369

7 years ago[GPGPU] Do not require the Scop::Context to have information about all parameters
Tobias Grosser [Fri, 28 Jul 2017 06:49:44 +0000 (06:49 +0000)]
[GPGPU] Do not require the Scop::Context to have information about all parameters

llvm-svn: 309368

7 years ago[SCEV] Do not visit nodes twice in containsConstantSomewhere
Max Kazantsev [Fri, 28 Jul 2017 06:42:15 +0000 (06:42 +0000)]
[SCEV] Do not visit nodes twice in containsConstantSomewhere

This patch reworks the function that searches constants in Add and Mul SCEV expression
chains so that now it does not visit a node more than once, and also renames this function
for better correspondence between its implementation and semantics.

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

llvm-svn: 309367

7 years ago[GPGPU] Fix compilation issue with latest CUDA upgrade to i128
Tobias Grosser [Fri, 28 Jul 2017 06:38:49 +0000 (06:38 +0000)]
[GPGPU] Fix compilation issue with latest CUDA upgrade to i128

llvm-svn: 309366

7 years ago[MachineOutliner] NFC: Comment tidying
Jessica Paquette [Fri, 28 Jul 2017 05:59:30 +0000 (05:59 +0000)]
[MachineOutliner] NFC: Comment tidying

The comment on describing the suffix tree had some pruning
stuff that was out of date in it.

Also fixed some typos.

llvm-svn: 309365

7 years agoRevert rL309320 - "[OCaml] Respect CMAKE_C_FLAGS for OCaml C files"
Michal Gorny [Fri, 28 Jul 2017 04:29:20 +0000 (04:29 +0000)]
Revert rL309320 - "[OCaml] Respect CMAKE_C_FLAGS for OCaml C files"

This causes buildbot breakage for systems where OCaml files are built
with a different compiler.

llvm-svn: 309364

7 years agotest: require x86 backend
Saleem Abdulrasool [Fri, 28 Jul 2017 04:15:35 +0000 (04:15 +0000)]
test: require x86 backend

Ensure that the target is registered before using it.  Should fix the
hexagon Bots.

llvm-svn: 309363

7 years agoSupport libc++abi in addition to libstdc++
Petr Hosek [Fri, 28 Jul 2017 03:39:39 +0000 (03:39 +0000)]
Support libc++abi in addition to libstdc++

This change adds sanitizer support for LLVM's libunwind and libc++abi
as an alternative to libstdc++. This allows using the in tree version
of libunwind and libc++abi which is useful when building a toolchain
for different target.

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

llvm-svn: 309362

7 years agoSupport compiler-rt builtins
Petr Hosek [Fri, 28 Jul 2017 03:39:38 +0000 (03:39 +0000)]
Support compiler-rt builtins

This change adds support for compiler-rt builtins as an alternative
compiler runtime to libgcc.

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

llvm-svn: 309361

7 years agoMC: add support for cfi_return_column
Saleem Abdulrasool [Fri, 28 Jul 2017 03:39:19 +0000 (03:39 +0000)]
MC: add support for cfi_return_column

This adds support for the CFI pseudo-op return_column.  This specifies
the frame table column which contains the return address.

Addresses PR33953!

llvm-svn: 309360

7 years agoMC: clang-format enumeration (NFC)
Saleem Abdulrasool [Fri, 28 Jul 2017 03:39:18 +0000 (03:39 +0000)]
MC: clang-format enumeration (NFC)

This was hard to insert elements into.  clang-format it so that it is
easier.  NFC.

llvm-svn: 309359

7 years agoadd __kernel_exec macros
Jan Vesely [Fri, 28 Jul 2017 03:39:03 +0000 (03:39 +0000)]
add __kernel_exec macros

also consolidate macros into one file, and rename to clcmacros.h

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 309358

7 years agoRevert "[SCEV] Cache results of computeExitLimit"
Sanjoy Das [Fri, 28 Jul 2017 03:25:07 +0000 (03:25 +0000)]
Revert "[SCEV] Cache results of computeExitLimit"

This reverts commit r309080.  The patch needs to clear out the
ScalarEvolution::ExitLimits cache in forgetMemoizedResults.

I've replied on the commit thread for the patch with more details.

llvm-svn: 309357

7 years ago[MachineOutliner] NFC: Split up getOutliningBenefit
Jessica Paquette [Fri, 28 Jul 2017 03:21:58 +0000 (03:21 +0000)]
[MachineOutliner] NFC: Split up getOutliningBenefit

This is some more cleanup in preparation for some actual
functional changes. This splits getOutliningBenefit into
two cost functions: getOutliningCallOverhead and
getOutliningFrameOverhead. These functions return the
number of instructions that would be required to call
a specific function and the number of instructions
that would be required to construct a frame for a
specific funtion. The actual outlining benefit logic
is moved into the outliner, which calls these functions.

The goal of refactoring getOutliningBenefit is to:

- Get us closer to getting rid of the IsTailCall flag

- Further split up "target-specific" things and
"general algorithm" things

llvm-svn: 309356

7 years ago[JumpThreading] Stop falsely preserving LazyValueInfo.
Davide Italiano [Fri, 28 Jul 2017 03:10:43 +0000 (03:10 +0000)]
[JumpThreading] Stop falsely preserving LazyValueInfo.

JumpThreading claims to preserve LVI, but it doesn't preserve
the analyses which LVI holds a reference to (e.g. the Dominator).
In the current pass manager infrastructure, after JT runs, the
PM frees these analyses (including DominatorTree) but preserves
LVI.

CorrelatedValuePropagation runs immediately after and queries
a corrupted domtree, causing weird miscompiles.

This commit disables the preservation of LVI for the time being.
Eventually, we should either move LVI to a proper dependency
tracking mechanism (i.e. an analyses shouldn't hold references
to other analyses and compute them on demand if needed), or
we should teach all the passes preserving LVI to preserve the
analyses LVI depends on.

The new pass manager has a mechanism to invalidate LVI in case
one of the analyses it depends on becomes invalid, so this problem
shouldn't exist (at least not in this immediate form), but handling
of analyses holding references is still a very delicate subject.

Fixes PR33917 (and rustc).

llvm-svn: 309355

7 years agoDebugInfo: Consider a CU containing only local imported entities to be 'empty'
David Blaikie [Fri, 28 Jul 2017 03:06:25 +0000 (03:06 +0000)]
DebugInfo: Consider a CU containing only local imported entities to be 'empty'

This can come up in ThinLTO & wastes space & makes degenerate IR.

As per the added FIXME, ultimately, local imported entities should hang
off the function and that way the imported entity list on the CU can be
tested for emptiness like all the other CU lists.

(function-attached local imported entities are probably also the best
path forward for fixing how imported entities are handled both in
cross-module use (currently, while ThinLTO preserves the imported
entities, they would not get used at the imported inlined location -
only in the abstract origin that appears in the partial CU created by
the import (which isn't emitted under Fission due to cross-CU
limitations there)) and to reduce the number of points where imported
entities are emitted (they're currently emitted into every inlined
instance, concrete instance, and abstract origin - they should only go
in teh abstract origin if there is one, otherwise in the concrete
instance - but this requires lots of delayed handling and wiring up,
same as abstract variables & subprograms))

llvm-svn: 309354

7 years ago[JumpThreading] Add an option to dump LazyValueInfo after the run.
Davide Italiano [Fri, 28 Jul 2017 02:57:43 +0000 (02:57 +0000)]
[JumpThreading] Add an option to dump LazyValueInfo after the run.

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

llvm-svn: 309353

7 years agoUpdate comment in test case after r309308.
Akira Hatanaka [Fri, 28 Jul 2017 01:58:14 +0000 (01:58 +0000)]
Update comment in test case after r309308.

llvm-svn: 309352

7 years ago[sanitizer-coverage] add a run-time test for -fsanitize-coverage=inline-8bit-counter...
Kostya Serebryany [Fri, 28 Jul 2017 01:38:43 +0000 (01:38 +0000)]
[sanitizer-coverage] add a run-time test for  -fsanitize-coverage=inline-8bit-counters,pc-table

llvm-svn: 309351

7 years agoARMFrameLowering: Only set ExtraCSSpill for actually unused registers.
Matthias Braun [Fri, 28 Jul 2017 01:36:32 +0000 (01:36 +0000)]
ARMFrameLowering: Only set ExtraCSSpill for actually unused registers.

The code assumed that unclobbered/unspilled callee saved registers are
unused in the function. This is not true for callee saved registers that are
also used to pass parameters such as swiftself.

rdar://33401922

llvm-svn: 309350

7 years ago[demangler] Fix some overzealous -Wreturn-type errors
Erik Pilkington [Fri, 28 Jul 2017 01:35:14 +0000 (01:35 +0000)]
[demangler] Fix some overzealous -Wreturn-type errors

llvm-svn: 309349

7 years ago[lit] Port googletest lit tests to Windows
Reid Kleckner [Fri, 28 Jul 2017 01:05:55 +0000 (01:05 +0000)]
[lit] Port googletest lit tests to Windows

Summary:
The technique of directly calling subprocess.Popen on a python script
doesn't work on Windows. The executable path of the command must refer
to a valid win32 executable.

Instead, rename all the python scripts masquerading as gtest executables
to have .py extensions, so we can easily detect then and call the python
executable for them. Do this on Linux as well as Windows for
consistency.

The test suite directory names also come out in lower-case on Windows.
We can consider removing that in a later patch. This change just updates
the FileCheck lines to match on Windows.

Fixes PR33933

Reviewers: modocache, mgorny

Subscribers: llvm-commits

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

llvm-svn: 309347

7 years agoChanging the default MaxNumPromotions from 2 to 3.
Dehao Chen [Fri, 28 Jul 2017 01:03:10 +0000 (01:03 +0000)]
Changing the default MaxNumPromotions from 2 to 3.

Summary: In performance tuning, we see performance benefits when enlarge the maximum num promotion targets to 3. This is safe as soon as we have total percentage threshold properly setup (https://reviews.llvm.org/D35962)

Reviewers: davidxl, tejohnson

Reviewed By: tejohnson

Subscribers: llvm-commits, sanjoy

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

llvm-svn: 309346

7 years agoSeparate the ICP total threshold and remaining threshold.
Dehao Chen [Fri, 28 Jul 2017 01:02:54 +0000 (01:02 +0000)]
Separate the ICP total threshold and remaining threshold.

Summary: In the current implementation, isPromotionProfitable only checks if the call count to a direct target is no less than a certain percentage threshold of the remaining call counts that have not been promoted. This causes code size problems when the target count is small but greater than a large portion of remaining counts. E.g. target1 takes 99.9%, while target2 takes 0.1%. Both targets will be promoted and inlined, makes the function size too large, which potentially prevents it from further inlining into its callers. This patch adds another percentage threshold against the total indirect call count. If the target count needs to be no less than both thresholds in order to be promoted speculatively.

Reviewers: davidxl, tejohnson

Reviewed By: tejohnson

Subscribers: sanjoy, llvm-commits

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

llvm-svn: 309345

7 years agoIncrease the ImportHotMultiplier to 10.0
Dehao Chen [Fri, 28 Jul 2017 01:02:34 +0000 (01:02 +0000)]
Increase the ImportHotMultiplier to 10.0

Summary: The original 3.0 hot mupltiplier is too small, and would prevent hot callsites from being inline. This patch increases the hot multilier to 10.0

Reviewers: davidxl, tejohnson

Reviewed By: tejohnson

Subscribers: llvm-commits, sanjoy

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

llvm-svn: 309344

7 years ago[X86] Fix latent bug in sibcall eligibility logic
Reid Kleckner [Fri, 28 Jul 2017 00:58:35 +0000 (00:58 +0000)]
[X86] Fix latent bug in sibcall eligibility logic

The X86 tail call eligibility logic was correct when it was written, but
the addition of inalloca and argument copy elision broke its
assumptions. It was assuming that fixed stack objects were immutable.

Currently, we aim to emit a tail call if no arguments have to be
re-arranged in memory. This code would trace the outgoing argument
values back to check if they are loads from an incoming stack object.
If the stack argument is immutable, then we won't need to store it back
to the stack when we tail call.

Fortunately, stack objects track their mutability, so we can just make
the obvious check to fix the bug.

This was http://crbug.com/749826

llvm-svn: 309343

7 years ago[demangler] Attempt to fix linux bots, include <cstdio>
Erik Pilkington [Fri, 28 Jul 2017 00:53:30 +0000 (00:53 +0000)]
[demangler] Attempt to fix linux bots, include <cstdio>

llvm-svn: 309342

7 years ago[sanitizers] Sanitizer tests CMake clean up: try #2
George Karpenkov [Fri, 28 Jul 2017 00:50:56 +0000 (00:50 +0000)]
[sanitizers] Sanitizer tests CMake clean up: try #2

This patch addresses two issues:

Most of the time, hacks with `if/else` in order to get support for
multi-configuration builds are superfluous.
The variable `CMAKE_CFG_INTDIR` was created precisely for this purpose: it
expands to `.`  on all single-configuration builds, and to a configuration
name otherwise.
The `if/else` hacks for the library name generation should also not be
done, as CMake has `TARGET_FILE` generator expression precisely for this
purpose, as it expands to the exact filename of the resulting target.

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

llvm-svn: 309341

7 years ago[demangler] Use an AST to represent demangled names
Erik Pilkington [Fri, 28 Jul 2017 00:43:49 +0000 (00:43 +0000)]
[demangler] Use an AST to represent demangled names

The demangler now demangles by producing an AST, then traverses that
AST to produce a demangled name. This is done for performance reasons,
now the demangler doesn't manuiplate std::strings, which hurt
performance and caused string operations to be inlined into the
parser, leading to large code size and stack usage.

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

llvm-svn: 309340

7 years ago[sancov] Add missing line breaks in test. NFC.
Evgeniy Stepanov [Fri, 28 Jul 2017 00:22:42 +0000 (00:22 +0000)]
[sancov] Add missing line breaks in test. NFC.

llvm-svn: 309339

7 years ago[sanitizer-coverage] clang flags pumbing for -fsanitize-coverage=pc-table
Kostya Serebryany [Fri, 28 Jul 2017 00:10:10 +0000 (00:10 +0000)]
[sanitizer-coverage] clang flags pumbing for -fsanitize-coverage=pc-table

llvm-svn: 309338

7 years ago[sanitizer-coverage] rename sanitizer-coverage-create-pc-table into sanitizer-coverag...
Kostya Serebryany [Fri, 28 Jul 2017 00:09:29 +0000 (00:09 +0000)]
[sanitizer-coverage] rename sanitizer-coverage-create-pc-table into sanitizer-coverage-pc-table and add plumbing for a clang flag

llvm-svn: 309337

7 years agoRemove unused function from AArch64 backend (NFC)
Adrian Prantl [Thu, 27 Jul 2017 23:52:06 +0000 (23:52 +0000)]
Remove unused function from AArch64 backend (NFC)

llvm-svn: 309336

7 years ago[sanitizer-coverage] add a feature sanitizer-coverage-create-pc-table=1 (works with...
Kostya Serebryany [Thu, 27 Jul 2017 23:36:49 +0000 (23:36 +0000)]
[sanitizer-coverage] add a feature sanitizer-coverage-create-pc-table=1 (works with trace-pc-guard and inline-8bit-counters) that adds a static table of instrumented PCs to be used at run-time

llvm-svn: 309335

7 years ago[MachineOutliner] Cleanup: move findCandidates out of suffix tree
Jessica Paquette [Thu, 27 Jul 2017 23:24:43 +0000 (23:24 +0000)]
[MachineOutliner] Cleanup: move findCandidates out of suffix tree

Doing some cleanup in preparation for some functional changes.
This commit moves findCandidates out of the suffix tree and into the
MachineOutliner class. This is much easier to follow, and removes
the burden of candidate choice from the suffix tree.

It also adds a couple FIXMEs and simplifies building outlined function
names.

llvm-svn: 309334

7 years ago[sancov] Implement __sanitizer_cov_reset.
Evgeniy Stepanov [Thu, 27 Jul 2017 23:22:37 +0000 (23:22 +0000)]
[sancov] Implement __sanitizer_cov_reset.

Summary: Clears all collected coverage.

Reviewers: kcc

Subscribers: srhines, kubamracek, llvm-commits

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

llvm-svn: 309333

7 years ago[llvm-pdbutil] Clean up ExitOnError usage to add ": " to our errors
Reid Kleckner [Thu, 27 Jul 2017 23:13:18 +0000 (23:13 +0000)]
[llvm-pdbutil] Clean up ExitOnError usage to add ": " to our errors

The banner parameter is supposed to end in a separator, like ": ".
Otherwise, we get ugly errors like:

Error while reading publics streamNative error: blah blah

llvm-svn: 309332

7 years ago[PDB] Initialize the std::array<ulittle32_t> used for the gsi bitmap
Reid Kleckner [Thu, 27 Jul 2017 23:13:05 +0000 (23:13 +0000)]
[PDB] Initialize the std::array<ulittle32_t> used for the gsi bitmap

With ASan, we would write about 512 bytes of malloc fill value to the
PDB, with some random bits ORed in here and there. Dumping the PDB would
always fail reliably.

llvm-svn: 309331

7 years ago[ConstantFolder] Don't try to fold gep when the idx is a vector.
Davide Italiano [Thu, 27 Jul 2017 22:20:44 +0000 (22:20 +0000)]
[ConstantFolder] Don't try to fold gep when the idx is a vector.

The code in ConstantFoldGetElementPtr() assumes integers, and
therefore it crashes trying to get the integer bidwith of a vector
type (in this case <4 x i32>. I just changed the code to prevent
the folding in case of vectors and I didn't bother to generalize
as this doesn't seem to me something that really happens in
practice, but I'm willing to change the patch if you think
it's worth it.
This is hard to trigger from -instsimplify or -instcombine
only as the second instruction is dead, so the test uses loop-unroll.

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

llvm-svn: 309330

7 years agoAdd a test.
Rafael Espindola [Thu, 27 Jul 2017 22:08:11 +0000 (22:08 +0000)]
Add a test.

This would have found the error in r309252.

llvm-svn: 309329

7 years agoHeaders: fix _Unwind_{G,S}etGR for non-EHABI targets
Saleem Abdulrasool [Thu, 27 Jul 2017 21:56:25 +0000 (21:56 +0000)]
Headers: fix _Unwind_{G,S}etGR for non-EHABI targets

The EHABI definition was being inlined into the users even when EHABI
was not in use.  Adjust the condition to ensure that the right version
is defined.

llvm-svn: 309327

7 years agoAvoid warnings when asserts are disabled.
Rafael Espindola [Thu, 27 Jul 2017 21:42:42 +0000 (21:42 +0000)]
Avoid warnings when asserts are disabled.

llvm-svn: 309326

7 years ago[X86] Don't lie about legality to TLI's demanded bits.
Ahmed Bougacha [Thu, 27 Jul 2017 21:28:59 +0000 (21:28 +0000)]
[X86] Don't lie about legality to TLI's demanded bits.

Like r309323, X86 had a typo where it passed the wrong flags to TLO.

Found by inspection; I haven't been able to tickle this into having
observable behavior.  I don't think it does, given that X86 doesn't have
custom demanded bits logic, and the generic logic doesn't have a lot of
exposure to illegal constructs.

llvm-svn: 309325

7 years ago[AArch64] Remove outdated comment. NFC.
Ahmed Bougacha [Thu, 27 Jul 2017 21:27:58 +0000 (21:27 +0000)]
[AArch64] Remove outdated comment. NFC.

There hasn't been a ternary since r231987.

llvm-svn: 309324

7 years ago[AArch64] Fix legality info passed to demanded bits for TBI opt.
Ahmed Bougacha [Thu, 27 Jul 2017 21:27:25 +0000 (21:27 +0000)]
[AArch64] Fix legality info passed to demanded bits for TBI opt.

The (seldom-used) TBI-aware optimization had a typo lying dormant since
it was first introduced, in r252573:  when asking for demanded bits, it
told TLI that it was running after legalize, where the opposite was
true.

This is an important piece of information, that the demanded bits
analysis uses to make assumptions about the node.  r301019 added such an
assumption, which was broken by the TBI combine.

Instead, pass the correct flags to TLO.

llvm-svn: 309323

7 years ago[libcxx] [test] Remove an unused local typedef in enable_shared_from_this.pass.cpp.
Stephan T. Lavavej [Thu, 27 Jul 2017 21:16:37 +0000 (21:16 +0000)]
[libcxx] [test] Remove an unused local typedef in enable_shared_from_this.pass.cpp.

Trivial change, committed without review.

llvm-svn: 309322

7 years ago[OCaml] Fix undefined reference to LLVMDumpType() with NDEBUG
Michal Gorny [Thu, 27 Jul 2017 21:13:25 +0000 (21:13 +0000)]
[OCaml] Fix undefined reference to LLVMDumpType() with NDEBUG

Account for the possibility of LLVMDumpType() not being available with
NDEBUG in the OCaml bindings. If it is not built into LLVM, make
the dump function raise an exception.

Since rL293359, the dump functions are built only if either NDEBUG is
not defined, or LLVM_ENABLE_DUMP is defined. As a result, if the dump
functions are not built in LLVM, the dynamic OCaml libraries fail to
load due to undefined LLVMDumpType symbol.

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

llvm-svn: 309321

7 years ago[OCaml] Respect CMAKE_C_FLAGS for OCaml C files
Michal Gorny [Thu, 27 Jul 2017 21:13:19 +0000 (21:13 +0000)]
[OCaml] Respect CMAKE_C_FLAGS for OCaml C files

Pass the values of CMAKE_C_FLAGS and CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE}
as -ccopt to ocamlc. This enforces the specific flags used for the LLVM
build to be used for OCaml bindings as well, notably -O and -march
flags.

This also solves the issue of the user being unable to force specific
flags for OCaml bindings builds. Gentoo needs this to enforce -DNDEBUG
consistently between the LLVM build and the split OCaml bindings build.

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

llvm-svn: 309320

7 years agoFix implementation of OMP_THREAD_LIMIT
Jonathan Peyton [Thu, 27 Jul 2017 20:58:41 +0000 (20:58 +0000)]
Fix implementation of OMP_THREAD_LIMIT

This change fixes the implementation of OMP_THREAD_LIMIT. The implementation of
this previously was not restricted to a contention group (but it should be,
according to the spec), and this is fixed here. A field is added to root thread
to store a counter of the threads in the contention group. An extra check is
added when reserving threads for a parallel region that checks this variable and
compares to threadlimit-var, which is implemented as a new global variable,
kmp_cg_max_nth. Associated settings changes were also made, and clean up of
comments that referred to OMP_THREAD_LIMIT, but should refer to the new
KMP_DEVICE_THREAD_LIMIT (added in an earlier patch).

Patch by Terry Wilmarth

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

llvm-svn: 309319

7 years agoRevert "[sanitizers] Sanitizer tests CMake clean up"
George Karpenkov [Thu, 27 Jul 2017 20:44:33 +0000 (20:44 +0000)]
Revert "[sanitizers] Sanitizer tests CMake clean up"

This reverts commit 0ab44db2aa1cd3710355ad79b04f954ce68c0b3a.

Fails on some bots, reverting until I can fix it.

llvm-svn: 309318

7 years agoAdd test to reject merging of empty manifest.
Eric Beckmann [Thu, 27 Jul 2017 19:58:12 +0000 (19:58 +0000)]
Add test to reject merging of empty manifest.

Reviewers: ruiu, rnk

Subscribers: llvm-commits

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

llvm-svn: 309317

7 years ago[ARM] Add use-misched feature, to enable the MachineScheduler.
Florian Hahn [Thu, 27 Jul 2017 19:56:44 +0000 (19:56 +0000)]
[ARM] Add use-misched feature, to enable the MachineScheduler.

Summary:
This change makes it easier to experiment with the MachineScheduler in
the ARM backend and also makes it very explicit which CPUs use the
MachineScheduler (currently only swift and cyclone).

Reviewers: MatzeB, t.p.northover, javed.absar

Reviewed By: MatzeB

Subscribers: aemerson, kristof.beyls, llvm-commits

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

llvm-svn: 309316

7 years agoChange prefix in vector-shuffle-combining-avx.patch to reduce test size.
Dinar Temirbulatov [Thu, 27 Jul 2017 19:47:35 +0000 (19:47 +0000)]
Change prefix in vector-shuffle-combining-avx.patch to reduce test size.

llvm-svn: 309315

7 years ago[Headers] Add a test for arm64intr.h
Martin Storsjo [Thu, 27 Jul 2017 19:45:13 +0000 (19:45 +0000)]
[Headers] Add a test for arm64intr.h

This tests the ARM64 specific constants added in SVN r309081,
similar to the one added in r277928 for armintr.h.

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

llvm-svn: 309314

7 years ago[MergeFunctions] Remove alias support.
whitequark [Thu, 27 Jul 2017 19:36:13 +0000 (19:36 +0000)]
[MergeFunctions] Remove alias support.

The alias support was dead code since 2011. It was last touched
in r124182, where it was reintroduced after being removed
in r110434, and since then it was gated behind a HasGlobalAliases
flag that was permanently stuck as `false`.

It is also broken. I'm not sure if it bitrotted or was just broken
in the first place because it appears to have never been tested,
but the following IR results in a crash:

    define internal i32 @a(i32 %a, i32 %b) unnamed_addr {
      %c = add i32 %a, %b
      %d = xor i32 %a, %c
      ret i32 %c
    }

    define internal i32 @b(i32 %a, i32 %b) unnamed_addr {
      %c = add i32 %a, %b
      %d = xor i32 %a, %c
      ret i32 %c
    }

It seems safe to remove buggy untested code that no one cared about
for seven years.

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

llvm-svn: 309313

7 years ago[lit] Fix TestRunner unit test on Windows
Brian Gesiak [Thu, 27 Jul 2017 19:27:10 +0000 (19:27 +0000)]
[lit] Fix TestRunner unit test on Windows

Summary:
Normally Python converts all newline characters, Windows or Unix,
to Unix newlines when opening a file. However, lit opens files in
binary mode, which does not perform this conversion. As a result,
trailing Windows newlines are not stripped from test input, which
caused a failure in the TestRunner unit test:

```
FAIL: test_custom (__main__.TestIntegratedTestKeywordParser)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\bgesiak\src\llvm\llvm\utils\lit\tests\unit\TestRunner.py", line 109, in test_custom
    self.assertItemsEqual(value, ['a', 'b', 'c'])
AssertionError: Element counts were not equal:
First has 1, Second has 0: 'c\r'
First has 0, Second has 1:  'c'
```

Fix the discrepancy in behavior across the two platforms by
manually stripping Windows newlines before yielding each line in
the test file.

Reviewers: echristo, beanz, ddunbar, delcypher, rnk

Reviewed By: rnk

Subscribers: mehdi_amini, llvm-commits

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

llvm-svn: 309312

7 years agoMerge OutputSectionCommand and OutputSection.
Rafael Espindola [Thu, 27 Jul 2017 19:22:43 +0000 (19:22 +0000)]
Merge OutputSectionCommand and OutputSection.

This is a bit of a hack, but it is *so* convenient.

Now that we create synthetic linker scripts when none is provided, we
always have to handle paired OutputSection and OutputsectionCommand and
keep a mapping from one to the other.

This patch simplifies things by merging them and creating what used to
be OutputSectionCommands really early.

llvm-svn: 309311

7 years agoUn-revert "Teach the CMake build system to run lit's test suite. These can be run"
Brian Gesiak [Thu, 27 Jul 2017 19:18:35 +0000 (19:18 +0000)]
Un-revert "Teach the CMake build system to run lit's test suite. These can be run"

Summary:
Depends on https://reviews.llvm.org/D35879.

This reverts rL257268, which in turn was a revert of rL257221.
https://reviews.llvm.org/D35879 marks the tests in the lit test suite
that fail on Windows as XFAIL, which should allow these tests to pass
on Windows-based buildbots.

Reviewers: delcypher, beanz, mgorny, jroelofs, rnk

Reviewed By: mgorny

Subscribers: rnk, ddunbar, george.karpenkov, llvm-commits

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

llvm-svn: 309310

7 years ago[OPENMP] Allow all lvalues in 'depend' clause.
Alexey Bataev [Thu, 27 Jul 2017 19:15:30 +0000 (19:15 +0000)]
[OPENMP] Allow all lvalues in 'depend' clause.

According to upcoming OpenMP 5.0 all addressable lvalue expressions are
allowed in deoend clause.

llvm-svn: 309309

7 years agoRevert r264998 and r265035.
Akira Hatanaka [Thu, 27 Jul 2017 18:52:44 +0000 (18:52 +0000)]
Revert r264998 and r265035.

r303175 made changes to have __cxa_allocate_exception return a 16-byte
aligned pointer, so it's no longer necessary to specify a lower
alignment (8-bytes) for exception objects on Darwin.

rdar://problem/32363695

llvm-svn: 309308

7 years agoDisable the deduction guide test I added in 309296 for the moment, while I figure...
Marshall Clow [Thu, 27 Jul 2017 18:47:35 +0000 (18:47 +0000)]
Disable the deduction guide test I added in 309296 for the moment, while I figure out which compilers don't support deduction guides

llvm-svn: 309307

7 years ago[sanitizers] Sanitizer tests CMake clean up
George Karpenkov [Thu, 27 Jul 2017 18:40:38 +0000 (18:40 +0000)]
[sanitizers] Sanitizer tests CMake clean up

This patch addresses two issues:

Most of the time, hacks with `if/else` in order to get support for
multi-configuration builds are superfluous.
The variable `CMAKE_CFG_INTDIR` was created precisely for this purpose: it
expands to `.`  on all single-configuration builds, and to a configuration
name otherwise.
The `if/else` hacks for the library name generation should also not be
done, as CMake has `TARGET_FILE` generator expression precisely for this
purpose, as it expands to the exact filename of the resulting target.

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

llvm-svn: 309306

7 years ago[FunctionImport] Prefer isa<> to dyn_cast<> as the value is not used.
Davide Italiano [Thu, 27 Jul 2017 18:38:09 +0000 (18:38 +0000)]
[FunctionImport] Prefer isa<> to dyn_cast<> as the value is not used.

This change makes GCC7 happy again.

llvm-svn: 309305

7 years ago[InstCombine] Simplify pointer difference subtractions (GEP-GEP) where GEPs have...
Hiroshi Yamauchi [Thu, 27 Jul 2017 18:27:11 +0000 (18:27 +0000)]
[InstCombine] Simplify pointer difference subtractions (GEP-GEP) where GEPs have other uses and one non-constant index

Summary:
Pointer difference simplifications currently happen only if input GEPs don't have other uses or their indexes are all constants, to avoid duplicating indexing arithmetic.

This patch enables cases with exactly one non-constant index among input GEPs to happen where there is no duplicated arithmetic or code size increase even if input GEPs have other uses.

For example, this patch allows "(&A[42][i]-&A[42][0])" --> "i", which didn't happen previously, if the input GEP(s) have other uses.

Reviewers: sanjoy, bkramer

Reviewed By: sanjoy

Subscribers: mcrosier, llvm-commits

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

llvm-svn: 309304

7 years ago[PDB] Write public symbol records and the publics hash table
Reid Kleckner [Thu, 27 Jul 2017 18:25:59 +0000 (18:25 +0000)]
[PDB] Write public symbol records and the publics hash table

Summary:
MSVC link.exe records all external symbol names in the publics stream.
It provides similar functionality to an ELF .symtab.

Reviewers: zturner, ruiu

Subscribers: hiraditya, llvm-commits

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

llvm-svn: 309303

7 years ago[SelectionDAG] Improve DAGTypeLegalizer::convertMask assertion (PR33960)
Simon Pilgrim [Thu, 27 Jul 2017 18:15:54 +0000 (18:15 +0000)]
[SelectionDAG] Improve DAGTypeLegalizer::convertMask assertion (PR33960)

Improve DAGTypeLegalizer::convertMask's isSETCCorConvertedSETCC assertion to properly check for any mixture of SETCC or BUILD_VECTOR of constants, or a logical mask op of them.

llvm-svn: 309302

7 years agoTiny docs fix
Hans Wennborg [Thu, 27 Jul 2017 18:14:00 +0000 (18:14 +0000)]
Tiny docs fix

llvm-svn: 309300

7 years ago[X86] SET0 to use XMM registers where possible PR26018 PR32862
Dinar Temirbulatov [Thu, 27 Jul 2017 17:47:01 +0000 (17:47 +0000)]
[X86] SET0 to use XMM registers where possible PR26018 PR32862

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

llvm-svn: 309298

7 years agoRelax the matching in these tests
Adam Nemet [Thu, 27 Jul 2017 17:45:02 +0000 (17:45 +0000)]
Relax the matching in these tests

Looks like the template arguments are displayed differently depending on the
host compiler(?).  E.g.:

InnerAnalysisManagerProxy<CGSCCAnalysisManager
InnerAnalysisManagerProxy<llvm::AnalysisManager<llvm::LazyCallGraph::SCC, ...

Fix fallout after r309294

llvm-svn: 309297

7 years agoImplement P0739R0: 'Some improvements to class template argument deduction integratio...
Marshall Clow [Thu, 27 Jul 2017 17:44:03 +0000 (17:44 +0000)]
Implement P0739R0: 'Some improvements to class template argument deduction integration into the standard library' This is an API change (not ABI change) due to a late change in the c++17 standard

llvm-svn: 309296

7 years ago[clangd] Don't reverse priorities of completion items.
Ilya Biryukov [Thu, 27 Jul 2017 17:43:07 +0000 (17:43 +0000)]
[clangd] Don't reverse priorities of completion items.

Summary: Current algorithm incorrectly provides completion results in a reverse order.

Reviewers: krasimir, bkramer

Reviewed By: krasimir

Subscribers: cfe-commits, klimek

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

llvm-svn: 309295

7 years ago[ICP] Migrate to OptimizationRemarkEmitter
Adam Nemet [Thu, 27 Jul 2017 16:54:15 +0000 (16:54 +0000)]
[ICP] Migrate to OptimizationRemarkEmitter

This is a module pass so for the old PM, we can't use ORE, the function
analysis pass.  Instead ORE is created on the fly.

A few notes:

- isPromotionLegal is folded in the caller since we want to emit the Function
in the remark but we can only do that if the symbol table look-up succeeded.

- There was good test coverage for remarks in this pass.

- promoteIndirectCall uses ORE conditionally since it's also used from
SampleProfile which does not use ORE yet.

Fixes PR33792.

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

llvm-svn: 309294

7 years ago[OptRemark] Allow streaming of 64-bit integers
Adam Nemet [Thu, 27 Jul 2017 16:54:13 +0000 (16:54 +0000)]
[OptRemark] Allow streaming of 64-bit integers

llvm-svn: 309293

7 years ago[lit] Fix order of checks in shtest-shell.py test
Brian Gesiak [Thu, 27 Jul 2017 16:50:40 +0000 (16:50 +0000)]
[lit] Fix order of checks in shtest-shell.py test

Summary:
An expectation in `utils/lit/tests/Inputs/shtest-shell/redirects.txt`
expects that first a string printed to stdout is seen, and then a
string printed to stderr. Add `flush()` calls to ensure that stdout is
printed before stderr, as expected.

Reviewers: rnk, mgorny, jroelofs

Reviewed By: rnk

Subscribers: llvm-commits

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

llvm-svn: 309292

7 years agoAll libcalls should be considered to be GC-leaf functions.
Daniel Neilson [Thu, 27 Jul 2017 16:49:39 +0000 (16:49 +0000)]
All libcalls should be considered to be GC-leaf functions.

Summary:
It is possible for some passes to materialize a call to a libcall (ex: ldexp, exp2, etc),
but these passes will not mark the call as a gc-leaf-function. All libcalls are
actually gc-leaf-functions, so we change llvm::callsGCLeafFunction() to tell us that
available libcalls are equivalent to gc-leaf-function calls.

Reviewers: sanjoy, anna, reames

Reviewed By: anna

Subscribers: llvm-commits

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

llvm-svn: 309291

7 years agoUpdate to use enum classes for various ARM *Kind enums
Florian Hahn [Thu, 27 Jul 2017 16:28:39 +0000 (16:28 +0000)]
Update to use enum classes for various ARM *Kind enums

Summary: This updates the relevant Clang parts for the LLVM change D35882.

Reviewers: rengolin, chandlerc, javed.absar, rovka

Reviewed By: rovka

Subscribers: aemerson, cfe-commits, kristof.beyls

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

llvm-svn: 309289

7 years agoFix double destruction of objects when OpenMP construct is canceled
Erich Keane [Thu, 27 Jul 2017 16:28:20 +0000 (16:28 +0000)]
Fix double destruction of objects when OpenMP construct is canceled

When an omp for loop is canceled the constructed objects are being destructed
twice.

It looks like the desired code is:

{

  Obj o;
  If (cancelled) branch-through-cleanups to cancel.exit.

}
[cleanups]
cancel.exit:

__kmpc_for_static_fini
br cancel.cont (*)

cancel.cont:

__kmpc_barrier
return

The problem seems to be the branch to cancel.cont is currently also going
through the cleanups calling them again. This change just does a direct branch
instead.

Patch By: michael.p.rice@intel.com

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

llvm-svn: 309288

7 years ago[TargetParser] Use enum classes for various ARM kind enums.
Florian Hahn [Thu, 27 Jul 2017 16:27:56 +0000 (16:27 +0000)]
[TargetParser] Use enum classes for various ARM kind enums.

Summary:
Using c++11 enum classes ensures that only valid enum values are used
for ArchKind, ProfileKind, VersionKind and ISAKind. This removes the
need for checks that the provided values map to a proper enum value,
allows us to get rid of AK_LAST and prevents comparing values from
different enums. It also removes a bunch of static_cast
from unsigned to enum values and vice versa, at the cost of introducing
static casts to access AArch64ARCHNames and ARMARCHNames by ArchKind.

FPUKind and ArchExtKind are the only remaining old-style enum in
TargetParser.h. I think it's beneficial to keep ArchExtKind as old-style
enum, but FPUKind can be converted too, but this patch is quite big, so
could do this in a follow-up patch. I could also split this patch up a
bit, if people would prefer that.

Reviewers: rengolin, javed.absar, chandlerc, rovka

Reviewed By: rovka

Subscribers: aemerson, kristof.beyls, llvm-commits

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

llvm-svn: 309287

7 years ago[SLP] Outline code for the check that instruction users are part of
Alexey Bataev [Thu, 27 Jul 2017 15:48:44 +0000 (15:48 +0000)]
[SLP] Outline code for the check that instruction users are part of
vectorization tree, NFC.

llvm-svn: 309284

7 years ago[SelectionDAG] Avoid repeated calls to getNumOperands in for loop. NFCI.
Simon Pilgrim [Thu, 27 Jul 2017 15:42:21 +0000 (15:42 +0000)]
[SelectionDAG] Avoid repeated calls to getNumOperands in for loop. NFCI.

llvm-svn: 309283

7 years agoMake new PM honor -fdebug-info-for-profiling (clang side)
Dehao Chen [Thu, 27 Jul 2017 15:29:53 +0000 (15:29 +0000)]
Make new PM honor -fdebug-info-for-profiling (clang side)

Summary: The new PM needs to invoke add-discriminator pass when building with -fdebug-info-for-profiling.

Reviewers: chandlerc, davidxl

Reviewed By: chandlerc

Subscribers: sanjoy, cfe-commits

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

llvm-svn: 309282

7 years agoFix assert from r309278
David Blaikie [Thu, 27 Jul 2017 15:28:10 +0000 (15:28 +0000)]
Fix assert from r309278

llvm-svn: 309281

7 years agoremove redundant check
Adrian Prantl [Thu, 27 Jul 2017 15:24:20 +0000 (15:24 +0000)]
remove redundant check

llvm-svn: 309280