platform/upstream/llvm.git
7 years ago[llvm-cov] Fix issues with segment highlighting in the html view
Vedant Kumar [Thu, 8 Sep 2016 19:18:23 +0000 (19:18 +0000)]
[llvm-cov] Fix issues with segment highlighting in the html view

The text and html coverage views take different approaches to emitting
highlighted regions. That's because this problem is easier in the text
view: there's no need to worry about escaping text or adding tooltip
content to a highlighted snippet.

Unfortunately, the html view didn't get region highlighting quite right.

This patch fixes the situation, bringing parity between the two views.

llvm-svn: 280981

7 years agoFix tsan-go build.
Evgeniy Stepanov [Thu, 8 Sep 2016 19:16:01 +0000 (19:16 +0000)]
Fix tsan-go build.

Disable the new abort-in-SIGABRT code under SANITIZER_GO.

llvm-svn: 280980

7 years ago[LV] Don't mark pointers used by scalarized memory accesses uniform
Matthew Simpson [Thu, 8 Sep 2016 19:11:07 +0000 (19:11 +0000)]
[LV] Don't mark pointers used by scalarized memory accesses uniform

Previously, all consecutive pointers were marked uniform after vectorization.
However, if a consecutive pointer is used by a memory access that is eventually
scalarized, the pointer won't remain uniform after all. An example is
predicated stores. Even though a predicated store may be consecutive, it will
still be scalarized, making it's pointer operand non-uniform.

This patch updates the logic in collectLoopUniforms to consider the cases where
a memory access may be scalarized. If a memory access may be scalarized, its
pointer operand is not marked uniform. The determination of whether a given
memory instruction will be scalarized or not has been moved into a common
function that is used by the vectorizer, cost model, and legality analysis.

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

llvm-svn: 280979

7 years ago[pdb] Make YamlTypeDumperCallbacks reuse *this.
Zachary Turner [Thu, 8 Sep 2016 18:36:55 +0000 (18:36 +0000)]
[pdb] Make YamlTypeDumperCallbacks reuse *this.

Previously we were making new instances of YamlTypeDumperCallbacks
in order to recurse down and serialize / deserialize nested
records such as field lists.  This meant you could not pass
context from a higher operation to a lower operation because
it would be using a new instance of the visitor callback
delegate.

YAMLIO library was updated to support context-sensitive mappings,
so now we can reuse the same instance of the visitor callback
delegate even for nested operations.

llvm-svn: 280978

7 years ago[YAMLIO] Add the ability to map with context.
Zachary Turner [Thu, 8 Sep 2016 18:22:44 +0000 (18:22 +0000)]
[YAMLIO] Add the ability to map with context.

mapping a yaml field to an object in code has always been
a stateless operation.  You could still pass state by using the
`setContext` function of the YAMLIO object, but this represented
global state for the entire yaml input.  In order to have
context-sensitive state, it is necessary to pass this state in
at the granularity of an individual mapping.

This patch adds support for this type of context-sensitive state.
You simply pass an additional argument of type T to the
`mapRequired` or `mapOptional` functions, and provided you have
specialized a `MappingContextTraits<U, T>` class with the
appropriate mapping function, you can pass this context into
the mapping function.

Reviewed By: chandlerc
Differential Revision: https://reviews.llvm.org/D24162

llvm-svn: 280977

7 years ago[powerpc] Move #if to appease warnings-as-errors tests
Bill Seurer [Thu, 8 Sep 2016 18:09:47 +0000 (18:09 +0000)]
[powerpc] Move #if to appease warnings-as-errors tests

Previous patch added a #if which causes some unused identifier warnings.

llvm-svn: 280976

7 years agoRevert "Resubmit "Add a test for clang-tidy using the clang-cl driver.""
Ahmed Bougacha [Thu, 8 Sep 2016 18:02:14 +0000 (18:02 +0000)]
Revert "Resubmit "Add a test for clang-tidy using the clang-cl driver.""

This reverts commit r280839.
It's problematic on OS X, where the '/Users/...' paths are interpreted
as '/U' options.

Investigation ongoing in http://llvm.org/PR30328.

llvm-svn: 280975

7 years agoAMDGPU: Sign extend constants when splitting them
Matt Arsenault [Thu, 8 Sep 2016 17:44:36 +0000 (17:44 +0000)]
AMDGPU: Sign extend constants when splitting them

This will confuse later passes which try to look at the
immediate value and don't truncate first.

llvm-svn: 280974

7 years ago[Hexagon] Expand sext- and zextloads of vector types, not just extloads
Krzysztof Parzyszek [Thu, 8 Sep 2016 17:42:14 +0000 (17:42 +0000)]
[Hexagon] Expand sext- and zextloads of vector types, not just extloads

Recent change exposed this issue, breaking the Hexagon buildbots.

llvm-svn: 280973

7 years agoAMDGPU: Try to commute when selecting s_addk_i32/s_mulk_i32
Matt Arsenault [Thu, 8 Sep 2016 17:35:41 +0000 (17:35 +0000)]
AMDGPU: Try to commute when selecting s_addk_i32/s_mulk_i32

llvm-svn: 280972

7 years agoAArch64 .arch directive - Include default arch attributes with extensions.
Eric Christopher [Thu, 8 Sep 2016 17:27:03 +0000 (17:27 +0000)]
AArch64 .arch directive - Include default arch attributes with extensions.

Fix the .arch asm parser to use the full set of features for the architecture
and any extensions on the command line. Add and update testcases accordingly
as well as add an extension that was used but not supported.

llvm-svn: 280971

7 years agoAMDGPU: Support commuting with immediate in src0
Matt Arsenault [Thu, 8 Sep 2016 17:19:29 +0000 (17:19 +0000)]
AMDGPU: Support commuting with immediate in src0

llvm-svn: 280970

7 years agoRevert "[XRay] ARM 32-bit no-Thumb support in compiler-rt"
Renato Golin [Thu, 8 Sep 2016 17:13:15 +0000 (17:13 +0000)]
Revert "[XRay] ARM 32-bit no-Thumb support in compiler-rt"

This reverts commit r280890, as the related LLVM commit broke the thumb bots.

llvm-svn: 280969

7 years agoRevert "[XRay] ARM 32-bit no-Thumb support in Clang"
Renato Golin [Thu, 8 Sep 2016 17:12:32 +0000 (17:12 +0000)]
Revert "[XRay] ARM 32-bit no-Thumb support in Clang"

This reverts commit r280889, as the original LLVM commits broke the thumb
buildbots.

llvm-svn: 280968

7 years agoRevert "[XRay] ARM 32-bit no-Thumb support in LLVM"
Renato Golin [Thu, 8 Sep 2016 17:10:39 +0000 (17:10 +0000)]
Revert "[XRay] ARM 32-bit no-Thumb support in LLVM"

And associated commits, as they broke the Thumb bots.

This reverts commit r280935.
This reverts commit r280891.
This reverts commit r280888.

llvm-svn: 280967

7 years ago[LoopDataPrefetch] Use range based for loop; NFCI
Balaram Makam [Thu, 8 Sep 2016 17:08:20 +0000 (17:08 +0000)]
[LoopDataPrefetch] Use range based for loop; NFCI

Switch to range based for loop.
No functional change, but more readable code.

llvm-svn: 280966

7 years agoFix MSVC error from r280919
Pavel Labath [Thu, 8 Sep 2016 16:58:30 +0000 (16:58 +0000)]
Fix MSVC error from r280919

MSVC did not understand my brace-initializer syntax. :/

llvm-svn: 280965

7 years ago[InstCombine] return a vector-safe true/false constant
Sanjay Patel [Thu, 8 Sep 2016 16:54:02 +0000 (16:54 +0000)]
[InstCombine] return a vector-safe true/false constant

I introduced this potential bug by missing this diff in:
https://reviews.llvm.org/rL280873

...however, I'm not sure how to reach this code path with a regression test.
We may be able to remove this code and assume that the transform to a constant
is always handled by InstSimplify?

llvm-svn: 280964

7 years agoAdd unittest for r280760
Dehao Chen [Thu, 8 Sep 2016 16:53:40 +0000 (16:53 +0000)]
Add unittest for r280760

llvm-svn: 280963

7 years agoFix linker warning about sanitizer_common_nolibc functions on Windows
Reid Kleckner [Thu, 8 Sep 2016 16:46:06 +0000 (16:46 +0000)]
Fix linker warning about sanitizer_common_nolibc functions on Windows

llvm-svn: 280962

7 years agoReplace nextafter implementation
Matt Arsenault [Thu, 8 Sep 2016 16:37:56 +0000 (16:37 +0000)]
Replace nextafter implementation

This one passes conformance.

llvm-svn: 280961

7 years ago[InstCombine][X86] Regenerate masked memory op combine tests
Simon Pilgrim [Thu, 8 Sep 2016 16:32:37 +0000 (16:32 +0000)]
[InstCombine][X86] Regenerate masked memory op combine tests

llvm-svn: 280960

7 years ago[InstCombine][X86] Regenerate vperm2f128/vperm2i128 combine tests
Simon Pilgrim [Thu, 8 Sep 2016 16:30:46 +0000 (16:30 +0000)]
[InstCombine][X86] Regenerate vperm2f128/vperm2i128 combine tests

llvm-svn: 280959

7 years agoReally fix warnings about passing -std=gnu99 to MSVC
Reid Kleckner [Thu, 8 Sep 2016 16:25:34 +0000 (16:25 +0000)]
Really fix warnings about passing -std=gnu99 to MSVC

llvm-svn: 280958

7 years ago[InstCombine][X86] Regenerate insertps combine tests
Simon Pilgrim [Thu, 8 Sep 2016 16:15:21 +0000 (16:15 +0000)]
[InstCombine][X86] Regenerate insertps combine tests

llvm-svn: 280957

7 years ago[Coverage] Delete some dead code (NFC)
Vedant Kumar [Thu, 8 Sep 2016 16:14:14 +0000 (16:14 +0000)]
[Coverage] Delete some dead code (NFC)

llvm-svn: 280956

7 years agoAdd streamexecutor-config
Jason Henline [Thu, 8 Sep 2016 16:12:33 +0000 (16:12 +0000)]
Add streamexecutor-config

Summary:
Similar to llvm-config, gets command-line flags that are needed to build
applications linking against StreamExecutor.

Reviewers: jprice, jlebar

Subscribers: beanz, parallel_libs-commits

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

llvm-svn: 280955

7 years agoRevert "[ESan][MIPS] Adds support for MIPS64"
Qin Zhao [Thu, 8 Sep 2016 16:09:46 +0000 (16:09 +0000)]
Revert "[ESan][MIPS] Adds support for MIPS64"

Summary:
This reverts commit 62b3eecdbe72af0255f0639b0446087a47efbf48. (D23799)

The CL cause 13 ESan test failure on x86_64:
Failing Tests (13):
    EfficiencySanitizer-x86_64 :: TestCases/large-stack-linux.c
    EfficiencySanitizer-x86_64 :: TestCases/libc-intercept.c
    EfficiencySanitizer-x86_64 :: TestCases/mmap-shadow-conflict.c
    EfficiencySanitizer-x86_64 :: TestCases/struct-simple.cpp
    EfficiencySanitizer-x86_64 :: TestCases/verbose-simple.c
    EfficiencySanitizer-x86_64 :: TestCases/workingset-early-fault.c
    EfficiencySanitizer-x86_64 :: TestCases/workingset-memset.cpp
    EfficiencySanitizer-x86_64 :: TestCases/workingset-midreport.cpp
    EfficiencySanitizer-x86_64 :: TestCases/workingset-samples.cpp
    EfficiencySanitizer-x86_64 :: TestCases/workingset-signal-posix.cpp
    EfficiencySanitizer-x86_64 :: TestCases/workingset-simple.cpp
    EfficiencySanitizer-x86_64 :: Unit/circular_buffer.cpp
    EfficiencySanitizer-x86_64 :: Unit/hashtable.cpp

  Unexpected Failures: 13

Reviewers: bruening, slthakur

Subscribers: sdardis, kubabrecka, beanz

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

llvm-svn: 280954

7 years ago[compiler-rt] Don't use -fPIC when building for Windows
Francis Ricci [Thu, 8 Sep 2016 15:57:22 +0000 (15:57 +0000)]
[compiler-rt] Don't use -fPIC when building for Windows

Summary: This flag doesn't make sense on Windows systems.

Reviewers: beanz, kubabrecka, compnerd

Subscribers: dberris, llvm-commits, beanz

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

llvm-svn: 280953

7 years ago[TableGen] AsmMatcher: Add AsmVariantName to Instruction class.
Sam Kolton [Thu, 8 Sep 2016 15:50:52 +0000 (15:50 +0000)]
[TableGen] AsmMatcher: Add AsmVariantName to Instruction class.

Summary:
This allows specifying instructions that are available only in specific assembler variant. If AsmVariantName is specified then instruction will be presented only in MatchTable for this variant. If not specified then assembler variants will be determined based on AsmString.
Also this allows splitting assembler match tables in same way as it is done in dissasembler.

Reviewers: ab, tstellarAMD, craig.topper, vpykhtin

Subscribers: wdng

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

llvm-svn: 280952

7 years agoRemove restriction that 'sret' must be on the first parameter
Reid Kleckner [Thu, 8 Sep 2016 15:45:27 +0000 (15:45 +0000)]
Remove restriction that 'sret' must be on the first parameter

On Windows, it is often applied to the second parameter, and the x86
backend is prepared to deal with sret appearing on any parameter.

Other backends assume it only appears on parameter zero, but those are
target-specific requirements, and not an IR-level rule.

llvm-svn: 280951

7 years agoGive an x86 assembler test a triple
Reid Kleckner [Thu, 8 Sep 2016 15:40:43 +0000 (15:40 +0000)]
Give an x86 assembler test a triple

llvm-svn: 280950

7 years agorevert r280427
Dehao Chen [Thu, 8 Sep 2016 15:25:12 +0000 (15:25 +0000)]
revert r280427

Refactor replaceDominatedUsesWith to have a flag to control whether to replace uses in BB itself.

Summary: This is in preparation for LoopSink pass which calls replaceDominatedUsesWith to update after sinking.
llvm-svn: 280949

7 years agoAdd -polly-flatten-schedule pass.
Michael Kruse [Thu, 8 Sep 2016 15:02:36 +0000 (15:02 +0000)]
Add -polly-flatten-schedule pass.

The -polly-flatten-schedule pass reduces the number of scattering
dimensions in its isl_union_map form to make them easier to understand.
It is not meant to be used in production, only for debugging and
regression tests.

To illustrate, how it can make sets simpler, here is a lifetime set
used computed by the porposed DeLICM pass without flattening:

    { Stmt_reduction_for[0, 4] -> [0, 2, o2, o3] : o2 < 0;
      Stmt_reduction_for[0, 4] -> [0, 1, o2, o3] : o2 >= 5;
      Stmt_reduction_for[0, 4] -> [0, 1, 4, o3] : o3 > 0;
      Stmt_reduction_for[0, i1] -> [0, 1, i1, 1] : 0 <= i1 <= 3;
      Stmt_reduction_for[0, 4] -> [0, 2, 0, o3] : o3 <= 0 }

And here the same lifetime for a semantically identical one-dimensional
schedule:

    { Stmt_reduction_for[0, i1] -> [2 + 3i1] : 0 <= i1 <= 4 }

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

llvm-svn: 280948

7 years agoHandle globs in global symbol names.
Rafael Espindola [Thu, 8 Sep 2016 14:50:55 +0000 (14:50 +0000)]
Handle globs in global symbol names.

Fixes pr28775.

llvm-svn: 280947

7 years agoGICHelper: Correctly assign return value
Tobias Grosser [Thu, 8 Sep 2016 14:34:54 +0000 (14:34 +0000)]
GICHelper: Correctly assign return value

... to preserve reference counting logic.

In practice the missing assignment would not have caused any issues. We still
fix it as the code is wrong and it also causes noise in the clang static
analysis runs.

llvm-svn: 280946

7 years ago[asan] Fix handle_abort_on_error.cc test on Darwin
Kuba Brecka [Thu, 8 Sep 2016 14:32:11 +0000 (14:32 +0000)]
[asan] Fix handle_abort_on_error.cc test on Darwin

r280885 added a testcase for handle_abort, which is broken on macOS, let’s add this support into sanitizer_mac.cc.

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

llvm-svn: 280945

7 years agoAdded 'inline' attribute to basic_string's destructor
Aditya Kumar [Thu, 8 Sep 2016 14:31:44 +0000 (14:31 +0000)]
Added 'inline' attribute to basic_string's destructor

Author: laxmansole

Reviewers: howard.hinnant
           mclow.lists
Subscribers: EricWF, flyingforyou, evandro

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

Currently basic_string's destructor is not getting inlined. So adding 'inline' attribute to ~basic_string().
Worked in collaboration with Aditya Kumar.

llvm-svn: 280944

7 years agoSCEVAffinator: Add missing __isl_take annotations
Tobias Grosser [Thu, 8 Sep 2016 14:31:31 +0000 (14:31 +0000)]
SCEVAffinator: Add missing __isl_take annotations

llvm-svn: 280943

7 years agoFix for rL280668, Intel(R) Memory Protection Extensions (Intel(R) MPX) support.
Valentina Giusti [Thu, 8 Sep 2016 14:16:45 +0000 (14:16 +0000)]
Fix for rL280668, Intel(R) Memory Protection Extensions (Intel(R) MPX) support.

Summary: Signed-off-by: Valentina Giusti <valentina.giusti@intel.com>

Reviewers: dvlahovski, granata.enrico, clayborg, labath

Subscribers: lldb-commits

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

llvm-svn: 280942

7 years agoUse a protected destructor instead of a virtual one.
Rafael Espindola [Thu, 8 Sep 2016 14:11:08 +0000 (14:11 +0000)]
Use a protected destructor instead of a virtual one.

llvm-svn: 280941

7 years agoScopInfo: Make clear that no double-free problem exists
Tobias Grosser [Thu, 8 Sep 2016 14:08:07 +0000 (14:08 +0000)]
ScopInfo: Make clear that no double-free problem exists

When running the clang static analyser to check for memory issues, this code
originally showed a double free, as the analyser was unable to understand that
isl_set_free always returns NULL and consequently later uses of the isl object
we just freed will never be reached. Without this knowledge, the analyser has
to issue a warning.

We refactor the code to make it clear that for empty maps the current loop
iteration is aborted.

llvm-svn: 280940

7 years agoScopDetection: Make sure we do not accidentally divide by zero
Tobias Grosser [Thu, 8 Sep 2016 14:08:05 +0000 (14:08 +0000)]
ScopDetection: Make sure we do not accidentally divide by zero

This code path is likely never triggered, but by still handling this case
locally we avoid warnings in clangs static analyzer.

llvm-svn: 280939

7 years agoDependenceInfo: Make clear that no double-free problem exists
Tobias Grosser [Thu, 8 Sep 2016 14:08:01 +0000 (14:08 +0000)]
DependenceInfo: Make clear that no double-free problem exists

When running the clang static analyser to check for memory issues, this code
originally showed a double free, as the analyser was unable to understand that
isl_union_map_free always returns NULL and consequently later uses of the isl
object we just freed will never be reached. Without this knowledge, the analyser
has to issue a warning.

We refactor the code to make it clear that for empty maps the current loop
iteration is aborted.

llvm-svn: 280938

7 years agoCompute section names only once.
Rafael Espindola [Thu, 8 Sep 2016 14:06:08 +0000 (14:06 +0000)]
Compute section names only once.

This simplifies error handling as there is now only one place in the
code that needs to consider the possibility that the name is
corrupted. Before we would do it in every access.

llvm-svn: 280937

7 years agoIslNodeBuilder: Add missing __isl_take annotations
Tobias Grosser [Thu, 8 Sep 2016 13:48:55 +0000 (13:48 +0000)]
IslNodeBuilder: Add missing __isl_take annotations

llvm-svn: 280936

7 years ago[ARM XRay] Try to fix Thumb-only failure
Renato Golin [Thu, 8 Sep 2016 13:45:10 +0000 (13:45 +0000)]
[ARM XRay] Try to fix Thumb-only failure

I mised the check that it had to support ARM to work. This commit tries
to fix that, to make sure we don't emit ARM code in Thumb-only mode.

llvm-svn: 280935

7 years ago[asan] Handle SIGBART signal description. (found by buildbot)
Filipe Cabecinhas [Thu, 8 Sep 2016 13:28:26 +0000 (13:28 +0000)]
[asan] Handle SIGBART signal description. (found by buildbot)

llvm-svn: 280934

7 years agoFix -Wcovered-switch-default warning in AppleObjCRuntimeV2.cpp
Ed Maste [Thu, 8 Sep 2016 13:17:42 +0000 (13:17 +0000)]
Fix -Wcovered-switch-default warning in AppleObjCRuntimeV2.cpp

The switch coveres all possible values. If a new one is added in the
future the compiler will start warning, providing a notification that
the switch needs updating.

llvm-svn: 280933

7 years ago[SDAGBuilder] Don't create a binary tree for switches in minsize mode
James Molloy [Thu, 8 Sep 2016 13:12:22 +0000 (13:12 +0000)]
[SDAGBuilder] Don't create a binary tree for switches in minsize mode

This bloats codesize - all of the non-leaf nodes are extra code.

llvm-svn: 280932

7 years agoFix unused variable and integer sign warnings from r280906
Ed Maste [Thu, 8 Sep 2016 13:11:31 +0000 (13:11 +0000)]
Fix unused variable and integer sign warnings from r280906

llvm-svn: 280931

7 years ago[asan] Reify ErrorDeadlySignal
Filipe Cabecinhas [Thu, 8 Sep 2016 12:58:15 +0000 (12:58 +0000)]
[asan] Reify ErrorDeadlySignal

Summary: Keep reifying other errors.

Reviewers: kcc, samsonov

Subscribers: llvm-commits, kubabrecka

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

llvm-svn: 280930

7 years ago[Thumb1] AND with a constant operand can be converted into BIC
James Molloy [Thu, 8 Sep 2016 12:58:12 +0000 (12:58 +0000)]
[Thumb1] AND with a constant operand can be converted into BIC

So model the cost of materializing the constant operand C as the minimum of
C and ~C.

llvm-svn: 280929

7 years ago[Thumb1] Fix cost calculation for complemented immediates
James Molloy [Thu, 8 Sep 2016 12:58:04 +0000 (12:58 +0000)]
[Thumb1] Fix cost calculation for complemented immediates

Materializing something like "-3" can be done as 2 instructions:
  MOV r0, #3
  MVN r0, r0

This has a cost of 2, not 3. It looks like we were already trying to detect this pattern in TII::getIntImmCost(), but were taking the complement of the zero-extended value instead of the sign-extended value which is unlikely to ever produce a number < 256.

There were no tests failing after changing this... :/

llvm-svn: 280928

7 years ago[SelectionDAG] Add BUILD_VECTOR support to computeKnownBits and SimplifyDemandedBits
Simon Pilgrim [Thu, 8 Sep 2016 12:57:51 +0000 (12:57 +0000)]
[SelectionDAG] Add BUILD_VECTOR support to computeKnownBits and SimplifyDemandedBits

Add the ability to computeKnownBits and SimplifyDemandedBits to extract the known zero/one bits from BUILD_VECTOR, returning the known bits that are shared by every vector element.

This is an initial step towards determining the sign bits of a vector (PR29079).

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

llvm-svn: 280927

7 years ago[DAGCombiner] Enable AND combines of splatted constant vectors
Simon Pilgrim [Thu, 8 Sep 2016 12:36:39 +0000 (12:36 +0000)]
[DAGCombiner] Enable AND combines of splatted constant vectors

Allow AND combines to use a vector splatted constant as well as a constant scalar.

Preliminary part of D24253.

llvm-svn: 280926

7 years agoPack InputSectionData from 72 to 64 bytes. NFC.
Rafael Espindola [Thu, 8 Sep 2016 12:33:41 +0000 (12:33 +0000)]
Pack InputSectionData from 72 to 64 bytes. NFC.

llvm-svn: 280925

7 years agoLLDB: API for iPermission of object file's sections
Abhishek Aggarwal [Thu, 8 Sep 2016 12:22:56 +0000 (12:22 +0000)]
LLDB: API for iPermission of object file's sections

 Summary:
 - Added an API to public interface that provides permissions (RWX) of
   individual sections of an object file

 - Earlier, there was no way to find out this information through SB
   APIs

 - A possible use case of this API is:
   when a user wants to know the sections that have executable machine
   instructions and want to write a tool on top of LLDB based on this
   information

 - Differential Revision: https://reviews.llvm.org/D24251

llvm-svn: 280924

7 years agoScopInfo: Add missing __isl_take annotation
Tobias Grosser [Thu, 8 Sep 2016 11:18:56 +0000 (11:18 +0000)]
ScopInfo: Add missing __isl_take annotation

llvm-svn: 280923

7 years agoFix test breakage in r280919
Pavel Labath [Thu, 8 Sep 2016 11:09:14 +0000 (11:09 +0000)]
Fix test breakage in r280919

It turns out that self.dbg.GetSelectedPlatform().GetTriple() is not a good way
to get the triple of the process, as it returns the incorrect triple in case of a
32-bit process running on a 64-bit platform.

Instead, go the long way round and ask the stub for the process triple. This
fixes the test for i386.

llvm-svn: 280922

7 years agoMoved unreachable to appease msvc, gcc and clang
Simon Pilgrim [Thu, 8 Sep 2016 11:03:41 +0000 (11:03 +0000)]
Moved unreachable to appease msvc, gcc and clang

llvm-svn: 280921

7 years ago[tsan] Support C++11 call_once in TSan on Darwin
Kuba Brecka [Thu, 8 Sep 2016 10:15:20 +0000 (10:15 +0000)]
[tsan] Support C++11 call_once in TSan on Darwin

This patch adds a wrapper for call_once, which uses an already-compiled helper __call_once with an atomic release which is invisible to TSan. To avoid false positives, the interceptor performs an explicit atomic release in the callback wrapper.

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

llvm-svn: 280920

7 years agogdb-remote: Add jModulesInfo packet
Pavel Labath [Thu, 8 Sep 2016 10:07:04 +0000 (10:07 +0000)]
gdb-remote: Add jModulesInfo packet

Summary:
This adds the jModulesInfo packet, which is the equivalent of qModulesInfo, but it enables us to
query multiple modules at once. This makes a significant speed improvement in case the
application has many (over a hundred) modules, and the communication link has a non-negligible
latency. This functionality is accessed by ProcessGdbRemote::PrefetchModuleSpecs(), which does
the caching. GetModuleSpecs() is modified to first consult the cache before asking the remote
stub. PrefetchModuleSpecs is currently only called from POSIX-DYLD dynamic loader plugin, after
it reads the list of modules from the inferior memory, but other uses are possible.

This decreases the attach time to an android application by about 40%.

Reviewers: clayborg

Subscribers: tberghammer, lldb-commits, danalbert

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

llvm-svn: 280919

7 years agoRevert "[ARM] Lower UDIV+UREM to UDIV+MLS (and the same for SREM)"
Pablo Barrio [Thu, 8 Sep 2016 10:05:57 +0000 (10:05 +0000)]
Revert "[ARM] Lower UDIV+UREM to UDIV+MLS (and the same for SREM)"

This reverts commit r280808.

It is possible that this change results in an infinite loop. This
is causing timeouts in some tests on ARM, and a Chromebook bot is
failing.

llvm-svn: 280918

7 years agoFixed a 'not all control paths return a value' warning on MSVC builds
Simon Pilgrim [Thu, 8 Sep 2016 09:59:58 +0000 (09:59 +0000)]
Fixed a 'not all control paths return a value' warning on MSVC builds

llvm-svn: 280917

7 years ago[ELF] - Add virtual destructor to LinkerScriptBase class. NFC.
George Rimar [Thu, 8 Sep 2016 09:59:13 +0000 (09:59 +0000)]
[ELF] - Add virtual destructor to LinkerScriptBase class. NFC.

Absence of it caused a clang warning:
warning: 'lld::elf::LinkerScriptBase' has virtual functions but non-virtual destructor [-Wnon-virtual-dtor]

At fact we don't need it here because do not destroy this object by
base pointer.

llvm-svn: 280916

7 years agoLinker script: implement ALIGNOF
Eugene Leviant [Thu, 8 Sep 2016 09:08:30 +0000 (09:08 +0000)]
Linker script: implement ALIGNOF

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

llvm-svn: 280915

7 years ago[ELF][MIPS] Fix initialization of TLS-related GOT entries
Simon Atanasyan [Thu, 8 Sep 2016 09:07:19 +0000 (09:07 +0000)]
[ELF][MIPS] Fix initialization of TLS-related GOT entries

This patch allows static linking of TLS code. To do that it fixes
GOT entries initialization.

If TLS-related GOT entry created for a preemptible symbol i.e. has
a corresponding dynamic relocation, leave the entry initialized by zero.
Write down adjusted TLS symbol's values otherwise. For the adjustments
calculation use offsets for thread-local storage.

https://www.linux-mips.org/wiki/NPTL

llvm-svn: 280914

7 years ago[ELF][MIPS] Update the comment
Simon Atanasyan [Thu, 8 Sep 2016 09:07:12 +0000 (09:07 +0000)]
[ELF][MIPS] Update the comment

llvm-svn: 280913

7 years agoSet entry address to 0x0 if no _start symbol
Eugene Leviant [Thu, 8 Sep 2016 08:57:51 +0000 (08:57 +0000)]
Set entry address to 0x0 if no _start symbol

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

llvm-svn: 280912

7 years ago[ELF] - Apply clang-format to LinkerScript.cpp, NFC.
George Rimar [Thu, 8 Sep 2016 08:20:30 +0000 (08:20 +0000)]
[ELF] - Apply clang-format to LinkerScript.cpp, NFC.

llvm-svn: 280911

7 years ago[ELF] - Linkerscript: simplify access to templated methods from parser.
George Rimar [Thu, 8 Sep 2016 08:19:13 +0000 (08:19 +0000)]
[ELF] - Linkerscript: simplify access to templated methods from parser.

Previous way of accessing templated methods was a bit bulky,
Patch introduces small interface based solution.

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

llvm-svn: 280910

7 years ago[mips][microMIPS] Implement DBITSWAP, DLSA and LWUPC and add tests for AUI instructions
Hrvoje Varga [Thu, 8 Sep 2016 07:41:43 +0000 (07:41 +0000)]
[mips][microMIPS] Implement DBITSWAP, DLSA and LWUPC and add tests for AUI instructions
Differential Revision: https://reviews.llvm.org/D16452

llvm-svn: 280909

7 years ago[asan] Test that asan does not report use-after-scope if program jumped over variable...
Vitaly Buka [Thu, 8 Sep 2016 06:43:02 +0000 (06:43 +0000)]
[asan] Test that asan does not report use-after-scope if program jumped over variable declaration.

Summary:
Test to check if PR28267 workaround works.

PR28267
PR27453

Reviewers: eugenis

Subscribers: llvm-commits, kubabrecka

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

llvm-svn: 280908

7 years ago[asan] Avoid lifetime analysis for allocas with can be in ambiguous state
Vitaly Buka [Thu, 8 Sep 2016 06:27:58 +0000 (06:27 +0000)]
[asan] Avoid lifetime analysis for allocas with can be in ambiguous state

Summary:
C allows to jump over variables declaration so lifetime.start can be
avoid before variable usage. To avoid false-positives on such rare cases
we detect them and remove from lifetime analysis.

PR27453
PR28267

Reviewers: eugenis

Subscribers: llvm-commits

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

llvm-svn: 280907

7 years agoI'm experimenting with changing how the mixed source & assembly
Jason Molenda [Thu, 8 Sep 2016 05:12:41 +0000 (05:12 +0000)]
I'm experimenting with changing how the mixed source & assembly
mode in lldb works.  I've been discussing this with Jim Ingham,
Greg Clayton, and Kate Stone for the past week or two.

Previously lldb would print three source lines (centered on the
line table entry line for the current line) followed by the assembly.
It would print the context information (module`function + offset)
before those three lines of source.

Now lldb will print up to two lines before/after the line table
entry.  It prints two '*' characters for the line table line to
make it clear what line is showing assembly.  There is one line of
whitespace before/after the source lines so the separation between
source & assembly is clearer.  I don't print the context line
(module`function + offset).  I stop printing context lines if it's
a different line table entry, or if it's a source line I've already
printed as context to another source line.  If I have two line table
entries one after another for the same source line (I get these often
with clang - with different column information in them), I only print
the source line once.

I'm also using the target.process.thread.step-avoid-regexp setting
(which keeps you from stepping into STL functions that have been inlined
into your own code) and avoid printing any source lines from functions
that match that regexp.

When lldb disassembles into a new function, it will try to find the
declaration line # for the function and print all of the source lines
between the decl and the first line table entry (usually a { curly brace)
so we have a good chance of including the arguments, at least with the
debug info emitted by clang.

Finally, the # of source lines of context to show has been separated
from whether we're doing mixed source & assembly or not.  Previously
specifying 0 lines of context would turn off mixed source & assembly.

I think there's room for improvement, and maybe some bugs I haven't
found yet, but it's in good enough shape to upstream and iterate at
this point.

I'm not sure how best to indicate which source line is the actual line
table # versus context lines.  I'm using '**' right now.  Both Kate
and Greg had the initial idea to reuse '->' (normally used to indicate
"currently executing source line") - I tried it but I wasn't thrilled,
I'm too used to the established meaning of ->.

Greg had the interesting idea of avoiding context source lines only
in two line table entries in the same source file.  So we'd print
two lines before & after a source line, and then the next line table
entry (if it was on the next source line after those two context lines)
we'd display only the following two lines -- the previous two had just
been printed.  If an inline source line was printed between these two,
though, we'd print the context lines for both of them.  It's an
interesting idea, and I want to see how it works with both -O0 and -O3
codegen where we have different amounts of inlining.

<rdar://problem/27961419>

llvm-svn: 280906

7 years agoRevert "[LoopUnroll] Properly update loop-info when cloning prologues and epilogues."
Michael Zolotukhin [Thu, 8 Sep 2016 03:51:30 +0000 (03:51 +0000)]
Revert "[LoopUnroll] Properly update loop-info when cloning prologues and epilogues."

This reverts commit r280901.

This caused a bunch of failures, reverting it until I investigate them.

llvm-svn: 280905

7 years agoRename test file. NFC.
Rui Ueyama [Thu, 8 Sep 2016 03:08:05 +0000 (03:08 +0000)]
Rename test file. NFC.

llvm-svn: 280904

7 years agoI had a problem with one SDK where dispatch_release was actually a
Jason Molenda [Thu, 8 Sep 2016 02:29:40 +0000 (02:29 +0000)]
I had a problem with one SDK where dispatch_release was actually a
macro, so writing ::dispatch_release did not work as expected.
Remove the global anon namespace :: designation; the header will
get us the correct declaration.

llvm-svn: 280903

7 years agoForce the initialization of the m_type ivar in
Jason Molenda [Thu, 8 Sep 2016 02:26:58 +0000 (02:26 +0000)]
Force the initialization of the m_type ivar in
Function::GetStartLineSourceInfo before we try to
return the start line information about a function;
this function requires it to have been initialized.

llvm-svn: 280902

7 years ago[LoopUnroll] Properly update loop-info when cloning prologues and epilogues.
Michael Zolotukhin [Thu, 8 Sep 2016 01:52:26 +0000 (01:52 +0000)]
[LoopUnroll] Properly update loop-info when cloning prologues and epilogues.

Summary:
When cloning blocks for prologue/epilogue we need to replicate the loop
structure from the original loop. It wasn't a problem for the innermost
loops, but it led to an incorrect loop info when we unrolled a loop with
a child loop - in this case created prologue-loop had a child loop, but
loop info didn't reflect that.

This fixes PR28888.

Reviewers: chandlerc, sanjoy, hfinkel

Subscribers: llvm-commits, silvas

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

llvm-svn: 280901

7 years agoCorrectly escape %.
Nico Weber [Thu, 8 Sep 2016 01:46:52 +0000 (01:46 +0000)]
Correctly escape %.

Found be an MSVC warning; I filed PR30320 for adding a similar warning to clang.

llvm-svn: 280900

7 years agoAdd explicit casts to size_t to try to appease MSVC.
Peter Collingbourne [Thu, 8 Sep 2016 01:45:28 +0000 (01:45 +0000)]
Add explicit casts to size_t to try to appease MSVC.

llvm-svn: 280899

7 years ago[llvm-cov] Disable zlib compression in a test input, unbreaks bots
Vedant Kumar [Thu, 8 Sep 2016 01:19:29 +0000 (01:19 +0000)]
[llvm-cov] Disable zlib compression in a test input, unbreaks bots

Disable name compression in the inputs used to produce
multiple-files.covmapping. Should fix bots which don't compile with
zlib:

  http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/19610/steps/test/logs/stdio

llvm-svn: 280898

7 years agoCodeGen: Clean up implementation of vtable initializer builder. NFC.
Peter Collingbourne [Thu, 8 Sep 2016 01:14:39 +0000 (01:14 +0000)]
CodeGen: Clean up implementation of vtable initializer builder. NFC.

- Simplify signature of CreateVTableInitializer function.
- Move vtable component builder to a separate function.
- Remove unnecessary accessors from VTableLayout class.

This is in preparation for a future change that will alter the type of the
vtable initializer.

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

llvm-svn: 280897

7 years ago[llvm-cov] Use less space to describe source names
Vedant Kumar [Thu, 8 Sep 2016 00:56:48 +0000 (00:56 +0000)]
[llvm-cov] Use less space to describe source names

In r279628, we made SourceCoverageView list the binary associated with a
view and started adding labels (e.g "Source: foo" or "Function: bar") to
everything. Condense this information a bit to unclutter reports.

llvm-svn: 280896

7 years ago[llvm-cov] Drop the longest common filename prefix from summaries
Vedant Kumar [Thu, 8 Sep 2016 00:56:43 +0000 (00:56 +0000)]
[llvm-cov] Drop the longest common filename prefix from summaries

Remove the longest common prefix from filenames when printing coverage
summaries. This makes them easier to compare.

llvm-svn: 280895

7 years ago[CGP] Be less conservative about tail-duplicating a ret to allow tail calls
Michael Kuperstein [Thu, 8 Sep 2016 00:48:37 +0000 (00:48 +0000)]
[CGP] Be less conservative about tail-duplicating a ret to allow tail calls

CGP tail-duplicates rets into blocks that end with a call that feed the ret.
This puts the call in tail position, potentially allowing the DAG builder to
lower it as a tail call. To avoid tail duplication in cases where we won't
form the tail call, CGP tried to predict whether this is going to be possible,
and avoids doing it when lowering as a tail call will definitely fail.
However, it was being too conservative by always throwing away calls to
functions with a signext/zeroext attribute on the return type.

Instead, we can use the same logic the builder uses to determine whether the
attributes work out.

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

llvm-svn: 280894

7 years ago[AA] Fix typo in comment (s/hase/has).
Justin Lebar [Thu, 8 Sep 2016 00:48:12 +0000 (00:48 +0000)]
[AA] Fix typo in comment (s/hase/has).

llvm-svn: 280893

7 years agoRemove lldb coding conventions as they are no longer relevant.
Jim Ingham [Thu, 8 Sep 2016 00:42:02 +0000 (00:42 +0000)]
Remove lldb coding conventions as they are no longer relevant.

llvm-svn: 280892

7 years ago[XRay] Remove unused variable
Dean Michael Berris [Thu, 8 Sep 2016 00:38:22 +0000 (00:38 +0000)]
[XRay] Remove unused variable

llvm-svn: 280891

7 years ago[XRay] ARM 32-bit no-Thumb support in compiler-rt
Dean Michael Berris [Thu, 8 Sep 2016 00:28:26 +0000 (00:28 +0000)]
[XRay] ARM 32-bit no-Thumb support in compiler-rt

This is a port of XRay to ARM 32-bit, without Thumb support yet.
This is one of 3 commits to different repositories of XRay ARM port. The
other 2 are:

1. https://reviews.llvm.org/D23931 (LLVM)
2. https://reviews.llvm.org/D23932 (Clang test)

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

llvm-svn: 280890

7 years ago[XRay] ARM 32-bit no-Thumb support in Clang
Dean Michael Berris [Thu, 8 Sep 2016 00:23:28 +0000 (00:23 +0000)]
[XRay] ARM 32-bit no-Thumb support in Clang

Just a test for now, adapted from x86_64 tests of XRay.
This is one of 3 commits to different repositories of XRay ARM port. The
other 2 are:

1. https://reviews.llvm.org/D23931 (LLVM)
2. https://reviews.llvm.org/D23933 (compiler-rt)

Differential Review: https://reviews.llvm.org/D23932

llvm-svn: 280889

7 years ago[XRay] ARM 32-bit no-Thumb support in LLVM
Dean Michael Berris [Thu, 8 Sep 2016 00:19:04 +0000 (00:19 +0000)]
[XRay] ARM 32-bit no-Thumb support in LLVM

This is a port of XRay to ARM 32-bit, without Thumb support yet. The XRay instrumentation support is moving up to AsmPrinter.
This is one of 3 commits to different repositories of XRay ARM port. The other 2 are:

1. https://reviews.llvm.org/D23932 (Clang test)
2. https://reviews.llvm.org/D23933 (compiler-rt)

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

llvm-svn: 280888

7 years agoDeleted right file
Piotr Padlewski [Wed, 7 Sep 2016 23:46:52 +0000 (23:46 +0000)]
Deleted right file

llvm-svn: 280887

7 years agoRevert "[thinlto] Deleted unused test file"
Piotr Padlewski [Wed, 7 Sep 2016 23:46:50 +0000 (23:46 +0000)]
Revert "[thinlto] Deleted unused test file"

This reverts commit a7ad00460027c4a92640c2a5706a7d1869b60989.

llvm-svn: 280886

7 years ago[sanitizer] Fix a conflict between abort_on_error and handle_abort.
Evgeniy Stepanov [Wed, 7 Sep 2016 23:40:53 +0000 (23:40 +0000)]
[sanitizer] Fix a conflict between abort_on_error and handle_abort.

Reset the SIGABRT signal handler before calling abort().

Also, change the error message when catching SIGABRT to say "ABRT"
instead of "SEGV".

llvm-svn: 280885

7 years agoIR: Remove Value::intersectOptionalDataWith, replace all calls with calls to Instruct...
Peter Collingbourne [Wed, 7 Sep 2016 23:39:04 +0000 (23:39 +0000)]
IR: Remove Value::intersectOptionalDataWith, replace all calls with calls to Instruction::andIRFlags.

The two functions are functionally equivalent.

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

llvm-svn: 280884

7 years agoRevert "[asan] Avoid lifetime analysis for allocas with can be in ambiguous state"
Vitaly Buka [Wed, 7 Sep 2016 23:37:15 +0000 (23:37 +0000)]
Revert "[asan] Avoid lifetime analysis for allocas with can be in ambiguous state"

Fails on Windows.

This reverts commit r280880.

llvm-svn: 280883

7 years ago[thinlto] Deleted unused test file
Piotr Padlewski [Wed, 7 Sep 2016 23:35:46 +0000 (23:35 +0000)]
[thinlto] Deleted unused test file

Summary:
This file should be referenced from
thinlto-function-summary-callgraph-pgo.ll file,
but someone forgot to use it there. Everything worked because
we store pgo data about callsite blocks, so there is no need to have
pgo count of @func.

Reviewers: tejohnson, eraman, mehdi_amini

Subscribers: mehdi_amini, llvm-commits

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

llvm-svn: 280882