platform/upstream/llvm.git
8 years ago[unittests/ADT] OptionSetTest: ifdef out a part that fails to compile on MSVC.
Argyrios Kyrtzidis [Fri, 12 Feb 2016 05:52:37 +0000 (05:52 +0000)]
[unittests/ADT] OptionSetTest: ifdef out a part that fails to compile on MSVC.

llvm-svn: 260655

8 years ago[ADT] OptionSet: ifdef out some code that seems to be crashing MSVC.
Argyrios Kyrtzidis [Fri, 12 Feb 2016 04:36:48 +0000 (04:36 +0000)]
[ADT] OptionSet: ifdef out some code that seems to be crashing MSVC.

llvm-svn: 260654

8 years ago[attrs] Run clang-format over a newly added routine in function-attrs
Chandler Carruth [Fri, 12 Feb 2016 03:07:50 +0000 (03:07 +0000)]
[attrs] Run clang-format over a newly added routine in function-attrs
before I update it to be friendly with the new pass manager.

llvm-svn: 260653

8 years ago[ADT] Introduce ‘OptionSet’ in llvm/ADT headers, which is a utility class that makes...
Argyrios Kyrtzidis [Fri, 12 Feb 2016 02:48:26 +0000 (02:48 +0000)]
[ADT] Introduce ‘OptionSet’ in llvm/ADT headers, which is a utility class that makes it convenient to work with enumerators representing bit options.

llvm-svn: 260652

8 years agoAMDGPU: Set element_size in private resource descriptor
Matt Arsenault [Fri, 12 Feb 2016 02:40:47 +0000 (02:40 +0000)]
AMDGPU: Set element_size in private resource descriptor

Introduce a subtarget feature for this, and leave the default with
the current behavior which assumes up to 16-byte loads/stores can
be used. The field also seems to have the ability to be set to 2 bytes,
but I'm not sure what that would be used for.

llvm-svn: 260651

8 years ago[libFuzzer] make -runs=N flag also affect the simple runner (will execute every input...
Kostya Serebryany [Fri, 12 Feb 2016 02:32:03 +0000 (02:32 +0000)]
[libFuzzer] make -runs=N flag also affect the simple runner (will execute every input N times)

llvm-svn: 260649

8 years agoUpdate functions in clang supplied headers to use the compiler reserved
Eric Christopher [Fri, 12 Feb 2016 02:22:53 +0000 (02:22 +0000)]
Update functions in clang supplied headers to use the compiler reserved
namespace for arguments.

llvm-svn: 260647

8 years agoAMDGPU: Fix mishandling alignment when scalarizing vector loads/stores
Matt Arsenault [Fri, 12 Feb 2016 02:22:21 +0000 (02:22 +0000)]
AMDGPU: Fix mishandling alignment when scalarizing vector loads/stores

I don't think this was causing any real problems, so I'm not sure
how to test for this.

llvm-svn: 260646

8 years agoAMDGPU: Initialize SILowerControlFlow
Matt Arsenault [Fri, 12 Feb 2016 02:16:10 +0000 (02:16 +0000)]
AMDGPU: Initialize SILowerControlFlow

llvm-svn: 260645

8 years agoAMDGPU: Remove trailing whitespace
Matt Arsenault [Fri, 12 Feb 2016 02:16:07 +0000 (02:16 +0000)]
AMDGPU: Remove trailing whitespace

llvm-svn: 260644

8 years agoAvoid linking LLVM component libraries with libLLVM
Andrew Wilkins [Fri, 12 Feb 2016 01:42:43 +0000 (01:42 +0000)]
Avoid linking LLVM component libraries with libLLVM

Patch by Jack Howarth.

When linking to libLLVM, don't also link to the component
libraries that constitute libLLVM.

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

llvm-svn: 260641

8 years ago<float.h>: do not define DECIMAL_DIG in -std=c89 mode; this macro was added in C99.
Richard Smith [Fri, 12 Feb 2016 01:15:33 +0000 (01:15 +0000)]
<float.h>: do not define DECIMAL_DIG in -std=c89 mode; this macro was added in C99.

Patch by Jorge Teixeira!

llvm-svn: 260639

8 years agoUsersManual: update clang-cl commands
Hans Wennborg [Fri, 12 Feb 2016 01:01:37 +0000 (01:01 +0000)]
UsersManual: update clang-cl commands

llvm-svn: 260637

8 years agoMake compCtors strict weak ordering.
Rui Ueyama [Fri, 12 Feb 2016 00:38:46 +0000 (00:38 +0000)]
Make compCtors strict weak ordering.

Previously, if both A and B are ".ctors", both compCtors(A, B) and
compCtors(B, A) are true, which is a violation of the strict weak
ordering because such function is not antisymmetric.

llvm-svn: 260633

8 years ago[msan] Put msan constructor in a comdat.
Evgeniy Stepanov [Fri, 12 Feb 2016 00:37:52 +0000 (00:37 +0000)]
[msan] Put msan constructor in a comdat.

MSan adds a constructor to each translation unit that calls
__msan_init, and does nothing else. The idea is to run __msan_init
before any instrumented code. This results in multiple constructors
and multiple .init_array entries in the final binary, one per
translation unit. This is absolutely unnecessary; one would be
enough.

This change moves the constructors to a comdat group in order to drop
the extra ones.

llvm-svn: 260632

8 years agoUse __ before argument names in provided headers.
Eric Christopher [Fri, 12 Feb 2016 00:32:23 +0000 (00:32 +0000)]
Use __ before argument names in provided headers.

llvm-svn: 260631

8 years ago[sancov] improved object files handling.
Mike Aizatsky [Fri, 12 Feb 2016 00:29:45 +0000 (00:29 +0000)]
[sancov] improved object files handling.

Documentation change for: http://reviews.llvm.org/D17169

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

llvm-svn: 260630

8 years ago[sancov] improved object files handling.
Mike Aizatsky [Fri, 12 Feb 2016 00:29:24 +0000 (00:29 +0000)]
[sancov] improved object files handling.

Updating sancov invocation on html_cov_dump.

sancov change: http://reviews.llvm.org/D17169

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

llvm-svn: 260629

8 years ago[sancov] improved object files handling.
Mike Aizatsky [Fri, 12 Feb 2016 00:29:07 +0000 (00:29 +0000)]
[sancov] improved object files handling.

Multi-dso programs result in multiple coverage files dumped of the form
'<module_name>.<pid>.sancov'. When analyzing these coverage files it is
important to use correct corresponding object file.

This change removes the "-obj" sancov flag and lets user specify object
file names alongside coverage files. Sancov tool would match them using
<module_name> part of coverage file and short file name of the object
file.

Corresponding changes:
- compiler-rt: http://reviews.llvm.org/D17171
- docs: http://reviews.llvm.org/D17175

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

llvm-svn: 260628

8 years ago[LVI] Improve select handling to use condition
Philip Reames [Fri, 12 Feb 2016 00:09:18 +0000 (00:09 +0000)]
[LVI] Improve select handling to use condition

This patches teaches LVI to recognize clamp idioms (e.g. select(a > 5, a, 5) will always produce something greater than 5.

The tests end up being somewhat simplistic because trying to exercise the case I actually care about (a loop with a range check on a clamped secondary induction variable) ends up tripping across a couple of other imprecisions in the analysis. Ah, the joys of LVI...

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

llvm-svn: 260627

8 years agoDon't crash if we have a DIE that has a DW_AT_ranges attribute and yet the SymbolFile...
Greg Clayton [Fri, 12 Feb 2016 00:07:16 +0000 (00:07 +0000)]
Don't crash if we have a DIE that has a DW_AT_ranges attribute and yet the SymbolFileDWARF doesn't have a DebugRanges. If this happens print a nice error message to prompt the user to file a bug and attach the offending DWARF file so we can get the correct compiler fixed.

<rdar://problem/24458016>

llvm-svn: 260626

8 years agoAMDGPU: Quick fix for extreme slowness in spill-scavenge-offset.ll test
Nicolai Haehnle [Fri, 12 Feb 2016 00:05:34 +0000 (00:05 +0000)]
AMDGPU: Quick fix for extreme slowness in spill-scavenge-offset.ll test

Summary: Also, some cosmetic fixes.

Reviewers: arsenm, tstellarAMD

Subscribers: qcolombet, llvm-commits

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

llvm-svn: 260625

8 years agoWhen calling TypeSystemMap::Clear, objects being destroyed in the process of
Jim Ingham [Fri, 12 Feb 2016 00:03:19 +0000 (00:03 +0000)]
When calling TypeSystemMap::Clear, objects being destroyed in the process of
clearing the map ended up calling back into the TypeSystemMap to do lookups.
Not a good idea, and in this case it would cause a deadlock.

You would only see this when replacing the target contents after an exec, and only if you
had stopped before the exec, evaluated an expression, then continued
on to the point where you did the exec.

Fixed this by making sure the TypeSystemMap::Clear tears down the TypeSystems in the map before clearing the map.
I also add an expression before exec to the TestExec.py so that we'll catch this
issue if it crops up again in the future.

<rdar://problem/24554920>

llvm-svn: 260624

8 years agollvm/test/CodeGen/NVPTX/debug-file-loc.ll: Tweak expressions for dos path.
NAKAMURA Takumi [Thu, 11 Feb 2016 23:59:43 +0000 (23:59 +0000)]
llvm/test/CodeGen/NVPTX/debug-file-loc.ll: Tweak expressions for dos path.

llvm-svn: 260623

8 years agoInstead of asking glibc to provide correct C++ signatures for <string.h>
Richard Smith [Thu, 11 Feb 2016 23:51:02 +0000 (23:51 +0000)]
Instead of asking glibc to provide correct C++ signatures for <string.h>
functions, ask it whether it did provide them after the fact. Some versions of
glibc fail to compile if you make this request and don't also claim to be at
least GCC 4.3.

llvm-svn: 260622

8 years agoARMv7k: use Cortex-A7 by default even for tvOS
Tim Northover [Thu, 11 Feb 2016 23:49:08 +0000 (23:49 +0000)]
ARMv7k: use Cortex-A7 by default even for tvOS

Also actually test the default CPU from those triples.

llvm-svn: 260621

8 years agoELF: Implement the correct semantics of .[cd]tors.
Rui Ueyama [Thu, 11 Feb 2016 23:41:38 +0000 (23:41 +0000)]
ELF: Implement the correct semantics of .[cd]tors.

As I noted in the comment, the sorting order of .[cd]tors are
different from .{init,fini}_array's.

http://reviews.llvm.org/D17120

llvm-svn: 260620

8 years ago[codeview] Dump def range lengths in hex
Reid Kleckner [Thu, 11 Feb 2016 23:40:14 +0000 (23:40 +0000)]
[codeview] Dump def range lengths in hex

It makes it easier to correlate with assembly dumps, which are typically
given with hex offsets.

llvm-svn: 260619

8 years agoRemoved a bad assertion:
Greg Clayton [Thu, 11 Feb 2016 23:36:57 +0000 (23:36 +0000)]
Removed a bad assertion:

assert(((SymbolFileDWARF*)m_ast.GetSymbolFile())->UserIDMatches(die.GetDIERef().GetUID()) &&
       "Adding incorrect type to forward declaration map");

The problem is that "m_ast.GetSymbolFile()" can return a SymbolFileDWARFDebugMap. The code is doing the right thing if the assertion is ignored.

<rdar://problem/24437972>

llvm-svn: 260618

8 years agoRemove decision logic for old NetBSD development versions, the 7.0
Joerg Sonnenberger [Thu, 11 Feb 2016 23:35:03 +0000 (23:35 +0000)]
Remove decision logic for old NetBSD development versions, the 7.0
release made this obsolete.

llvm-svn: 260617

8 years agoNow that Sparc/Sparc64 backend is mostly usable, provide the same
Joerg Sonnenberger [Thu, 11 Feb 2016 23:18:36 +0000 (23:18 +0000)]
Now that Sparc/Sparc64 backend is mostly usable, provide the same
linking defaults as other NetBSD targets, i.e. compiler_rt-in-libc and
libc++ as STL.

llvm-svn: 260616

8 years agoFix incorrect task_team in __kmp_give_task
Jonathan Peyton [Thu, 11 Feb 2016 23:07:30 +0000 (23:07 +0000)]
Fix incorrect task_team in __kmp_give_task

When a target task finishes and it tries to access the th_task_team from the
threads in the team where it was created, th_task_team can be NULL or point to
a different place when that thread started a nested region that is still
running. Finding the exact task_team that the threads were using is difficult
as it would require to unwind the task_state_memo_stack. So a new field was added
in the taskdata structure to point to the active task_team when the task was
created.

llvm-svn: 260615

8 years ago[SLP] Add debug output for extract cost (NFC)
Matthew Simpson [Thu, 11 Feb 2016 23:06:40 +0000 (23:06 +0000)]
[SLP] Add debug output for extract cost (NFC)

llvm-svn: 260614

8 years agoFix a couple of typos in comments
Jonathan Peyton [Thu, 11 Feb 2016 22:58:29 +0000 (22:58 +0000)]
Fix a couple of typos in comments

llvm-svn: 260613

8 years agoRe-apply r238452, the bug was in clang and was fixed in r260567.
Quentin Colombet [Thu, 11 Feb 2016 22:30:41 +0000 (22:30 +0000)]
Re-apply r238452, the bug was in clang and was fixed in r260567.

Original commit message:
[InstCombine] Fold IntToPtr and PtrToInt into preceding loads.

Currently we only fold a BitCast into a Load when the BitCast is its
only user.

Do the same for any no-op cast.

Patch by Philip Pfaffe!

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

llvm-svn: 260612

8 years ago[libfuzzer] Removing coverage-related flags from asan options.
Mike Aizatsky [Thu, 11 Feb 2016 22:20:34 +0000 (22:20 +0000)]
[libfuzzer] Removing coverage-related flags from asan options.

Summary:
Reasons to remove are twofold:
 - we don't really need coverage=1 for libfuzzer operation
 - makes controlling coverage for fuzzer processes non-trivial.

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

llvm-svn: 260611

8 years agoRemove bogus check that larger floating point types have smaller minimum
Richard Smith [Thu, 11 Feb 2016 22:18:10 +0000 (22:18 +0000)]
Remove bogus check that larger floating point types have smaller minimum
normalized exponents. That's not true for double versus double double.

llvm-svn: 260610

8 years ago[x86] simplify getZeroVector() ; NFCI
Sanjay Patel [Thu, 11 Feb 2016 22:17:04 +0000 (22:17 +0000)]
[x86] simplify getZeroVector() ; NFCI

Let DAG.getConstant() handle the splatting; there's no need
to repeat that logic here.

See also:
http://reviews.llvm.org/rL258833
http://reviews.llvm.org/rL260582

llvm-svn: 260609

8 years ago[analyzer] Improve pattern matching in ObjCDealloc checker.
Devin Coughlin [Thu, 11 Feb 2016 22:13:20 +0000 (22:13 +0000)]
[analyzer] Improve pattern matching in ObjCDealloc checker.

Look through PseudoObjectExpr and OpaqueValueExprs when scanning for
release-like operations. This commit also adds additional tests in anticipation
of re-writing this as a path-sensitive checker.

llvm-svn: 260608

8 years agoRevert "Refactor the PassManagerBuilder: extract a "addFunctionSimplificationPasses()""
Mehdi Amini [Thu, 11 Feb 2016 22:09:11 +0000 (22:09 +0000)]
Revert "Refactor the PassManagerBuilder: extract a "addFunctionSimplificationPasses()""

This reverts commit r260603.
I didn't intend to push it :(

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

8 years agoRevert "Define the ThinLTO Pipeline"
Mehdi Amini [Thu, 11 Feb 2016 22:09:07 +0000 (22:09 +0000)]
Revert "Define the ThinLTO Pipeline"

This reverts commit r260604.
I didn't intend to push this now.

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

8 years agoRevert "Add a new insert_as() method to DenseMap and use it for ConstantUniqueMap"
Mehdi Amini [Thu, 11 Feb 2016 22:00:36 +0000 (22:00 +0000)]
Revert "Add a new insert_as() method to DenseMap and use it for ConstantUniqueMap"

This reverts commit r260458.

It was backported on an internal branch and broke stage2 build. Since
this can lead to weird random crash I'm reverting upstream as well
while investigating.

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

8 years agoDefine the ThinLTO Pipeline
Mehdi Amini [Thu, 11 Feb 2016 22:00:31 +0000 (22:00 +0000)]
Define the ThinLTO Pipeline

Summary:
On the contrary to Full LTO, ThinLTO can afford to shift compile time
from the frontend to the linker: both phases are parallel.
This pipeline is based on the proposal in D13443 for full LTO. We ]
didn't move forward on this proposal because the link was far too long
after that.

This patch refactor the "function simplification" passes that are part
of the inliner loop in a helper function (this part is NFC and can be
commited separately to simplify the diff). The ThinLTO pipeline
integrates in the regular O2/O3 flow:

 - The compile phase perform the inliner with a somehow lighter
   function simplification. (TODO: tune the inliner thresholds here)
   This is intendend to simplify the IR and get rid of obvious things
   like linkonce_odr that will be inlined.
 - The link phase will run the pipeline from the start, extended with
   some specific passes that leverage the augmented knowledge we have
   during LTO. Especially after the inliner is done, a sequence of
   globalDCE/globalOpt is performed, followed by another run of the
   "function simplification" passes.

The measurements on the public test suite as well as on our internal
suite show an overall net improvement. The binary size for the clang
executable is reduced by 5%. We're still tuning it with the bringup
of ThinLTO but this should provide a good starting point.

Reviewers: tejohnson

Subscribers: joker.eph, llvm-commits, dexonsmith

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

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

8 years agoRefactor the PassManagerBuilder: extract a "addFunctionSimplificationPasses()"
Mehdi Amini [Thu, 11 Feb 2016 22:00:25 +0000 (22:00 +0000)]
Refactor the PassManagerBuilder: extract a "addFunctionSimplificationPasses()"

It is intended to contains the passes run over a function after the
inliner is done with a function and before it moves to its callers.

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

8 years ago[IRTranslator] Use a single virtual register to represent any Value.
Quentin Colombet [Thu, 11 Feb 2016 21:48:32 +0000 (21:48 +0000)]
[IRTranslator] Use a single virtual register to represent any Value.
PR26161.

llvm-svn: 260602

8 years agoFix LWG issue 2469 - Use piecewise construction in unordered_map::operator[].
Eric Fiselier [Thu, 11 Feb 2016 21:45:53 +0000 (21:45 +0000)]
Fix LWG issue 2469 - Use piecewise construction in unordered_map::operator[].

unordered_map's allocator may only be used to construct objects of 'value_type',
or in this case 'pair<const Key, Value>'. In order to respect this requirement
in operator[], which requires default constructing the 'mapped_type', we have
to use pair's piecewise constructor with '(tuple<Kep>, tuple<>)'.

Unfortunately we still need to provide a fallback implementation for C++03
since we don't have <tuple>. Even worse this fallback is the last remaining
user of '__hash_map_node_destructor' and '__construct_node_with_key'.

llvm-svn: 260601

8 years ago[AArch64] Implements the lowering of formal arguments for GlobalISel.
Quentin Colombet [Thu, 11 Feb 2016 21:45:08 +0000 (21:45 +0000)]
[AArch64] Implements the lowering of formal arguments for GlobalISel.
This is just a trivial implementation:
- Support only arguments passed in registers.
- Support only "plain" arguments, i.e., no sext/zext attribute.

At this point, it is possible to play with the IRTranslator on AArch64:
llc -mtriple arm64-<vendor>-<os> -print-machineinstrs <input.ll> -o - -global-isel

For now, we only support the translation of program with adds and returns.

Follow-up patches are on their way to add a test case (the MIRParser is
not ready as it is).

llvm-svn: 260600

8 years agoAMDGPU/SI: Make sure MIMG descriptors and samplers stay in SGPRs
Tom Stellard [Thu, 11 Feb 2016 21:45:07 +0000 (21:45 +0000)]
AMDGPU/SI: Make sure MIMG descriptors and samplers stay in SGPRs

Summary:
It's possible to have resource descriptors and samplers stored in
VGPRs, either by a VMEM instruction or in the case of samplers,
floating-point calculations.  When this happens, we need to use
v_readfirstlane to copy these values back to sgprs.

Reviewers: mareko, arsenm

Subscribers: arsenm, llvm-commits

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

llvm-svn: 260599

8 years agoELF: Remove readLinkerScript and define LinkerScript::read instead.
Rui Ueyama [Thu, 11 Feb 2016 21:38:55 +0000 (21:38 +0000)]
ELF: Remove readLinkerScript and define LinkerScript::read instead.

llvm-svn: 260598

8 years agoAdd support for phi nodes in the LLVM C API test
Amaury Sechet [Thu, 11 Feb 2016 21:37:54 +0000 (21:37 +0000)]
Add support for phi nodes in the LLVM C API test

Summary: This required to add binding to Instruction::removeFromParent so that instruction can be forward declared and then moved at the right place.

Reviewers: bogner, chandlerc, echristo, dblaikie, joker.eph, Wallbraker

Subscribers: llvm-commits

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

llvm-svn: 260597

8 years agoRelax recently added clang version checks.
Tim Northover [Thu, 11 Feb 2016 21:31:51 +0000 (21:31 +0000)]
Relax recently added clang version checks.

You can override the value of these during CMake, and we often use sentinels
with more than one digit (not to mention our actual Clang being 700.whatever).

llvm-svn: 260596

8 years ago[AArch64] Fix libunwind build when using GNU assembler
Renato Golin [Thu, 11 Feb 2016 21:22:57 +0000 (21:22 +0000)]
[AArch64] Fix libunwind build when using GNU assembler

Use x29 and x30 for fp and lr respectively.

This does not change the code generation with integrated asm
but using x30 and x29 helps compile the code with gnu as. Currently gas
fails to assemble this code with errors as below.

Error: operand X should be an integer register.

Newer versions of binutils should be fixed, but enough exists in the wild
to make this change harmless and worthy.

Patch by Khem Raj.

llvm-svn: 260595

8 years ago[GlobalISel][MachineIRBuilder] Fix comments.
Quentin Colombet [Thu, 11 Feb 2016 21:21:40 +0000 (21:21 +0000)]
[GlobalISel][MachineIRBuilder] Fix comments.

llvm-svn: 260594

8 years ago[GlobalISel] Make the getter for MBB in MachneIRBuilder public.
Quentin Colombet [Thu, 11 Feb 2016 21:20:35 +0000 (21:20 +0000)]
[GlobalISel] Make the getter for MBB in MachneIRBuilder public.

llvm-svn: 260593

8 years agoELF: Release Target at end of link().
Rui Ueyama [Thu, 11 Feb 2016 21:18:01 +0000 (21:18 +0000)]
ELF: Release Target at end of link().

Previously, Target held a value until a new value is assigned to the
variable. That was a benign leak -- that was not an unbounded leak
and didn't grab any resources except a small amount of memory. But
it is better to fix than leaving as is.

llvm-svn: 260592

8 years agoELF: Create LinkerScript class to move code out of Writer.
Rui Ueyama [Thu, 11 Feb 2016 21:17:59 +0000 (21:17 +0000)]
ELF: Create LinkerScript class to move code out of Writer.

Previously, we had code for linker scripts in Writer. This patch
separates that as LinkerScript class. The class provides a few
functions to query linker scripts and is also a container of some
linker-script-specific information.

Hopefully, Writer will only implement the default behavior and let
the new class handle gotchas regarding linker scripts.

llvm-svn: 260591

8 years ago[Target] Add a helper function to check if an opcode is invalid after isel.
Quentin Colombet [Thu, 11 Feb 2016 21:16:56 +0000 (21:16 +0000)]
[Target] Add a helper function to check if an opcode is invalid after isel.

llvm-svn: 260590

8 years agoXFAIL TestCommandScriptImmediateOutput on FreeBSD also
Ed Maste [Thu, 11 Feb 2016 21:15:49 +0000 (21:15 +0000)]
XFAIL TestCommandScriptImmediateOutput on FreeBSD also

llvm-svn: 260589

8 years agoAMDGPU/SI: When splitting SMRD instructions, add its users to VALU worklist
Tom Stellard [Thu, 11 Feb 2016 21:14:34 +0000 (21:14 +0000)]
AMDGPU/SI: When splitting SMRD instructions, add its users to VALU worklist

Summary:
When we split SMRD instructions into two MUBUFs we were adding the users
of the newly created MUBUFs to the VALU worklist.  However, the only
users these instructions had was the REG_SEQUENCE that was inserted
by splitSMRD when the original SMRD instruction was split.

We need to make sure to add the users of the original SMRD to the VALU
worklist before it is split.

I have a test case, but it requires one other bug fix, so it will be
added in a later commt.

Reviewers: mareko, arsenm

Subscribers: arsenm, llvm-commits

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

llvm-svn: 260588

8 years agoSet load alignment on aggregate loads.
Pete Cooper [Thu, 11 Feb 2016 21:10:40 +0000 (21:10 +0000)]
Set load alignment on aggregate loads.

When optimizing a extractvalue(load), we generate a load from the
aggregate type.  This load didn't have alignment set and so would
get the alignment of the type.  This breaks when the type is packed
and so the alignment should be lower.

For example, loading { int, int } would give us alignment of 4, but
the original load from this type may have an alignment of 1 if packed.

Reviewed by David Majnemer

Differential revision: http://reviews.llvm.org/D17158

llvm-svn: 260587

8 years agoRevert "LiveIntervalAnalysis: Support moving of subregister defs in handleMove"
Matthias Braun [Thu, 11 Feb 2016 21:07:44 +0000 (21:07 +0000)]
Revert "LiveIntervalAnalysis: Support moving of subregister defs in handleMove"

This is broke a bot:

http://lab.llvm.org:8011/builders/clang-cmake-aarch64-quick/builds/4703/steps/test-suite/logs/test.log

Reverting while I investigate.

This reverts commit r260565.

llvm-svn: 260586

8 years ago[WebAssembly] Reformat WebAssemblyFrameLowering and WebAssemblyISelLowering
Derek Schuff [Thu, 11 Feb 2016 20:57:09 +0000 (20:57 +0000)]
[WebAssembly] Reformat WebAssemblyFrameLowering and WebAssemblyISelLowering

Reviewers: sunfish, jfb

Subscribers: jfb, dschuff

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

llvm-svn: 260585

8 years agoXFAIL this test for PPC64 for now. It looks like the *_MIN_EXP macros are in fact...
Richard Smith [Thu, 11 Feb 2016 20:36:47 +0000 (20:36 +0000)]
XFAIL this test for PPC64 for now. It looks like the *_MIN_EXP macros are in fact defined incorrectly for that target.

llvm-svn: 260583

8 years ago[SelectionDAG] change getConstant() to use the input SDLoc when building splat vectors
Sanjay Patel [Thu, 11 Feb 2016 20:21:24 +0000 (20:21 +0000)]
[SelectionDAG] change getConstant() to use the input SDLoc when building splat vectors

The code change is simple enough: instead of attaching an anonymous SDLoc to splatted
vector constants, use the scalar constant's existing SDLoc since that is what is passed
into getConstant() as a param. But this changes instruction scheduling, so I'll explain
why that happens.

The motivation for this patch starts near:
http://reviews.llvm.org/rL258833
...x86's getZeroVector() could be similarly cleaned up and I thought it would be 'NFC'.
But when I made that change locally, several x86 codegen tests wiggled.

It turns out that the lack of SDLoc consistency in getConstant() changes the way
ScheduleDAGRRList behaves. This is because the SDLoc contains 'IROrder' and some DAG
scheduler algorithms use IROrder for tie-breaking.

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

llvm-svn: 260582

8 years agoAdd parse+sema and regression test for OpenMP firstprivate clause of target directive
Carlo Bertolli [Thu, 11 Feb 2016 20:12:28 +0000 (20:12 +0000)]
Add parse+sema and regression test for OpenMP firstprivate clause of target directive

llvm-svn: 260581

8 years ago[GlobalISel] Add the necessary plumbing to lower formal arguments.
Quentin Colombet [Thu, 11 Feb 2016 19:59:41 +0000 (19:59 +0000)]
[GlobalISel] Add the necessary plumbing to lower formal arguments.

llvm-svn: 260579

8 years agoDwarfDebug: emit type units immediately.
Peter Collingbourne [Thu, 11 Feb 2016 19:57:46 +0000 (19:57 +0000)]
DwarfDebug: emit type units immediately.

Rather than storing type units in a vector and emitting them at the end
of code generation, emit them immediately and destroy them, reclaiming the
memory we were using for their DIEs.

In one benchmark carried out against Chromium's 50 largest (by bitcode
file size) translation units, total peak memory consumption with type units
decreased by median 17%, or by 7% when compared against disabling type units.

Tested using check-{llvm,clang}, the GDB 7.5 test suite (with
'-fdebug-types-section') and by eyeballing llvm-dwarfdump output on those
Chromium translation units with split DWARF both disabled and enabled, and
verifying that the only changes were to addresses and abbreviation ordering.

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

llvm-svn: 260578

8 years agoIn C11, provide macros FLT_DECIMAL_DIG, DBL_DECIMAL_DIG, and LDBL_DECIMAL_DIG in...
Richard Smith [Thu, 11 Feb 2016 19:57:37 +0000 (19:57 +0000)]
In C11, provide macros FLT_DECIMAL_DIG, DBL_DECIMAL_DIG, and LDBL_DECIMAL_DIG in <float.h>.

Patch by Jorge Teixeira!

llvm-svn: 260577

8 years agoUse copy initialization.
Rafael Espindola [Thu, 11 Feb 2016 19:54:18 +0000 (19:54 +0000)]
Use copy initialization.

We can do it since getMemBuffer returns a unique_ptr.

llvm-svn: 260576

8 years ago[AArch64] Trivial implementation of lower return for the IRTranslator.
Quentin Colombet [Thu, 11 Feb 2016 19:45:27 +0000 (19:45 +0000)]
[AArch64] Trivial implementation of lower return for the IRTranslator.

llvm-svn: 260574

8 years ago[codeview] Add test intended for r260571
Reid Kleckner [Thu, 11 Feb 2016 19:44:26 +0000 (19:44 +0000)]
[codeview] Add test intended for r260571

llvm-svn: 260573

8 years ago[X86] New pass to change byte and word instructions to zero-extending versions.
Kevin B. Smith [Thu, 11 Feb 2016 19:43:04 +0000 (19:43 +0000)]
[X86] New pass to change byte and word instructions to zero-extending versions.
Differential Revision: http://reviews.llvm.org/D17032

llvm-svn: 260572

8 years ago[codeview] Fix bug around multi-level wrapper inlining
Reid Kleckner [Thu, 11 Feb 2016 19:41:47 +0000 (19:41 +0000)]
[codeview] Fix bug around multi-level wrapper inlining

If there were wrapper functions with no instructions of their own in the
inlining tree, we would fail to emit InlineSite records for them.

llvm-svn: 260571

8 years agoWork around regression in glibc 2.22: request that glibc provides the correct
Richard Smith [Thu, 11 Feb 2016 19:40:06 +0000 (19:40 +0000)]
Work around regression in glibc 2.22: request that glibc provides the correct
prototypes for <string.h> functions that are converted into overload sets in
C++. This matches the existing workaround in <wchar.h>.

llvm-svn: 260570

8 years ago[AArch64] Plug the beginning of the GlobalISel pipeline.
Quentin Colombet [Thu, 11 Feb 2016 19:35:06 +0000 (19:35 +0000)]
[AArch64] Plug the beginning of the GlobalISel pipeline.

llvm-svn: 260569

8 years agoPlay nice with Visual Studio and attributes
Quentin Colombet [Thu, 11 Feb 2016 19:33:21 +0000 (19:33 +0000)]
Play nice with Visual Studio and attributes

llvm-svn: 260568

8 years ago[PR26550] Use a different TBAA root for C++ vs C.
Manman Ren [Thu, 11 Feb 2016 19:19:18 +0000 (19:19 +0000)]
[PR26550] Use a different TBAA root for C++ vs C.

This commit changes the root from "Simple C/C++ TBAA" to "Simple C++ TBAA" for
C++.

The problem is that the type name in the TBAA nodes is generated differently
for C vs C++. If we link an IR file for C with an IR file for C++, since they
have the same root and the type names are different, accesses to the two type
nodes will be considered no-alias, even though the two type nodes are from
the same type in a header file.

The fix is to use different roots for C and C++. Types from C will be treated
conservatively in respect to types from C++.

Follow-up commits will change the C root to "Simple C TBAA" plus some mangling
change for C types to make it a little more aggresive.

llvm-svn: 260567

8 years ago[CMake] Produce an empty library for GlobalISel when not building it.
Quentin Colombet [Thu, 11 Feb 2016 19:18:27 +0000 (19:18 +0000)]
[CMake] Produce an empty library for GlobalISel when not building it.
The rational for this change is that LLVMBuild cannot express conditional
dependencies. Therefore, when we start optionally using GlobalISel library for
say AArch64, without that change, all the tools that use the AArch64 library
would need to explicitly link with GlobalISel when we ask for it.

This does not scale.

Instead, we will set the dependencies between the target and GlobalISel and if
we did not ask to build GlobalISel, the library will just be empty.

Thanks to Chris Bieneman and Mehdi Animi for the idea.

llvm-svn: 260566

8 years agoLiveIntervalAnalysis: Support moving of subregister defs in handleMove
Matthias Braun [Thu, 11 Feb 2016 19:03:53 +0000 (19:03 +0000)]
LiveIntervalAnalysis: Support moving of subregister defs in handleMove

If two definitions write to independent subregisters then they can be
put in any order. LiveIntervalAnalysis::handleMove() did not support
this previously because it looks like moving a definition of a vreg past
another one.

This is a modified version of a patch proposed (two years ago) by
Vincent Lejeune! This version does not touch the read-undef flags and is
extended for the case of moving a subregister def behind all uses - this
can happen for subregister defs that are completely unused.

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

llvm-svn: 260565

8 years ago[LSan] Test case fix: mode debug output, synchronization instead of sleep().
Alexey Samsonov [Thu, 11 Feb 2016 19:03:09 +0000 (19:03 +0000)]
[LSan] Test case fix: mode debug output, synchronization instead of sleep().

llvm-svn: 260564

8 years ago[Modules] Early-exit if ReadOptionsBlock fails to avoid crashing
Ben Langmuir [Thu, 11 Feb 2016 18:54:02 +0000 (18:54 +0000)]
[Modules] Early-exit if ReadOptionsBlock fails to avoid crashing

If we didn't tell ReadOptionsBlock to allow failures then we can't
assume that the stream is not in the middle of a block if it returns
out-of-date. This was causing a crash when we tried to continue reading.

Also, it's just generally a good idea to early-exit if we're doing
implicit module builds, since we will want to immediately rebuild this
module anyway and there's no reason to waste time continuing after
failure.

rdar://problem/24114938

llvm-svn: 260563

8 years ago[GlobalISel] Teach the IRTranslator how to lower returns.
Quentin Colombet [Thu, 11 Feb 2016 18:53:28 +0000 (18:53 +0000)]
[GlobalISel] Teach the IRTranslator how to lower returns.

llvm-svn: 260562

8 years ago[ASan] Disable test that uses profile runtime on Windows.
Alexey Samsonov [Thu, 11 Feb 2016 18:26:57 +0000 (18:26 +0000)]
[ASan] Disable test that uses profile runtime on Windows.

llvm-svn: 260561

8 years ago[AMDGPU] Fix for "v_div_scale_f64 reg, vcc, ..." parsing
Tom Stellard [Thu, 11 Feb 2016 18:25:26 +0000 (18:25 +0000)]
[AMDGPU] Fix for "v_div_scale_f64 reg, vcc, ..." parsing

Summary:
Added support for "VOP3Only" attribute in VOP3bInst encoding.
Set VOP3Only=1 for V_DIV_SCALE_F64/32 insns.
Added support for multi-dest instructions in AMDGPUAs::cvt*().
Added lit test for "V_DIV_SCALE_F64|F32 vreg,vcc|sreg,vreg,vreg,vreg".

Reviewers: tstellarAMD, arsenm

Subscribers: arsenm, SamWot, nhaustov, vpykhtin

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

Patch By: Artem Tamazov

llvm-svn: 260560

8 years agoImprove ReadRegister for RegisterContextWindowsx86
Adrian McCarthy [Thu, 11 Feb 2016 18:24:57 +0000 (18:24 +0000)]
Improve ReadRegister for RegisterContextWindowsx86

In some circumstances (notably, certain minidumps), the thread CONTEXT does not have values for the
control registers (EIP, ESP, EBP, EFLAGS).  There are flags in the CONTEXT which indicate which
portions are valid, but those flags weren't checked.  The old code would not detect this and give a
garbage value for the register.  The new code will log the problem and return an error.

I consolidated the error checking and logging into a helper function, which makes the big switch
statement easier to read and verify.

Ran tests to ensure this doesn't break anything.  Manually verified that a minidump without info on
the control registers now indicates the problem instead of giving bad information.

Differential Review: http://reviews.llvm.org/D17152

llvm-svn: 260559

8 years ago[GlobalISel] Add a type to MachineInstr.
Quentin Colombet [Thu, 11 Feb 2016 18:22:37 +0000 (18:22 +0000)]
[GlobalISel] Add a type to MachineInstr.
We actually need that information only for generic instructions, therefore it
would be nice not to have to pay the extra memory consumption for all
instructions. Especially because a typed non-generic instruction does not make
sense.

The question is then, is it possible to have that information in a union or
something?
My initial thought was that we could have a derived class GenericMachineInstr
with additional information, but in practice it makes little to no sense since
generic MachineInstrs are likely turned into non-generic ones by just switching
the opcode. In other words, we don't want to go through the process of creating
a new, non-generic MachineInstr, object each time we do this switch. The memory
benefit probably is not worth the extra compile time.

Another option would be to keep the type of the MachineInstr in a side table.
This would induce an extra indirection though.

Anyway, I will file a PR to discuss about it and remember we need to come back
to it at some point.

llvm-svn: 260558

8 years ago[NVPTX] emit .file directives for files referenced by subprograms.
Artem Belevich [Thu, 11 Feb 2016 18:21:47 +0000 (18:21 +0000)]
[NVPTX] emit .file directives for files referenced by subprograms.

.. so .loc directives referring to those files work correctly.

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

llvm-svn: 260557

8 years agoRevert r260514 because it has a bogus commit message.
Eric Fiselier [Thu, 11 Feb 2016 18:21:18 +0000 (18:21 +0000)]
Revert r260514 because it has a bogus commit message.

llvm-svn: 260556

8 years ago[Driver] Add support for Qualcomm's Kryo CPU.
Chad Rosier [Thu, 11 Feb 2016 18:09:31 +0000 (18:09 +0000)]
[Driver] Add support for Qualcomm's Kryo CPU.

http://reviews.llvm.org/D17124

llvm-svn: 260555

8 years ago[LSan] Fix a crash when LSan hits a guard page while scanning thread stack for pointers.
Alexey Samsonov [Thu, 11 Feb 2016 18:07:17 +0000 (18:07 +0000)]
[LSan] Fix a crash when LSan hits a guard page while scanning thread stack for pointers.

Summary:
In some cases stack pointer register (SP) doesn't point into the thread
stack: e.g. if one is using swapcontext(). In this case LSan
conservatively tries to scan the whole thread stack for pointers.
However, thread stack (at least in glibc implementation) may also
include guard pages, causing LSan to crash when it's reading from them.

One of the solutions is to use a pthread_attr_getguardsize() to adjust
the calculated stack boundaries. However, here we're just using
IsAccessibleMemoryRange to skip guard pages and make the code (slightly)
less platform-specific.

Reviewers: kcc

Subscribers: llvm-commits

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

llvm-svn: 260554

8 years ago[GlobalISel] Add a hook in TargetConfigPass to run GlobalISel.
Quentin Colombet [Thu, 11 Feb 2016 17:57:22 +0000 (17:57 +0000)]
[GlobalISel] Add a hook in TargetConfigPass to run GlobalISel.

llvm-svn: 260553

8 years agoRemove unused includes
David Majnemer [Thu, 11 Feb 2016 17:54:39 +0000 (17:54 +0000)]
Remove unused includes

llvm-svn: 260552

8 years ago[GlobalISel][IRTranslator] Change the ownership of the MIRBuilder field.
Quentin Colombet [Thu, 11 Feb 2016 17:53:23 +0000 (17:53 +0000)]
[GlobalISel][IRTranslator] Change the ownership of the MIRBuilder field.

llvm-svn: 260551

8 years ago[GlobalISel][IRTranslator] Fix a typo in assert.
Quentin Colombet [Thu, 11 Feb 2016 17:52:28 +0000 (17:52 +0000)]
[GlobalISel][IRTranslator] Fix a typo in assert.

llvm-svn: 260550

8 years ago[GlobalISel][IRTranslator] Teach the pass how to translate Add instructions.
Quentin Colombet [Thu, 11 Feb 2016 17:51:31 +0000 (17:51 +0000)]
[GlobalISel][IRTranslator] Teach the pass how to translate Add instructions.

llvm-svn: 260549

8 years agoRevert "Revert r260388 "[MS ABI] Never reference dllimport'd vtables""
David Majnemer [Thu, 11 Feb 2016 17:49:28 +0000 (17:49 +0000)]
Revert "Revert r260388 "[MS ABI] Never reference dllimport'd vtables""

This reverts commit r260449.

We would supress our emission of vftable definitions if we thought
another translation unit would provide the definition because we saw an
explicit instantiation declaration.  This is not the case with
dllimport, we want to synthesize a definition of the vftable regardless.

This fixes PR26569.

llvm-svn: 260548

8 years ago[GlobalISel] Add a MachineIRBuilder class.
Quentin Colombet [Thu, 11 Feb 2016 17:44:59 +0000 (17:44 +0000)]
[GlobalISel] Add a MachineIRBuilder class.
Helper class to build machine instrs. This is a higher abstraction
than MachineInstrBuilder.

llvm-svn: 260547

8 years ago[Renderscript] Fix typo in mips64 argument reading code.
Aidan Dodds [Thu, 11 Feb 2016 17:17:12 +0000 (17:17 +0000)]
[Renderscript] Fix typo in mips64 argument reading code.

A typo in the mips64 argument reading code would cause register passed arguments to be truncated to 32bits.

llvm-svn: 260546

8 years ago[lanai] Add Lanai triple.
Jacques Pienaar [Thu, 11 Feb 2016 17:16:20 +0000 (17:16 +0000)]
[lanai] Add Lanai triple.

Add triple for the Lanai backend.

General Lanai backend discussion on llvm-dev thread "[RFC] Lanai backend".

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

llvm-svn: 260545

8 years agoAdd a test case to show isKnownNonZero() returns correctly; NFC
Jun Bum Lim [Thu, 11 Feb 2016 17:11:49 +0000 (17:11 +0000)]
Add a test case to show isKnownNonZero() returns correctly; NFC

Summary:
Added a test case just to make sure that isKnownNonZero() returns false
when we cannot guarantee that a ConstantExpr is a non-zero constant.

Reviewers: sanjoy, majnemer, mcrosier, nlewycky

Subscribers: nlewycky, mssimpso, mcrosier, llvm-commits

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

llvm-svn: 260544