platform/upstream/llvm.git
8 years agoUpdate comment in lldb-enumerations.h
Pavel Labath [Fri, 22 Apr 2016 08:41:07 +0000 (08:41 +0000)]
Update comment in lldb-enumerations.h

llvm-svn: 267124

8 years ago[X86]: Changing cost for “TRUNCATE v16i32 to v16i8” in SSE4.1 mode.
Ashutosh Nema [Fri, 22 Apr 2016 08:34:05 +0000 (08:34 +0000)]
[X86]: Changing cost for “TRUNCATE v16i32 to v16i8” in SSE4.1 mode.

Summary:
rL256194 transforms truncations between vectors of integers into PACKUS/PACKSS
operations during DAG combine. This generates better code for truncate, so cost
of truncate needs to be changed but looks like it got changed only in SSE2 table
Whereas this change is also applicable for SSE4.1, so the cost of truncate needs
to be changed for that as well. Cost of “TRUNCATE v16i32 to v16i8” & “TRUNCATE
v16i16 to v16i8” should be same in SSE4.1 & SSE2 table. Removing their cost from
SSE4.1, so it will fall back to SSE2.

Reviewers: Simon Pilgrim
llvm-svn: 267123

8 years ago[Sparc] This provides support for itineraries on Sparc.
Chris Dewhurst [Fri, 22 Apr 2016 08:17:17 +0000 (08:17 +0000)]
[Sparc] This provides support for itineraries on Sparc.

Specifically, itineraries for LEON processors has been added, along with several LEON processor Subtargets. Although currently all these targets are pretty much identical, support for features that will differ among these processors will be added in the very near future.

The different Instruction Itinerary Classes (IICs) added are sufficient to differentiate between the instruction timings used by LEON and, quite probably, by generic Sparc processors too, but the focus of the exercise has been for LEON processors, as the requirement of my project. If the IICs are not sufficient for other Sparc processor types and you want to add a new itinerary for one of those, it should be relatively trivial to adapt this.

As none of the LEON processors has Quad Floats, or is a Version 9 processor, none of those instructions have itinerary classes defined and revert to the default "NoItinerary" instruction itinerary.

Phabricator Review: http://reviews.llvm.org/D19359

llvm-svn: 267121

8 years agoThe following code would not work before this patch, due to the inability to take...
Chris Dewhurst [Fri, 22 Apr 2016 08:13:47 +0000 (08:13 +0000)]
The following code would not work before this patch, due to the inability to take the address of a global object:

void func1() {

...
}

int main(int argc, char** argv) {

void (*pFunc)();
pFunc = &func1
pFunc();
...
}

Phabricator review: http://reviews.llvm.org/D19368

llvm-svn: 267120

8 years agoAdd missing include of <algorithm>
Marshall Clow [Fri, 22 Apr 2016 07:39:05 +0000 (07:39 +0000)]
Add missing include of <algorithm>

llvm-svn: 267119

8 years ago[index] Add SymbolSubKinds for ObjC IB annotations.
Argyrios Kyrtzidis [Fri, 22 Apr 2016 07:21:16 +0000 (07:21 +0000)]
[index] Add SymbolSubKinds for ObjC IB annotations.

llvm-svn: 267118

8 years ago[index] Add a SymbolSubKind for an ObjC unit test.
Argyrios Kyrtzidis [Fri, 22 Apr 2016 07:21:10 +0000 (07:21 +0000)]
[index] Add a SymbolSubKind for an ObjC unit test.

llvm-svn: 267117

8 years ago[index] Change SymbolCXXTemplateKind to a 'SymbolSubKinds' bitset.
Argyrios Kyrtzidis [Fri, 22 Apr 2016 07:21:04 +0000 (07:21 +0000)]
[index] Change SymbolCXXTemplateKind to a 'SymbolSubKinds' bitset.

This provides a more general and flexible way to annotate special symbols.

llvm-svn: 267116

8 years agoRevert "Initial implementation of optimization bisect support."
Vedant Kumar [Fri, 22 Apr 2016 06:51:37 +0000 (06:51 +0000)]
Revert "Initial implementation of optimization bisect support."

This reverts commit r267022, due to an ASan failure:

  http://lab.llvm.org:8080/green/job/clang-stage2-cmake-RgSan_check/1549

llvm-svn: 267115

8 years ago[mips][microMIPS] Implement DVP, EVP and JALRC.HB instructions
Zlatko Buljan [Fri, 22 Apr 2016 06:44:34 +0000 (06:44 +0000)]
[mips][microMIPS] Implement DVP, EVP and JALRC.HB instructions
Differential Revision: http://reviews.llvm.org/D18687

llvm-svn: 267114

8 years ago[GVN] Respect fast-math-flags on fcmps
David Majnemer [Fri, 22 Apr 2016 06:37:51 +0000 (06:37 +0000)]
[GVN] Respect fast-math-flags on fcmps

We assumed that flags were only present on binary operators.  This is
not true, they may also be present on calls and fcmps.

llvm-svn: 267113

8 years agoFix some spelling mistakes
David Majnemer [Fri, 22 Apr 2016 06:37:48 +0000 (06:37 +0000)]
Fix some spelling mistakes

llvm-svn: 267112

8 years ago[EarlyCSE] Take the intersection of flags on instructions
David Majnemer [Fri, 22 Apr 2016 06:37:45 +0000 (06:37 +0000)]
[EarlyCSE] Take the intersection of flags on instructions

EarlyCSE had inconsistent behavior with regards to flag'd instructions:
- In some cases, it would pessimize if the available instruction had
  different flags by not performing CSE.
- In other cases, it would miscompile if it replaced an instruction
  which had no flags with an instruction which has flags.

Fix this by being more consistent with our flag handling by utilizing
andIRFlags.

llvm-svn: 267111

8 years ago[SCEV] Extract out a `isSCEVExprNeverPoison` helper; NFCI
Sanjoy Das [Fri, 22 Apr 2016 05:38:54 +0000 (05:38 +0000)]
[SCEV] Extract out a `isSCEVExprNeverPoison` helper; NFCI

Summary:
Also adds a small comment blurb on control flow + no-wrap flags, since
that question came up a few days back on llvm-dev.

Reviewers: bjarke.roune, broune

Subscribers: sanjoy, mcrosier, llvm-commits, mzolotukhin

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

llvm-svn: 267110

8 years ago[SystemZ] Mark CTTZ_ZERO_UNDEF/CTLZ_ZERO_UNDEF as Expand instead of Custom since...
Craig Topper [Fri, 22 Apr 2016 05:29:58 +0000 (05:29 +0000)]
[SystemZ] Mark CTTZ_ZERO_UNDEF/CTLZ_ZERO_UNDEF as Expand instead of Custom since the custom logic just did what Expand does when CTTZ/CTLZ are Legal. NFC

llvm-svn: 267109

8 years ago[Lanai] Set CTLZ_ZERO_UNDEF/CTTZ_ZERO_UNDEF to Expand instead of Legal so they will...
Craig Topper [Fri, 22 Apr 2016 05:13:01 +0000 (05:13 +0000)]
[Lanai] Set CTLZ_ZERO_UNDEF/CTTZ_ZERO_UNDEF to Expand instead of Legal so they will be converted to CTLZ/CTTZ by LegalizeDAG. Remove extra instructions that only existed to to contain patterns that match the zero_undef operations. NFC

llvm-svn: 267108

8 years ago[Lanai] Remove unused methods declarations. NFC
Craig Topper [Fri, 22 Apr 2016 05:12:57 +0000 (05:12 +0000)]
[Lanai] Remove unused methods declarations. NFC

llvm-svn: 267107

8 years agoClean the API for CollectAsmUndefinedRefs, taking a Triple and a String InlineAsm...
Mehdi Amini [Fri, 22 Apr 2016 04:58:12 +0000 (04:58 +0000)]
Clean the API for CollectAsmUndefinedRefs, taking a Triple and a String InlineAsm instead of a Module (NFC)

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 267106

8 years agoIRObjectFile, clang-format fixup for r267104
Mehdi Amini [Fri, 22 Apr 2016 04:49:46 +0000 (04:49 +0000)]
IRObjectFile, clang-format fixup for r267104

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 267105

8 years agoUse std::move on the enum to insert it into the pair to please MSVC
Mehdi Amini [Fri, 22 Apr 2016 04:45:57 +0000 (04:45 +0000)]
Use std::move on the enum to insert it into the pair to please MSVC

(I have no idea why is it needed)
Fixup for r267103

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 267104

8 years agoRefactor IRObjectFile, extract a static CollectAsmUndefinedRefs() method to parse...
Mehdi Amini [Fri, 22 Apr 2016 04:28:05 +0000 (04:28 +0000)]
Refactor IRObjectFile, extract a static CollectAsmUndefinedRefs() method to parse inline assembly (NFC)

I plan to call this from ThinLTOCodeGenerator.

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 267103

8 years agoAMDGPU/SI: add llvm.amdgcn.ps.live intrinsic
Nicolai Haehnle [Fri, 22 Apr 2016 04:04:08 +0000 (04:04 +0000)]
AMDGPU/SI: add llvm.amdgcn.ps.live intrinsic

Summary:
This intrinsic returns true if the current thread belongs to a live pixel
and false if it belongs to a pixel that we are executing only for derivative
computation. It will be used by Mesa to implement gl_HelperInvocation.

Note that for pixels that are killed during the shader, this implementation
also returns true, but it doesn't matter because those pixels are always
disabled in the EXEC mask.

This unearthed a corner case in the instruction verifier, which complained
about a v_cndmask 0, 1, exec, exec<imp-use> instruction. That's stupid but
correct code, so make the verifier accept it as such.

Reviewers: arsenm, tstellarAMD

Subscribers: arsenm, llvm-commits

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

llvm-svn: 267102

8 years ago[OPENMP] Fix for LCV in simd directives in explicit clauses.
Alexey Bataev [Fri, 22 Apr 2016 03:56:56 +0000 (03:56 +0000)]
[OPENMP] Fix for LCV in simd directives in explicit clauses.

If loop control variable for simd-based directives is explicitly marked
as linear/lastprivate in clauses, codegen for such construct would
crash. Patch fixes this problem.

llvm-svn: 267101

8 years ago[AVX512] Teach lowering to use vplzcntd/q to implement 128/256-bit CTTZ_ZERO_UNDEF...
Craig Topper [Fri, 22 Apr 2016 03:22:38 +0000 (03:22 +0000)]
[AVX512] Teach lowering to use vplzcntd/q to implement 128/256-bit CTTZ_ZERO_UNDEF even without VLX support. We can just extend to 512-bits and extract like we do for CTLZ.

llvm-svn: 267100

8 years agoValueMapper/Enumerator: Clean up code in post-order traversals, NFC
Duncan P. N. Exon Smith [Fri, 22 Apr 2016 02:33:06 +0000 (02:33 +0000)]
ValueMapper/Enumerator: Clean up code in post-order traversals, NFC

Re-layer the functions in the new (i.e., newly correct) post-order
traversals in ValueEnumerator (r266947) and ValueMapper (r266949).
Instead of adding a node to the worklist in a helper function and
returning a flag to say what happened, return the node itself.  This
makes the code way cleaner: the worklist is local to the main function,
there is no flag for an early loop exit (since we can cleanly bury the
loop), and it's perfectly clear when pointers into the worklist might be
invalidated.

I'm fixing both algorithms in the same commit to avoid repeating the
commit message; if you take the time to understand one the other should
be easy.  The diff itself isn't entirely obvious since the traversals
have some noise (i.e., things to do), but here's the high-level change:

    auto helper = [&WL](T *Op) {     auto helper = [](T **&I, T **E) {
                                 =>    while (I != E) {
      if (shouldVisit(Op)) {             T *Op = *I++;
        WL.push(Op, Op->begin());        if (shouldVisit(Op)) {
        return true;                       return Op;
      }                                }
      return false;                    return nullptr;
    };                               };
                                 =>
    WL.push(S, S->begin());          WL.push(S, S->begin());
    while (!empty()) {               while (!empty()) {
      auto *N = WL.top().N;            auto *N = WL.top().N;
      auto *&I = WL.top().I;           auto *&I = WL.top().I;
      bool DidChange = false;
      while (I != N->end())
        if (helper(*I++)) {      =>    if (T *Op = helper(I, N->end()) {
          DidChange = true;              WL.push(Op, Op->begin());
          break;                         continue;
        }                              }
      if (DidChange)
        continue;

      POT.push(WL.pop());        =>    POT.push(WL.pop());
    }                                }

Thanks to Mehdi for helping me find a better way to layer this.

llvm-svn: 267099

8 years ago[MachineCombiner] Support for floating-point FMA on ARM64
Gerolf Hoflehner [Fri, 22 Apr 2016 02:15:19 +0000 (02:15 +0000)]
[MachineCombiner] Support for floating-point FMA on ARM64

Evaluates fmul+fadd -> fmadd combines and similar code sequences in the
machine combiner. It adds support for float and double similar to the existing
integer implementation. The key features are:

- DAGCombiner checks whether it should combine greedily or let the machine
combiner do the evaluation. This is only supported on ARM64.
- It gives preference to throughput over latency: the heuristic used is
to combine always in loops. The targets decides whether the machine
combiner should optimize for throughput or latency.
- Supports for fmadd, f(n)msub, fmla, fmls patterns
- On by default at O3 ffast-math

llvm-svn: 267098

8 years ago[ThinLTO] Remove unused/incomplete lazy summary reading support (NFC)
Teresa Johnson [Fri, 22 Apr 2016 01:52:00 +0000 (01:52 +0000)]
[ThinLTO] Remove unused/incomplete lazy summary reading support (NFC)

This removes the interfaces added (and not yet complete) to support
lazy reading of summaries. This support is not expected to be needed
since we are moving to a model where the full index is only being
traversed in the thin link step, instead of the back ends.

(The second part of this that I plan to do next is remove the
GlobalValueInfo from the ModuleSummaryIndex - it was mostly needed to
support lazy parsing of summaries. The index can instead reference the
summary structures directly.)

llvm-svn: 267097

8 years agoUntabify.
NAKAMURA Takumi [Fri, 22 Apr 2016 01:33:50 +0000 (01:33 +0000)]
Untabify.

llvm-svn: 267096

8 years agoTry to fix UNRESOLVED: LLVM :: CodeGen/AArch64/arm64-regress-opt-cmp.s on bots.
Nico Weber [Fri, 22 Apr 2016 01:08:56 +0000 (01:08 +0000)]
Try to fix UNRESOLVED: LLVM :: CodeGen/AArch64/arm64-regress-opt-cmp.s on bots.

This test used to write a .s file until r266971 fixed that.  But on most bots,
the .s file still exists.  Add an rm statement to clean up the bots.  In a few
days, this statement can go away again.

llvm-svn: 267095

8 years ago[sanitizer] Allow the sanitizer allocator to use a non-fixed address range. An alloca...
Kostya Serebryany [Fri, 22 Apr 2016 01:08:54 +0000 (01:08 +0000)]
[sanitizer] Allow the sanitizer allocator to use a non-fixed address range. An allocator with a non-fixed address range will be attack-resistan. NFC for the sanitizers at this point.

llvm-svn: 267094

8 years agoCleanup: move visibility/linkage attributes to the first declaration.
Evgeniy Stepanov [Fri, 22 Apr 2016 01:04:55 +0000 (01:04 +0000)]
Cleanup: move visibility/linkage attributes to the first declaration.

http://reviews.llvm.org/D15404

llvm-svn: 267093

8 years agoARM: fix test for Windows division
Saleem Abdulrasool [Fri, 22 Apr 2016 01:03:38 +0000 (01:03 +0000)]
ARM: fix test for Windows division

This was meant to be part of SVN r267080.  cbz cannot use a high register, which
would be silently truncated.  This has now been fixed.

llvm-svn: 267092

8 years agoFix LWG issue #2106: move_iterators returning prvalues
Eric Fiselier [Fri, 22 Apr 2016 00:49:12 +0000 (00:49 +0000)]
Fix LWG issue #2106: move_iterators returning prvalues

llvm-svn: 267091

8 years agoFix C++03 build breakage
Eric Fiselier [Fri, 22 Apr 2016 00:47:15 +0000 (00:47 +0000)]
Fix C++03 build breakage

llvm-svn: 267090

8 years agoTry to get test passing on OS X (see comment at top of file).
Nico Weber [Fri, 22 Apr 2016 00:38:09 +0000 (00:38 +0000)]
Try to get test passing on OS X (see comment at top of file).

llvm-svn: 267089

8 years ago[asan] Disable one test on windows.
Evgeniy Stepanov [Fri, 22 Apr 2016 00:34:10 +0000 (00:34 +0000)]
[asan] Disable one test on windows.

Patch by Vitaly Buka.

llvm-svn: 267088

8 years agoclangTidyReadabilityModule: Add clangTidyUtils in libdeps, corresponding to r267003.
NAKAMURA Takumi [Fri, 22 Apr 2016 00:33:39 +0000 (00:33 +0000)]
clangTidyReadabilityModule: Add clangTidyUtils in libdeps, corresponding to r267003.

llvm-svn: 267087

8 years agoInline SectionRule::match.
Rui Ueyama [Fri, 22 Apr 2016 00:23:52 +0000 (00:23 +0000)]
Inline SectionRule::match.

This short function was used only once and didn't provide much value.

llvm-svn: 267086

8 years agoComplete LWG issue #2016. Allocators must be nothrow swappable
Eric Fiselier [Fri, 22 Apr 2016 00:15:18 +0000 (00:15 +0000)]
Complete LWG issue #2016. Allocators must be nothrow swappable

llvm-svn: 267085

8 years agoEnable stack-use-after-scope tests.
Evgeniy Stepanov [Fri, 22 Apr 2016 00:10:23 +0000 (00:10 +0000)]
Enable stack-use-after-scope tests.

Fix and enable working stack-use-after-scope tests.
Add more failing tests for the feature, for fix later.

PR27453.

Patch by Vitaly Buka.

llvm-svn: 267084

8 years agoELF: Make the special variable "." as a LinkerScript class member.
Rui Ueyama [Fri, 22 Apr 2016 00:03:13 +0000 (00:03 +0000)]
ELF: Make the special variable "." as a LinkerScript class member.

I will eventually make `evaluate` function a usual parse function
rather than a function that works on a separate token list.
This is the first step toward that.

llvm-svn: 267083

8 years ago[WebAssembly] Limit alignment hints to natural alignment.
Dan Gohman [Thu, 21 Apr 2016 23:59:48 +0000 (23:59 +0000)]
[WebAssembly] Limit alignment hints to natural alignment.

This follows the current binary format rules.

llvm-svn: 267082

8 years agoDon't gc protected symbols.
Rafael Espindola [Thu, 21 Apr 2016 23:59:19 +0000 (23:59 +0000)]
Don't gc protected symbols.

llvm-svn: 267081

8 years agoARM: restrict register class for WIN__DBZCHK
Saleem Abdulrasool [Thu, 21 Apr 2016 23:53:19 +0000 (23:53 +0000)]
ARM: restrict register class for WIN__DBZCHK

WIN__DBZCHK will insert a CBZ instruction into the stream.  This instruction
reserves 3 bits for the condition register (rn).  As such, we must ensure that
we restrict the register to a low register.  Use the tGPR class instead of GPR
to ensure that this is properly constrained.  In debug builds, we would attempt
to use lr as a condition register which would silently get truncated with no
hint that the register selection was incorrect.

llvm-svn: 267080

8 years agoAdd is_swappable/is_nothrow_swappable traits
Eric Fiselier [Thu, 21 Apr 2016 23:38:59 +0000 (23:38 +0000)]
Add is_swappable/is_nothrow_swappable traits

llvm-svn: 267079

8 years ago[sancov] using normalized filenames for blacklist checks.
Mike Aizatsky [Thu, 21 Apr 2016 23:38:45 +0000 (23:38 +0000)]
[sancov] using normalized filenames for blacklist checks.

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

llvm-svn: 267078

8 years agoFix more -Wunused-variable in non-asserts build.
David Blaikie [Thu, 21 Apr 2016 23:24:09 +0000 (23:24 +0000)]
Fix more -Wunused-variable in non-asserts build.

llvm-svn: 267077

8 years agoMake ios_base::failure visibility specified consistent
Eric Fiselier [Thu, 21 Apr 2016 23:00:33 +0000 (23:00 +0000)]
Make ios_base::failure visibility specified consistent

llvm-svn: 267076

8 years agoMachO: enable .data_region directives everywhere
Tim Northover [Thu, 21 Apr 2016 23:00:17 +0000 (23:00 +0000)]
MachO: enable .data_region directives everywhere

We'd disabled them on x86 because back in the early days some host tools
couldn't handle the new load commands. This no longer holds: anyone capable of
deploying Clang should be able to deploy its copies of ar/ranlib/etc.

rdar://25254790

llvm-svn: 267075

8 years agoFix most GCC attribute ignored warnings
Eric Fiselier [Thu, 21 Apr 2016 22:54:21 +0000 (22:54 +0000)]
Fix most GCC attribute ignored warnings

llvm-svn: 267074

8 years agoFix some -Wunused-variable warnings in non-asserts builds.
David Blaikie [Thu, 21 Apr 2016 22:53:33 +0000 (22:53 +0000)]
Fix some -Wunused-variable warnings in non-asserts builds.

llvm-svn: 267073

8 years ago[Support] Fix Wcast-qual warning
Vedant Kumar [Thu, 21 Apr 2016 22:40:59 +0000 (22:40 +0000)]
[Support] Fix Wcast-qual warning

llvm-svn: 267072

8 years agoFix PDB warnings and test
Reid Kleckner [Thu, 21 Apr 2016 22:37:55 +0000 (22:37 +0000)]
Fix PDB warnings and test

llvm-svn: 267071

8 years agoImprove error message reporting for MachineFunctionProperties
Derek Schuff [Thu, 21 Apr 2016 22:19:24 +0000 (22:19 +0000)]
Improve error message reporting for MachineFunctionProperties

When printing the properties required by a pass, only print the
properties that are set, and not those that are clear (only properties
that are set are verified, clear properties are "don't-care").

llvm-svn: 267070

8 years agoRemove dead code. NFC
Amaury Sechet [Thu, 21 Apr 2016 22:17:39 +0000 (22:17 +0000)]
Remove dead code. NFC

llvm-svn: 267069

8 years agoFix -Wreturn-type warning with HAVE_DIA_SDK is false.
Zachary Turner [Thu, 21 Apr 2016 22:16:19 +0000 (22:16 +0000)]
Fix -Wreturn-type warning with HAVE_DIA_SDK is false.

llvm-svn: 267068

8 years agoFix pdbdump-headers.test after guid format change.
Zachary Turner [Thu, 21 Apr 2016 22:13:25 +0000 (22:13 +0000)]
Fix pdbdump-headers.test after guid format change.

llvm-svn: 267067

8 years agoFix for case sensitive filename failure.
Zachary Turner [Thu, 21 Apr 2016 22:08:27 +0000 (22:08 +0000)]
Fix for case sensitive filename failure.

llvm-svn: 267066

8 years agoELF: Change how to handle KEEP linker script command.
Rui Ueyama [Thu, 21 Apr 2016 22:00:51 +0000 (22:00 +0000)]
ELF: Change how to handle KEEP linker script command.

You can instruct the linker to not discard sections even if they
are unused and --gc-sections option is given. The linker script
command for doing that is KEEP. The syntax is KEEP(foo) where foo
is a section name. KEEP commands are written in SECTIONS command,
so you can specify the order of sections *and* which sections
will be kept.

Each sub-command in SECTIONS command are translated into SectionRule
object. Previously, each SectionRule has `Keep` bit. However,
if you think about it, this hid information in too deep in elements
of a list. Semantically, KEEP commands aren't really related to
SECTIONS subcommands. We can keep the section list for KEEP in a
separate list. This patch does that.

llvm-svn: 267065

8 years agoFixed flag description
Mike Aizatsky [Thu, 21 Apr 2016 22:00:13 +0000 (22:00 +0000)]
Fixed flag description

Summary:
asan-use-after-return control feature we call use-after-return or
stack-use-after-return.

Reviewers: kcc, aizatsky, eugenis

Subscribers: llvm-commits

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

llvm-svn: 267064

8 years agoInternalize linkonce_odr more often.
Rafael Espindola [Thu, 21 Apr 2016 21:44:25 +0000 (21:44 +0000)]
Internalize linkonce_odr more often.

Since there is a copy in every translation unit that uses them, they can
be omitted from the symbol table if the address is not significant.

This still doesn't catch as many cases as the gold plugin. The
difference is that we check canBeOmittedFromSymbolTable in each file and
use lazy loading which limits what it can do. Gold checks it in the merged file.

I think the correct way of getting the same results as gold is just to
cache in the IR the result of canBeOmittedFromSymbolTable.

llvm-svn: 267063

8 years ago[CUDA] removed unneeded __nvvm_reflect_anchor()
Artem Belevich [Thu, 21 Apr 2016 21:40:27 +0000 (21:40 +0000)]
[CUDA] removed unneeded __nvvm_reflect_anchor()

Since r265060 LLVM infers correct __nvvm_reflect attributes, so
explicit declaration of __nvvm_reflect() is no longer needed.

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

llvm-svn: 267062

8 years agoRemove various warnings. NFC
Amaury Sechet [Thu, 21 Apr 2016 21:36:11 +0000 (21:36 +0000)]
Remove various warnings. NFC

llvm-svn: 267061

8 years ago[esan] EfficiencySanitizer base runtime library
Derek Bruening [Thu, 21 Apr 2016 21:32:25 +0000 (21:32 +0000)]
[esan] EfficiencySanitizer base runtime library

Summary:
Adds the initial version of a runtime library for the new
EfficiencySanitizer ("esan") family of tools.  The library includes:

+ Slowpath code via callouts from the compiler instrumentation for
  each memory access.

+ Registration of atexit() to call finalization code.

+ Runtime option flags controlled by the environment variable
  ESAN_OPTIONS.  The common sanitizer flags are supported such as
  verbosity and log_path.

+ An initial simple test.

Still TODO: common code for libc interceptors and shadow memory mapping,
and tool-specific code for shadow state updating.

Reviewers: eugenis, vitalybuka, aizatsky, filcab

Subscribers: filcab, vkalintiris, kubabrecka, llvm-commits, zhaoqin, kcc

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

llvm-svn: 267060

8 years ago[esan] EfficiencySanitizer driver flags
Derek Bruening [Thu, 21 Apr 2016 21:32:04 +0000 (21:32 +0000)]
[esan] EfficiencySanitizer driver flags

Summary:
Adds a framework to enable the instrumentation pass for the new
EfficiencySanitizer ("esan") family of tools.  Adds a flag for esan's
cache fragmentation tool via -fsanitize=efficiency-cache-frag.
Adds appropriate tests for the new flag.

Reviewers: eugenis, vitalybuka, aizatsky, filcab

Subscribers: filcab, kubabrecka, llvm-commits, zhaoqin, kcc

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

llvm-svn: 267059

8 years ago[esan] EfficiencySanitizer instrumentation pass
Derek Bruening [Thu, 21 Apr 2016 21:30:22 +0000 (21:30 +0000)]
[esan] EfficiencySanitizer instrumentation pass

Summary:
Adds an instrumentation pass for the new EfficiencySanitizer ("esan")
performance tuning family of tools.  Multiple tools will be supported
within the same framework.  Preliminary support for a cache fragmentation
tool is included here.

The shared instrumentation includes:
+ Turn mem{set,cpy,move} instrinsics into library calls.
+ Slowpath instrumentation of loads and stores via callouts to
  the runtime library.
+ Fastpath instrumentation will be per-tool.
+ Which memory accesses to ignore will be per-tool.

Reviewers: eugenis, vitalybuka, aizatsky, filcab

Subscribers: filcab, vkalintiris, pcc, silvas, llvm-commits, zhaoqin, kcc

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

llvm-svn: 267058

8 years agoAdd utility function to manipulate attributes on CallSite. NFC
Amaury Sechet [Thu, 21 Apr 2016 21:29:10 +0000 (21:29 +0000)]
Add utility function to manipulate attributes on CallSite. NFC

Summary: As per title. This will help work on the C API.

Reviewers: Wallbraker, whitequark, joker.eph, echristo, rafael

Subscribers: joker.eph, llvm-commits

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

llvm-svn: 267057

8 years agoFix a typo in an error message. Caught by Sean Silva!
Kevin Enderby [Thu, 21 Apr 2016 21:20:40 +0000 (21:20 +0000)]
Fix a typo in an error message.  Caught by Sean Silva!

llvm-svn: 267056

8 years ago[ProfileData] Report errors from InstrProfSymtab::create
Vedant Kumar [Thu, 21 Apr 2016 21:07:25 +0000 (21:07 +0000)]
[ProfileData] Report errors from InstrProfSymtab::create

InstrProfSymtab::create can fail with instrprof_error::malformed, but
this error is silently dropped. Propagate the error up to the caller so
we fail early.

Eventually, I'd like to transition ProfileData over to the new Error
class so we can't ignore hard failures like this.

llvm-svn: 267055

8 years agoSplit interesting warnings off from -Wfloat-conversion
Richard Trieu [Thu, 21 Apr 2016 21:04:55 +0000 (21:04 +0000)]
Split interesting warnings off from -Wfloat-conversion

Restructure the implict floating point to integer conversions so that
interesting sub-groups are under different flags.  Breakdown of warnings:

No warning:
Exact conversions from floating point to integer:
int x = 10.0;
int x = 1e10;

-Wliteral-conversion - Floating point literal to integer with rounding:
int x = 5.5;
int x = -3.4;

-Wfloat-conversion - All conversions not covered by the above two:
int x = GetFloat();
int x = 5.5 + 3.5;

-Wfloat-zero-conversion - The expression converted has a non-zero floating
point value that gets converted to a zero integer value, excluded the cases
falling under -Wliteral-conversion.  Subset of -Wfloat-conversion.
int x = 1.0 / 2.0;

-Wfloat-overflow-conversion - The floating point value is outside the range
of the integer type, exluding cases from -Wliteral conversion.  Subset of
-Wfloat-conversion.
char x = 500;
char x = -1000;

-Wfloat-bool-conversion - Any conversion of a floating point type to bool.
Subset of -Wfloat-conversion.
if (GetFloat()) {}
bool x = 5.0;

-Wfloat-bool-constant-conversion - Conversion of a compile time evaluatable
floating point value to bool.  Subset of -Wfloat-bool-conversion.
bool x = 1.0;
bool x = 4.0 / 20.0;

Also add EvaluateAsFloat to Sema, which is similar to EvaluateAsInt, but for
floating point values.

llvm-svn: 267054

8 years agoadd tests for disguised fabs/fneg
Sanjay Patel [Thu, 21 Apr 2016 21:02:25 +0000 (21:02 +0000)]
add tests for disguised fabs/fneg

llvm-svn: 267053

8 years ago[MachineBasicBlock] Make the pass argument truly mandatory when
Quentin Colombet [Thu, 21 Apr 2016 21:01:13 +0000 (21:01 +0000)]
[MachineBasicBlock] Make the pass argument truly mandatory when
splitting edges.

MachineBasicBlock::SplitCriticalEdges will crash if a nullptr would have
been passed for the Pass argument. Do not allow that by turning this
argument into a reference.
The alternative would have been to make the Pass a truly optional
argument, but although this is easy to do, I was afraid users using it
like this would not be aware the livness information, dominator tree and
such would silently be broken.

llvm-svn: 267052

8 years agouse FileCheck; add test for disguised fabs
Sanjay Patel [Thu, 21 Apr 2016 20:58:58 +0000 (20:58 +0000)]
use FileCheck; add test for disguised fabs

llvm-svn: 267051

8 years agoAdd natvis visualizers for endian types.
Zachary Turner [Thu, 21 Apr 2016 20:58:41 +0000 (20:58 +0000)]
Add natvis visualizers for endian types.

This allows ulittle* and ubig* types to be visualized properly
in VS.

Differential Revision: http://reviews.llvm.org/D19339
Reviewed By: Aaron Ballman

llvm-svn: 267050

8 years agoRefactor raw pdb dumper into library
Zachary Turner [Thu, 21 Apr 2016 20:58:35 +0000 (20:58 +0000)]
Refactor raw pdb dumper into library

PDB parsing code was hand-rolled into llvm-pdbdump. This patch moves the
parsing of this code into DebugInfoPDB and makes the dumper use this.

This is achieved by implementing the skeleton of RawPdbSession, the
non-DIA counterpart to the existing PDB read interface. None of the type /
source file / etc information is accessible yet, so this implementation is
not yet close to achieving parity with the DIA counterpart, but the
RawSession class simply holds a reference to a PDBFile class which handles
parsing the file format. Additionally a PDBStream class is introduced
which allows accessing the bytes of a particular stream in a PDB file.

Differential Revision: http://reviews.llvm.org/D19343
Reviewed By: majnemer

llvm-svn: 267049

8 years agoUpdate Go OS Plugin for newer runtimes.
Ryan Brown [Thu, 21 Apr 2016 20:57:28 +0000 (20:57 +0000)]
Update Go OS Plugin for newer runtimes.

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

llvm-svn: 267048

8 years agoRemove SymPair and instead use two DefinedRegulars instead.
Rui Ueyama [Thu, 21 Apr 2016 20:50:15 +0000 (20:50 +0000)]
Remove SymPair and instead use two DefinedRegulars instead.

I noticed that I was looking for the definition of SymPair when hacking
the Writer, only to find that it is just a pair of DefinedRegular symbols.
I don't think it provides more values than the cost of using brainpower
to memorize the type. I didn't roll back r266317, which introduced SymPair,
because the patch removes code repetitions. I ported that change to new
code.

llvm-svn: 267047

8 years ago[MachineBasicBlock] Refactor SplitCriticalEdge to expose a query API.
Quentin Colombet [Thu, 21 Apr 2016 20:46:27 +0000 (20:46 +0000)]
[MachineBasicBlock] Refactor SplitCriticalEdge to expose a query API.

Introduce canSplitCriticalEdge, so that clients can now query whether or
not a critical edge can be split without actually needing to split it.
This may be useful when gathering information for cost models for
instance.

llvm-svn: 267046

8 years agoStart adding support for internalizing shared libraries.
Rafael Espindola [Thu, 21 Apr 2016 20:35:25 +0000 (20:35 +0000)]
Start adding support for internalizing shared libraries.

llvm-svn: 267045

8 years agoELF: Change the return type of getSectionOrder.
Rui Ueyama [Thu, 21 Apr 2016 20:30:00 +0000 (20:30 +0000)]
ELF: Change the return type of getSectionOrder.

Also changed the function name and added comments.

llvm-svn: 267044

8 years agohange the variable name big_size to BigSize. Caught by Rafael Espíndola!
Kevin Enderby [Thu, 21 Apr 2016 20:29:49 +0000 (20:29 +0000)]
hange the variable name big_size to BigSize. Caught by Rafael Espíndola!

llvm-svn: 267043

8 years agoZero-initialize members of the CpuHashInfoTy structure for AsmParser
Andrew Kaylor [Thu, 21 Apr 2016 20:09:35 +0000 (20:09 +0000)]
Zero-initialize members of the CpuHashInfoTy structure for AsmParser

llvm-svn: 267042

8 years ago[RuntimeDyld] Fix conservative over-allocation of memory for common symbols.
Lang Hames [Thu, 21 Apr 2016 20:08:06 +0000 (20:08 +0000)]
[RuntimeDyld] Fix conservative over-allocation of memory for common symbols.

The previous allocation code was over-estimating the amount of memory required.

No test case: we don't currently have a good way to detect conervative
over-allocation.

llvm-svn: 267041

8 years agoclang-cl: Don't assert on using /Yc with non-source files, PR27450
Nico Weber [Thu, 21 Apr 2016 19:59:10 +0000 (19:59 +0000)]
clang-cl: Don't assert on using /Yc with non-source files, PR27450

Move phase handling after input type validation.

llvm-svn: 267040

8 years agoNFC: fix copy / paste comment
JF Bastien [Thu, 21 Apr 2016 19:53:39 +0000 (19:53 +0000)]
NFC: fix copy / paste comment

llvm-svn: 267039

8 years ago[Hexagon] Properly recognize register alt names
Krzysztof Parzyszek [Thu, 21 Apr 2016 19:49:53 +0000 (19:49 +0000)]
[Hexagon] Properly recognize register alt names

llvm-svn: 267038

8 years agoFix crash in llvm-objdump with -macho -objc-meta-data that was trying dump a non...
Kevin Enderby [Thu, 21 Apr 2016 19:49:29 +0000 (19:49 +0000)]
Fix crash in llvm-objdump with -macho -objc-meta-data that was trying dump a non-existent section.

Showed up in running on a large binary with the missing section.  I could create a fake
test case if anyone really wants but the fix is pretty obvious.

rdar://25837034

llvm-svn: 267037

8 years agoNFC: fix nonsensical comment
JF Bastien [Thu, 21 Apr 2016 19:41:48 +0000 (19:41 +0000)]
NFC: fix nonsensical comment

llvm-svn: 267036

8 years agoFolding compares with unescaped allocations
Sanjoy Das [Thu, 21 Apr 2016 19:26:45 +0000 (19:26 +0000)]
Folding compares with unescaped allocations

Summary:
If we know that the pointer allocated within a function does not escape,
we can fold away comparisons that are done with global pointers

Patch by Anna Thomas!

Reviewers: reames, majnemer, sanjoy

Subscribers: mgrang, mcrosier, majnemer, llvm-commits

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

llvm-svn: 267035

8 years ago[Hexagon] Expand handling of the small-data/bss section
Krzysztof Parzyszek [Thu, 21 Apr 2016 18:56:45 +0000 (18:56 +0000)]
[Hexagon] Expand handling of the small-data/bss section

llvm-svn: 267034

8 years ago[RegisterBankInfo] Change the API for the verify methods.
Quentin Colombet [Thu, 21 Apr 2016 18:34:43 +0000 (18:34 +0000)]
[RegisterBankInfo] Change the API for the verify methods.

Return bool instead of void so that it is natural to put the calls into
asserts.

llvm-svn: 267033

8 years agoELF: support -- version of discard-{all,locals}
Saleem Abdulrasool [Thu, 21 Apr 2016 18:29:13 +0000 (18:29 +0000)]
ELF: support -- version of discard-{all,locals}

GNU ld and gold only support the discard-all and discard-locals with two dashes.
Retain the compatibility with the one dash spelling, but also accept the two
dashed form.

llvm-svn: 267032

8 years agoELF: alias `--no-copy-dt-needed-entries` to `--no-add-needed`
Saleem Abdulrasool [Thu, 21 Apr 2016 18:29:09 +0000 (18:29 +0000)]
ELF: alias `--no-copy-dt-needed-entries` to `--no-add-needed`

`--add-needed` and `--no-add-needed` have been deprecated due to the similarity
of their spelling to `--as-needed` and `--no-as-needed`.  They have been renamed
to `--copy-dt-needed-entries` and `--no-copy-dt-needed-entries`.

llvm-svn: 267031

8 years agoAMDGPU: Fix debug name of pass to better match
Matt Arsenault [Thu, 21 Apr 2016 18:21:54 +0000 (18:21 +0000)]
AMDGPU: Fix debug name of pass to better match

I get this wrong every time I try to debug this.

llvm-svn: 267030

8 years agoLegalizeDAG: Move unaligned load/store expansion to TLI
Matt Arsenault [Thu, 21 Apr 2016 18:19:11 +0000 (18:19 +0000)]
LegalizeDAG: Move unaligned load/store expansion to TLI

When custom lowered, this is not called if the store is custom
lowered. Move it to be a utility function so targets can
easily expand unaligned accesses when custom lowering.

llvm-svn: 267029

8 years ago[asan] Mark strdup test as unsupported on arm/linux.
Evgeniy Stepanov [Thu, 21 Apr 2016 18:18:09 +0000 (18:18 +0000)]
[asan] Mark strdup test as unsupported on arm/linux.

llvm-svn: 267028

8 years ago[clang-tidy] Fix broken build bot.
Etienne Bergeron [Thu, 21 Apr 2016 18:15:35 +0000 (18:15 +0000)]
[clang-tidy] Fix broken build bot.

Summary:
There is a build bot that doesn't support 'constexpr'.

```
FAILED: C:\PROGRA~2\MICROS~1.0\VC\bin\amd64\cl.exe   /nologo /TP /DWIN32 /D_WINDOWS   /W4 -wd4141 -wd4146 -wd4180 -wd4244 -wd4258 -wd4267 -wd4291 -wd4345 -wd4351 -wd4355 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4800 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4324 -w14062 -we4238 /Zc:inline /Oi /Zc:rvalueCast /MD /O2 /Ob2 -Itools\clang\tools\extra\clang-tidy\misc -ID:\buildslave\clang-x64-ninja-win7\llvm\tools\clang\tools\extra\clang-tidy\misc -ID:\buildslave\clang-x64-ninja-win7\llvm\tools\clang\include -Itools\clang\include -Iinclude -ID:\buildslave\clang-x64-ninja-win7\llvm\include    -UNDEBUG  /EHs-c- /GR- /showIncludes -DCLANG_ENABLE_ARCMT -DCLANG_ENABLE_OBJC_REWRITER -DCLANG_ENABLE_STATIC_ANALYZER -DGTEST_HAS_RTTI=0 -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_DEBUG_POINTER_IMPL="" -D_GNU_SOURCE -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS /Fotools\clang\tools\extra\clang-tidy\misc\CMakeFiles\clangTidyMiscModule.dir\SuspiciousStringCompareCheck.cpp.obj /Fdtools\clang\tools\extra\clang-tidy\misc\CMakeFiles\clangTidyMiscModule.dir\ /FS -c D:\buildslave\clang-x64-ninja-win7\llvm\tools\clang\tools\extra\clang-tidy\misc\SuspiciousStringCompareCheck.cpp
D:\buildslave\clang-x64-ninja-win7\llvm\tools\clang\tools\extra\clang-tidy\misc\SuspiciousStringCompareCheck.cpp(25) : error C2144: syntax error : 'char' should be preceded by ';'
D:\buildslave\clang-x64-ninja-win7\llvm\tools\clang\tools\extra\clang-tidy\misc\SuspiciousStringCompareCheck.cpp(25) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
ninja: build stopped: subcommand failed.
program finished with exit code 1
```

Reviewers: alexfh, sbenza

Subscribers: cfe-commits

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

llvm-svn: 267027

8 years ago[Release Notes] Mention Clang-tidy misc-string-constructor and misc-suspicious-string...
Eugene Zelenko [Thu, 21 Apr 2016 18:13:09 +0000 (18:13 +0000)]
[Release Notes] Mention Clang-tidy misc-string-constructor and misc-suspicious-string-compare checks.

Fix excessive line in misc-string-constructor documentation.

llvm-svn: 267026

8 years ago[RegisterBankInfo] Change the representation of the partial mappings.
Quentin Colombet [Thu, 21 Apr 2016 18:09:34 +0000 (18:09 +0000)]
[RegisterBankInfo] Change the representation of the partial mappings.

Instead of holding a mask, hold two value: the start index and the
length of the mapping. This is a more compact representation, although
less powerful. That being said, arbitrary masks would not have worked
for the generic so do not allow them in the first place.

llvm-svn: 267025

8 years agoDAGCombiner: Reduce 64-bit BFE pattern to pattern on 32-bit component
Matt Arsenault [Thu, 21 Apr 2016 18:03:06 +0000 (18:03 +0000)]
DAGCombiner: Reduce 64-bit BFE pattern to pattern on 32-bit component

If the extracted bits are restricted to the upper half or lower half,
this can be truncated.

llvm-svn: 267024