platform/upstream/llvm.git
10 years ago[x86] Add AVX1 and AVX2 testing to all of the 128-bit shuffle test
Chandler Carruth [Tue, 30 Sep 2014 22:16:23 +0000 (22:16 +0000)]
[x86] Add AVX1 and AVX2 testing to all of the 128-bit shuffle test
cases.

While clearly we don't need the AVX vector width, these ISA extensions
often cause us to select different instructions and we should cover them
even with the narrow vector width.

Also, while here, nuke the stress_test2 contents. There is no reason to
try to FileCheck this entire body when it is mostly a test for
successfully surviving the code generator.

llvm-svn: 218710

10 years ago[x86] Update the exact FileCheck syntax of the 256-bit and 512-bit
Chandler Carruth [Tue, 30 Sep 2014 22:04:45 +0000 (22:04 +0000)]
[x86] Update the exact FileCheck syntax of the 256-bit and 512-bit
shuffle tests to match that used in the script I posted and now used
consistently in 128-bit tests.

Nothing interesting changing here, just using the label name as the
FileCheck label and a slightly more general comment marker consumption
strategy.

llvm-svn: 218709

10 years agoAdjust test case addition in r218702 so as not to fail when the X86 target isn't...
David Blaikie [Tue, 30 Sep 2014 22:02:27 +0000 (22:02 +0000)]
Adjust test case addition in r218702 so as not to fail when the X86 target isn't built.

llvm-svn: 218708

10 years ago[x86] Rework all of the 128-bit vector shuffle tests with my handy test
Chandler Carruth [Tue, 30 Sep 2014 21:44:34 +0000 (21:44 +0000)]
[x86] Rework all of the 128-bit vector shuffle tests with my handy test
updating script so that they are more thorough and consistent.

Specific fixes here include:
- Actually test VEX-encoded AVX mnemonics.
- Actually use an SSE 4.1 run to test SSE 4.1 features!
- Correctly check instructions sequences from the start of the function.
- Elide the shuffle operands and comment designator in a consistent way.
- Test all of the architectures instead of just the ones I was motivated
  to manually author.

I've gone back through and fixed up any egregious issues I spotted. Let
me know if I missed something you really dislike.

One downside to this is that we're now not as diligently using FileCheck
variables for registers. I would be much more concerned with this if we
had larger register usage, but there just aren't that interesting of
register choices here and most of the registers are constrained by the
ABI. Ultimately, I don't think this is likely to be the maintenance
burden for these tests and updating them again should be staright
forward.

llvm-svn: 218707

10 years ago[PECOFF] Fix /entry option.
Rui Ueyama [Tue, 30 Sep 2014 21:39:49 +0000 (21:39 +0000)]
[PECOFF] Fix /entry option.

This is yet another edge case of ambiguous name resolution.
When a symbol is specified with /entry:SYM, SYM may be resolved
to the C++ mangled function name (?SYM@@YAXXZ).

llvm-svn: 218706

10 years ago[PECOFF] Move helper function out of class
Rui Ueyama [Tue, 30 Sep 2014 21:39:46 +0000 (21:39 +0000)]
[PECOFF] Move helper function out of class

No functionality change intended.

llvm-svn: 218705

10 years ago[mach-o] add file comment to compact unwind pass
Tim Northover [Tue, 30 Sep 2014 21:32:46 +0000 (21:32 +0000)]
[mach-o] add file comment to compact unwind pass

llvm-svn: 218704

10 years ago[mach-o] create __unwind_info section on x86_64
Tim Northover [Tue, 30 Sep 2014 21:29:54 +0000 (21:29 +0000)]
[mach-o] create __unwind_info section on x86_64

This is a minimally useful pass to construct the __unwind_info section in a
final object from the various __compact_unwind inputs. Currently it doesn't
produce any compressed pages, only works for x86_64 and will fail if any
function ends up without __compact_unwind.

rdar://problem/18208653

llvm-svn: 218703

10 years agoDisable the -gmlt optimization implemented in r218129 under Darwin due to issues...
David Blaikie [Tue, 30 Sep 2014 21:28:32 +0000 (21:28 +0000)]
Disable the -gmlt optimization implemented in r218129 under Darwin due to issues with dsymutil.

r218129 omits DW_TAG_subprograms which have no inlined subroutines when
emitting -gmlt data. This makes -gmlt very low cost for -O0 builds.

Darwin's dsymutil reasonably considers a CU empty if it has no
subprograms (which occurs with the above optimization in -O0 programs
without any force_inline function calls) and drops the line table, CU,
and everything in this situation, making backtraces impossible.

Until dsymutil is modified to account for this, disable this
optimization on Darwin to preserve the desired functionality.
(see r218545, which should be reverted after this patch, for other
discussion/details)

Footnote:
In the long term, it doesn't look like this scheme (of simplified debug
info to describe inlining to enable backtracing) is tenable, it is far
too size inefficient for optimized code (the DW_TAG_inlined_subprograms,
even once compressed, are nearly twice as large as the line table
itself (also compressed)) and we'll be considering things like Cary's
two level line table proposal to encode all this information directly in
the line table.

llvm-svn: 218702

10 years agoUse the target-specified iteration count to opt out of any further refinement of...
Sanjay Patel [Tue, 30 Sep 2014 20:44:23 +0000 (20:44 +0000)]
Use the target-specified iteration count to opt out of any further refinement of an estimate. NFC.

llvm-svn: 218700

10 years agoNot all processes have a Dynamic Loader. Be sure to check that it exists before...
Jim Ingham [Tue, 30 Sep 2014 20:33:25 +0000 (20:33 +0000)]
Not all processes have a Dynamic Loader.  Be sure to check that it exists before using it.

<rdar://problem/18491391>

llvm-svn: 218699

10 years agoSplit the estimate() interface into separate functions for each type. NFC.
Sanjay Patel [Tue, 30 Sep 2014 20:28:48 +0000 (20:28 +0000)]
Split the estimate() interface into separate functions for each type. NFC.

It was hacky to use an opcode as a switch because it won't always match
(rsqrte != sqrte), and it looks like we'll need to add more special casing
per arch than I had hoped for. Eg, x86 will prefer a different NR estimate
implementation. ARM will want to use it's 'step' instructions. There also
don't appear to be any new estimate instructions in any arch in a long,
long time. Altivec vloge and vexpte may have been the first and last in
that field...

llvm-svn: 218698

10 years agoInstrProf: Remove an unused member (NFC)
Justin Bogner [Tue, 30 Sep 2014 20:21:50 +0000 (20:21 +0000)]
InstrProf: Remove an unused member (NFC)

llvm-svn: 218697

10 years ago[PECOFF] Allow /export:<symbol>,PRTVATE.
Rui Ueyama [Tue, 30 Sep 2014 20:09:31 +0000 (20:09 +0000)]
[PECOFF] Allow /export:<symbol>,PRTVATE.

PRIVATE option is also an undocumented feature.

llvm-svn: 218696

10 years ago[PECOFF] Fix /export option.
Rui Ueyama [Tue, 30 Sep 2014 20:03:11 +0000 (20:03 +0000)]
[PECOFF] Fix /export option.

MSDN doesn't say about /export:foo=bar style option, but
it turned out MSVC link.exe actually accepts that. So we need that
too.

It also means that the export directive in the module definition
file and /export command line option are functionally equivalent.

llvm-svn: 218695

10 years agoAvoid a crash after loading an #undef'd macro in code completion
Ben Langmuir [Tue, 30 Sep 2014 20:00:18 +0000 (20:00 +0000)]
Avoid a crash after loading an #undef'd macro in code completion

In code-completion, don't assume there is a MacroInfo for everything,
since we aren't serializing the def corresponding to a later #undef in
the same module.  Also setup the HadMacro bit correctly for undefs to
avoid an assertion failure.

rdar://18416901

llvm-svn: 218694

10 years agoRecommit r218010 [FastISel][AArch64] Fold bit test and branch into TBZ and TBNZ.
Juergen Ributzka [Tue, 30 Sep 2014 19:59:35 +0000 (19:59 +0000)]
Recommit r218010 [FastISel][AArch64] Fold bit test and branch into TBZ and TBNZ.

Note: This version fixed an issue with the TBZ/TBNZ instructions that were
generated in FastISel. The issue was that the 64bit version of TBZ (TBZX)
automagically sets the upper bit of the immediate field that is used to specify
the bit we want to test. To test for any of the lower 32bits we have to first
extract the subregister and use the 32bit version of the TBZ instruction (TBZW).

Original commit message:
Teach selectBranch to fold bit test and branch into a single instruction (TBZ or
TBNZ).

llvm-svn: 218693

10 years agoR600/SI: Fix printing of clamp and omod
Matt Arsenault [Tue, 30 Sep 2014 19:49:48 +0000 (19:49 +0000)]
R600/SI: Fix printing of clamp and omod

No tests for omod since nothing uses it yet, but
this should get rid of the remaining annoying trailing
zeros after some instructions.

llvm-svn: 218692

10 years agoR600/SI: Update VOP3b to not include obsolete operands
Matt Arsenault [Tue, 30 Sep 2014 19:49:43 +0000 (19:49 +0000)]
R600/SI: Update VOP3b to not include obsolete operands

abs / neg are now part of the srcN_modifiers operands

llvm-svn: 218691

10 years ago[PECOFF] Fix __imp_ prefix on x64.
Rui Ueyama [Tue, 30 Sep 2014 19:42:04 +0000 (19:42 +0000)]
[PECOFF] Fix __imp_ prefix on x64.

"__imp_" prefix always starts with double underscores.
When I was writing the original code I misunderstood
that it's "_imp_" on x64.

llvm-svn: 218690

10 years agoclang-format: [JS] Support AllowShortFunctionsOnASingleLine.
Daniel Jasper [Tue, 30 Sep 2014 17:57:06 +0000 (17:57 +0000)]
clang-format: [JS] Support AllowShortFunctionsOnASingleLine.

Specifically, this also counts for stuff like (with style "inline"):
  var x = function() {
    return 1;
  };

llvm-svn: 218689

10 years agoCUDA: mark the target of implicit intrinsics properly
Eli Bendersky [Tue, 30 Sep 2014 17:38:34 +0000 (17:38 +0000)]
CUDA: mark the target of implicit intrinsics properly

r218624 implemented target inference for implicit special members. However,
other entities can be implicit - for example intrinsics. These can not have
inference running on them, so they should be marked host device as before. This
is the safest and most flexible setting, since by construction these functions
don't invoke anything, and we'd like them to be invokable from both host and
device code. LLVM's intrinsics definitions (where these intrinsics come from in
the case of CUDA/NVPTX) have no notion of target, so both host and device
intrinsics can be supported this way.

llvm-svn: 218688

10 years agoAdd SBThreadPlan to this CMakeLists.txt as well.
Jim Ingham [Tue, 30 Sep 2014 17:11:53 +0000 (17:11 +0000)]
Add SBThreadPlan to this CMakeLists.txt as well.

llvm-svn: 218687

10 years agothread state coordinator: add additional assert missing from previous test check-in.
Todd Fiala [Tue, 30 Sep 2014 17:00:52 +0000 (17:00 +0000)]
thread state coordinator: add additional assert missing from previous test check-in.

llvm-svn: 218686

10 years agoFix FreeBSD build.
Zachary Turner [Tue, 30 Sep 2014 16:56:56 +0000 (16:56 +0000)]
Fix FreeBSD build.

llvm-svn: 218685

10 years agoFixup some minor issues with HostProcess.
Zachary Turner [Tue, 30 Sep 2014 16:56:40 +0000 (16:56 +0000)]
Fixup some minor issues with HostProcess.

llvm-svn: 218684

10 years agothread state coordinator: add test to be explicit about resume behavior in presence...
Todd Fiala [Tue, 30 Sep 2014 16:56:28 +0000 (16:56 +0000)]
thread state coordinator: add test to be explicit about resume behavior in presence of deferred stop notification still pending.

There is a state transition that seems potentially buggy that I am capturing and
logging here, and including an explicit test to demonstrate expected behavior.  See new test
for detailed description.  Added logging around this area since, if we hit it, we
may have a usage bug, or a new state transition we really need to investigate.

This is around this scenario:
Thread C deferred stop notification awaiting thread A and thread B to stop.
Thread A stops.
Thread A requests resume.
Thread B stops.

Here we will explicitly signal the deferred stop notification after thread B
stops even though thread A is now resumed.  Copious logging happens here.

llvm-svn: 218683

10 years agoExtend C disassembler API to allow specifying target features
Bradley Smith [Tue, 30 Sep 2014 16:31:40 +0000 (16:31 +0000)]
Extend C disassembler API to allow specifying target features

llvm-svn: 218682

10 years agoAdd numeric extend, trunctate to mips fast-isel
Reed Kotler [Tue, 30 Sep 2014 16:30:13 +0000 (16:30 +0000)]
Add numeric extend, trunctate to mips fast-isel

Summary:
 Add numeric extend, trunctate to mips fast-isel

 Reactivates D4827

Test Plan:
fpext.ll
loadstoreconv.ll

Reviewers: dsanders

Subscribers: mcrosier

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

llvm-svn: 218681

10 years ago[AArch64] Remove unnecessary whitespace. (Test commit)
Tom Coxon [Tue, 30 Sep 2014 16:23:16 +0000 (16:23 +0000)]
[AArch64] Remove unnecessary whitespace. (Test commit)

llvm-svn: 218680

10 years agoFix cmake build for new thread plan files.
Todd Fiala [Tue, 30 Sep 2014 15:58:56 +0000 (15:58 +0000)]
Fix cmake build for new thread plan files.

llvm-svn: 218679

10 years ago[DAG] Check in advance if a build_vector has a legal type before attempting to conver...
Andrea Di Biagio [Tue, 30 Sep 2014 15:30:22 +0000 (15:30 +0000)]
[DAG] Check in advance if a build_vector has a legal type before attempting to convert it into a shuffle.

Currently, the DAG Combiner only tries to convert type-legal build_vector nodes
into shuffles. This patch simply moves the logic that checks if a
build_vector has a legal value type up before we even start analyzing the
operands. This allows to early exit immediately from method
'visitBUILD_VECTOR' if the node type is known to be illegal.

No functional change intended.

llvm-svn: 218677

10 years agoRevert r218673 'llvm-cov: add test for report's function & file association.'
Alex Lorenz [Tue, 30 Sep 2014 14:48:12 +0000 (14:48 +0000)]
Revert r218673 'llvm-cov: add test for report's function & file association.'

Test causes buildbot failures.

llvm-svn: 218676

10 years ago[UBsan] Disable summary.cpp on Darwin. The test requires ubsan-asan, which does not...
Alexander Potapenko [Tue, 30 Sep 2014 13:55:44 +0000 (13:55 +0000)]
[UBsan] Disable summary.cpp on Darwin. The test requires ubsan-asan, which does not work yet.

llvm-svn: 218675

10 years ago[asan] XFAIL one test on Android.
Evgeniy Stepanov [Tue, 30 Sep 2014 12:54:32 +0000 (12:54 +0000)]
[asan] XFAIL one test on Android.

And add a missing return in main, just in case.

llvm-svn: 218674

10 years agollvm-cov: add test for report's function & file association.
Alex Lorenz [Tue, 30 Sep 2014 12:52:31 +0000 (12:52 +0000)]
llvm-cov: add test for report's function & file association.

This commit adds a test which checks that the functions defined in header files will get associated with the header files rather than the source files in the reports.

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

llvm-svn: 218673

10 years agollvm-cov: Use the number of executed functions for the function coverage metric.
Alex Lorenz [Tue, 30 Sep 2014 12:45:13 +0000 (12:45 +0000)]
llvm-cov: Use the number of executed functions for the function coverage metric.

This commit fixes llvm-cov's function coverage metric by using the number of executed functions instead of the number of fully covered functions.

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

llvm-svn: 218672

10 years agoIntroduce support for custom wrappers for vararg functions.
Lorenzo Martignoni [Tue, 30 Sep 2014 12:33:16 +0000 (12:33 +0000)]
Introduce support for custom wrappers for vararg functions.

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

llvm-svn: 218671

10 years ago[AVX512] Added intrinsics for 128-, 256- and 512-bit versions of VCMPGT{BWDQ}.
Robert Khasanov [Tue, 30 Sep 2014 12:15:52 +0000 (12:15 +0000)]
[AVX512] Added intrinsics for 128-, 256- and 512-bit versions of VCMPGT{BWDQ}.
Patch by Sergey Lisitsyn <sergey.lisitsyn@intel.com>

llvm-svn: 218670

10 years ago[AVX512] Added intrinsics for 128- and 256-bit versions of VCMPEQ{BWDQ}
Robert Khasanov [Tue, 30 Sep 2014 11:41:54 +0000 (11:41 +0000)]
[AVX512] Added intrinsics for 128- and 256-bit versions of VCMPEQ{BWDQ}
Fixed lowering of this intrinsics in case when mask is v2i1 and v4i1.
Now cmp intrinsics lower in the following way:
 (i8 (int_x86_avx512_mask_pcmpeq_q_128
             (v2i64 %a), (v2i64 %b), (i8 %mask))) ->
 (i8 (bitcast
   (v8i1 (insert_subvector undef,
           (v2i1 (and (PCMPEQM %a, %b),
                      (extract_subvector
                         (v8i1 (bitcast %mask)), 0))), 0))))

llvm-svn: 218669

10 years ago[AVX512] Added intrinsics for VPCMPEQB and VPCMPEQW.
Robert Khasanov [Tue, 30 Sep 2014 11:32:22 +0000 (11:32 +0000)]
[AVX512] Added intrinsics for VPCMPEQB and VPCMPEQW.
Added new operand type for intrinsics (IIT_V64)

llvm-svn: 218668

10 years ago[AVX512] Enabled intrinsics for VPCMPEQD and VPCMPEQQ.
Robert Khasanov [Tue, 30 Sep 2014 11:19:50 +0000 (11:19 +0000)]
[AVX512] Enabled intrinsics for VPCMPEQD and VPCMPEQQ.
Added CMP_MASK intrinsic type

llvm-svn: 218667

10 years agoMake sure aggregates are properly alligned on MSP430.
Job Noorman [Tue, 30 Sep 2014 11:19:13 +0000 (11:19 +0000)]
Make sure aggregates are properly alligned on MSP430.

llvm-svn: 218666

10 years agoMake sure aggregates are properly alligned on MSP430.
Job Noorman [Tue, 30 Sep 2014 11:15:44 +0000 (11:15 +0000)]
Make sure aggregates are properly alligned on MSP430.

llvm-svn: 218665

10 years ago[asan] Run tests with the default compiler on Android.
Evgeniy Stepanov [Tue, 30 Sep 2014 11:12:41 +0000 (11:12 +0000)]
[asan] Run tests with the default compiler on Android.

llvm-svn: 218664

10 years ago[asan] Re-enable lsan_annotations test on Android.
Evgeniy Stepanov [Tue, 30 Sep 2014 11:11:59 +0000 (11:11 +0000)]
[asan] Re-enable lsan_annotations test on Android.

Was fixed by r218605.

llvm-svn: 218663

10 years ago[UBSan] Use <machine/endian.h> on Darwin.
Alexander Potapenko [Tue, 30 Sep 2014 10:07:37 +0000 (10:07 +0000)]
[UBSan] Use <machine/endian.h> on Darwin.

llvm-svn: 218662

10 years agoMS ABI: Correct layout for empty records
David Majnemer [Tue, 30 Sep 2014 06:45:43 +0000 (06:45 +0000)]
MS ABI: Correct layout for empty records

Empty records do not always have size equivalent to their alignment.
They only do so when their alignment is at least as large as the minimum
empty struct size: 1 byte in C++ and 4 bytes in C.

llvm-svn: 218661

10 years ago[OPENMP] Codegen of the ‘aligned’ clause for the ‘omp simd’ directive.
Alexander Musman [Tue, 30 Sep 2014 05:29:28 +0000 (05:29 +0000)]
[OPENMP] Codegen of the â€˜aligned’ clause for the â€˜omp simd’ directive.
Differential Revision: http://reviews.llvm.org/D5499

llvm-svn: 218660

10 years ago[IndVarSimplify] Widen loop unsigned compares.
Chad Rosier [Tue, 30 Sep 2014 03:17:42 +0000 (03:17 +0000)]
[IndVarSimplify] Widen loop unsigned compares.

This patch extends r217953 to handle unsigned comparison.
Phabricator revision: http://reviews.llvm.org/D5526

llvm-svn: 218659

10 years ago[x86] Revert r218588, r218589, and r218600. These patches were pursuing
Chandler Carruth [Tue, 30 Sep 2014 02:52:28 +0000 (02:52 +0000)]
[x86] Revert r218588, r218589, and r218600. These patches were pursuing
a flawed direction and causing miscompiles. Read on for details.

Fundamentally, the premise of this patch series was to map
VECTOR_SHUFFLE DAG nodes into VSELECT DAG nodes for all blends because
we are going to *have* to lower to VSELECT nodes for some blends to
trigger the instruction selection patterns of variable blend
instructions. This doesn't actually work out so well.

In order to match performance with the existing VECTOR_SHUFFLE
lowering code, we would need to re-slice the blend in order to fit it
into either the integer or floating point blends available on the ISA.
When coming from VECTOR_SHUFFLE (or other vNi1 style VSELECT sources)
this works well because the X86 backend ensures that these types of
operands to VSELECT get sign extended into '-1' and '0' for true and
false, allowing us to re-slice the bits in whatever granularity without
changing semantics.

However, if the VSELECT condition comes from some other source, for
example code lowering vector comparisons, it will likely only have the
required bit set -- the high bit. We can't blindly slice up this style
of VSELECT. Reid found some code using Halide that triggers this and I'm
hopeful to eventually get a test case, but I don't need it to understand
why this is A Bad Idea.

There is another aspect that makes this approach flawed. When in
VECTOR_SHUFFLE form, we have very distilled information that represents
the *constant* blend mask. Converting back to a VSELECT form actually
can lose this information, and so I think now that it is better to treat
this as VECTOR_SHUFFLE until the very last moment and only use VSELECT
nodes for instruction selection purposes.

My plan is to:
1) Clean up and formalize the target pre-legalization DAG combine that
   converts a VSELECT with a constant condition operand into
   a VECTOR_SHUFFLE.
2) Remove any fancy lowering from VSELECT during *legalization* relying
   entirely on the DAG combine to catch cases where we can match to an
   immediate-controlled blend instruction.

One additional step that I'm not planning on but would be interested in
others' opinions on: we could add an X86ISD::VSELECT or X86ISD::BLENDV
which encodes a fully legalized VSELECT node. Then it would be easy to
write isel patterns only in terms of this to ensure VECTOR_SHUFFLE
legalization only ever forms the fully legalized construct and we can't
cycle between it and VSELECT combining.

llvm-svn: 218658

10 years ago[x86] Add some vector-register broadcast operations to the 256-bit v4
Chandler Carruth [Tue, 30 Sep 2014 02:32:36 +0000 (02:32 +0000)]
[x86] Add some vector-register broadcast operations to the 256-bit v4
tests which were missing them.

llvm-svn: 218657

10 years agoFix some errors that crept in when I cut & pasted into emacs.
Jim Ingham [Tue, 30 Sep 2014 01:37:52 +0000 (01:37 +0000)]
Fix some errors that crept in when I cut & pasted into emacs.

llvm-svn: 218656

10 years agoR600: Fix broken check lines, missing scalar case.
Matt Arsenault [Tue, 30 Sep 2014 01:05:29 +0000 (01:05 +0000)]
R600: Fix broken check lines, missing scalar case.

llvm-svn: 218655

10 years agoFix missing C++ mode comment
Matt Arsenault [Tue, 30 Sep 2014 01:05:27 +0000 (01:05 +0000)]
Fix missing C++ mode comment

llvm-svn: 218654

10 years ago[FastISel][AArch64] Fold sign-/zero-extends into the load instruction.
Juergen Ributzka [Tue, 30 Sep 2014 00:49:58 +0000 (00:49 +0000)]
[FastISel][AArch64] Fold sign-/zero-extends into the load instruction.

The sign-/zero-extension of the loaded value can be performed by the memory
instruction for free. If the result of the load has only one use and the use is
a sign-/zero-extend, then we emit the proper load instruction. The extend is
only a register copy and will be optimized away later on.

Other instructions that consume the sign-/zero-extended value are also made
aware of this fact, so they don't fold the extend too.

This fixes rdar://problem/18495928.

llvm-svn: 218653

10 years ago[FastISel][AArch64] Factor out scale factor calculation. NFC.
Juergen Ributzka [Tue, 30 Sep 2014 00:49:54 +0000 (00:49 +0000)]
[FastISel][AArch64] Factor out scale factor calculation. NFC.

Factor out the code that determines the implicit scale factor of memory
operations for a given value type.

llvm-svn: 218652

10 years agoPR20399: Do not assert when adding an implicit member coming from a module at
Richard Smith [Tue, 30 Sep 2014 00:45:29 +0000 (00:45 +0000)]
PR20399: Do not assert when adding an implicit member coming from a module at
writing time.

Patch by Vassil Vassilev!

llvm-svn: 218651

10 years agoAdd a very trivial example for scripted stepping.
Jim Ingham [Tue, 30 Sep 2014 00:24:59 +0000 (00:24 +0000)]
Add a very trivial example for scripted stepping.

llvm-svn: 218650

10 years ago[llvm-objdump] switch some uses of format() to format_hex() and left_justify()
Nick Kledzik [Tue, 30 Sep 2014 00:19:58 +0000 (00:19 +0000)]
[llvm-objdump] switch some uses of format() to format_hex() and left_justify()

llvm-svn: 218649

10 years agoRevert r218616, "Refactor Matcher<T> and DynTypedMatcher to reduce overhead of casts."
NAKAMURA Takumi [Mon, 29 Sep 2014 23:56:21 +0000 (23:56 +0000)]
Revert r218616, "Refactor Matcher<T> and DynTypedMatcher to reduce overhead of casts."

MSC17, aka VS2012, cannot compile it.

  clang/include/clang/ASTMatchers/ASTMatchersInternal.h(387) : error C4519: default template arguments are only allowed on a class template

  clang/include/clang/ASTMatchers/ASTMatchersInternal.h(443) : see reference to class template instantiation 'clang::ast_matchers::internal::Matcher<T>' being compiled

llvm-svn: 218648

10 years agoclang/test/CodeGenCXX/vararg-non-pod-ms-compat.cpp: Appease -Asserts to skip 1st...
NAKAMURA Takumi [Mon, 29 Sep 2014 23:55:58 +0000 (23:55 +0000)]
clang/test/CodeGenCXX/vararg-non-pod-ms-compat.cpp: Appease -Asserts to skip 1st alloca.

llvm-svn: 218647

10 years agoupdate library dependency
Nick Kledzik [Mon, 29 Sep 2014 23:52:50 +0000 (23:52 +0000)]
update library dependency

llvm-svn: 218646

10 years agoTry to fix non-asserts CodeGenCXX/vararg-non-pod-ms-compat.cpp
Hans Wennborg [Mon, 29 Sep 2014 23:45:00 +0000 (23:45 +0000)]
Try to fix non-asserts CodeGenCXX/vararg-non-pod-ms-compat.cpp

There are two GEP's in the function, and it seems the X64 CHECK
was matching the wrong one.

llvm-svn: 218645

10 years agoSimplify conditional.
Eric Christopher [Mon, 29 Sep 2014 23:31:13 +0000 (23:31 +0000)]
Simplify conditional.

llvm-svn: 218643

10 years agoThis checkin is the first step in making the lldb thread stepping mechanism more...
Jim Ingham [Mon, 29 Sep 2014 23:17:18 +0000 (23:17 +0000)]
This checkin is the first step in making the lldb thread stepping mechanism more accessible from
the user level.  It adds the ability to invent new stepping modes implemented by python classes,
and to view the current thread plan stack and to some extent alter it.

I haven't gotten to documentation or tests yet.  But this should not cause any behavior changes
if you don't use it, so its safe to check it in now and work on it incrementally.

llvm-svn: 218642

10 years agodwarf: add dwarf v4 maximum_operations_per_instruction to DWARFDebugLine.
Todd Fiala [Mon, 29 Sep 2014 23:11:09 +0000 (23:11 +0000)]
dwarf: add dwarf v4 maximum_operations_per_instruction to DWARFDebugLine.

See http://reviews.llvm.org/D5533 for details.

Change by Tong Shen.

llvm-svn: 218641

10 years agoDon't trap when passing non-POD arguments to variadic functions in MS-compatibility...
Hans Wennborg [Mon, 29 Sep 2014 23:06:57 +0000 (23:06 +0000)]
Don't trap when passing non-POD arguments to variadic functions in MS-compatibility mode

Clang warns (treated as error by default, but still ignored in system headers)
when passing non-POD arguments to variadic functions, and generates a trap
instruction to crash the program if that code is ever run.

Unfortunately, MSVC happily generates code for such calls without a warning,
and there is code in system headers that use it.

This makes Clang not insert the trap instruction when in -fms-compatibility
mode, while still generating the warning/error message.

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

llvm-svn: 218640

10 years ago[mach-o] Move implementation of MachOFileNode::parse
Nick Kledzik [Mon, 29 Sep 2014 23:04:24 +0000 (23:04 +0000)]
[mach-o] Move implementation of MachOFileNode::parse

Move method implementation from header file to .cpp file.  No functionality
change.

llvm-svn: 218639

10 years agothread state coordinator: added a thread resume request and related tests.
Todd Fiala [Mon, 29 Sep 2014 22:57:05 +0000 (22:57 +0000)]
thread state coordinator: added a thread resume request and related tests.

The thread resume block is executed in the normal flow of thread
state queued event processing.  The tests verify that it is executed
when we track the thread to be stopped and skipped when we track
it to already be running.

llvm-svn: 218638

10 years ago[AVX512] Use X86VectorVTInfo in the masking helper classes and the FMAs
Adam Nemet [Mon, 29 Sep 2014 22:54:41 +0000 (22:54 +0000)]
[AVX512] Use X86VectorVTInfo in the masking helper classes and the FMAs

No functionality change.

Makes the code more compact (see the FMA part).

This needs a new type attribute MemOpFrag in X86VectorVTInfo.  For now I only
defined this in the simple cases.  See the commment before the attribute.

Diff of X86.td.expanded before and after is empty except for the appearance of
the new attribute.

llvm-svn: 218637

10 years agoWinCOFFObjectWriter: optimize the string table for common suffices
Hans Wennborg [Mon, 29 Sep 2014 22:43:20 +0000 (22:43 +0000)]
WinCOFFObjectWriter: optimize the string table for common suffices

This is a follow-up from r207670 which did the same for ELF.

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

llvm-svn: 218636

10 years agoUse ClangToLLVMArgsMapping in CodeGenTypes::GetFunctionType(). NFC.
Alexey Samsonov [Mon, 29 Sep 2014 22:08:00 +0000 (22:08 +0000)]
Use ClangToLLVMArgsMapping in CodeGenTypes::GetFunctionType(). NFC.

This is the last piece of CGCall code that had implicit assumptions about
the order in which Clang arguments are translated to LLVM ones (positions
of inalloca argument, sret, this, padding arguments etc.) Now all of
this data is encapsulated in ClangToLLVMArgsMapping. If this information
would be required somewhere else, this class can be moved to a separate
header or pulled into CGFunctionInfo.

llvm-svn: 218634

10 years ago[lld] [ELF] Support for general dynamic TLS relocations on X86_64
Rafael Auler [Mon, 29 Sep 2014 22:05:26 +0000 (22:05 +0000)]
[lld] [ELF] Support for general dynamic TLS relocations on X86_64

Summary:
This patch adds support for the general dynamic TLS access model for X86_64 (see www.akkadia.org/drepper/tls.pdf).

To properly support TLS, the patch also changes the __tls_get_addr atom to be a shared library atom instead of a regularly defined atom (the previous lld approach). This closely models the reality of a function that will be resolved at runtime by the dynamic linker and loader itself (ld.so). I was tempted to force LLD to link against ld.so itself to resolve these symbols, but since GNU ld does not need the ld.so library to resolve this symbol, I decided to mimic its behavior and keep hardwired a definition of __tls_get_addr in the lld code.

This patch also moves some important logic that previously was only available to the MIPS lld backend to be used to all ELF backends. This logic, which now lives in the DefaultLayout class, will monitor which external (shared lib) symbols are really imported by the current module and will only populate the dynamic symbol table with used symbols, as opposed to the previous approach of dumping all shared lib symbols in the dynamic symbol table. This is important to this patch to avoid __tls_get_addr from getting injected into all dynamic symbol tables.

By solving the previous problem of always adding __tls_get_addr, now the produced symbol tables are slightly smaller. But this impacted several tests that relied on hardwired/predefined sizes of the symbol table, requiring this patch to update such tests.

Test Plan: Added a LIT test case that exercises a simple use case of TLS variable in a shared library.

Reviewers: ruiu, rafael, Bigcheese, shankarke

Reviewed By: Bigcheese, shankarke

Subscribers: emaste, shankarke, joerg, kledzik, mcrosier, llvm-commits

Projects: #lld

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

llvm-svn: 218633

10 years agoAdd soft-float to the key for the subtarget lookup in the TargetMachine
Eric Christopher [Mon, 29 Sep 2014 21:57:54 +0000 (21:57 +0000)]
Add soft-float to the key for the subtarget lookup in the TargetMachine
map, this makes sure that we can compile the same code for two different
ABIs (hard and soft float) in the same module.

Update one testcase accordingly (and fix some confusing naming) and
add a new testcase as well with the ordering swapped which would
highlight the problem.

llvm-svn: 218632

10 years agoFix spelling and reflow comments.
Eric Christopher [Mon, 29 Sep 2014 21:57:52 +0000 (21:57 +0000)]
Fix spelling and reflow comments.

llvm-svn: 218631

10 years agoTest commit. Fix a whitespace in ToolChains.cpp.
Rafael Auler [Mon, 29 Sep 2014 21:50:34 +0000 (21:50 +0000)]
Test commit. Fix a whitespace in ToolChains.cpp.

llvm-svn: 218630

10 years agothread state coordinator: add exec reset support, remove empty virtual destructors.
Todd Fiala [Mon, 29 Sep 2014 21:45:21 +0000 (21:45 +0000)]
thread state coordinator: add exec reset support, remove empty virtual destructors.

Also added a test for the reset handling.  The reset/state clearing happens
as a processed queue event.  The only diff vs. standard processing is that
the exec clears the queue before queueing the activity to clear internal state.
i.e. once we get an exec, we really stop doing any other queue-based activity.

llvm-svn: 218629

10 years agoAST: Fix a typo in RecordLayoutBuilder
David Majnemer [Mon, 29 Sep 2014 21:38:08 +0000 (21:38 +0000)]
AST: Fix a typo in RecordLayoutBuilder

No functional change intended.

llvm-svn: 218628

10 years ago[AArch64] Refines the Cortex-A57 Machine Model
Dave Estes [Mon, 29 Sep 2014 21:27:36 +0000 (21:27 +0000)]
[AArch64] Refines the Cortex-A57 Machine Model

Primarily refines all of the instructions with accurate latency
and micro-op information. Refinements largely focus on the NEON
instructions.

Additionally, a few advanced features are modeled, including
forwarding for MAC instructions and hazards for floating point SQRT
and DIV.

Lastly, the issue-width is reduced to three so that the scheduler
will better accommodate the narrower decode and dispatch width.

llvm-svn: 218627

10 years agoUnit test r218187, changing RTDyldMemoryManager::getSymbolAddress's behavior favor...
David Blaikie [Mon, 29 Sep 2014 21:25:13 +0000 (21:25 +0000)]
Unit test r218187, changing RTDyldMemoryManager::getSymbolAddress's behavior favor mangled lookup over unmangled lookup.

The contract of this function seems problematic (fallback in either
direction seems like it could produce bugs in one client or another),
but here's some tests for its current behavior, at least. See the
commit/review thread of r218187 for more discussion.

llvm-svn: 218626

10 years agoIntroduce CGFunctionInfo::getNumRequiredArgs(). NFC.
Alexey Samsonov [Mon, 29 Sep 2014 21:21:48 +0000 (21:21 +0000)]
Introduce CGFunctionInfo::getNumRequiredArgs(). NFC.

Save the callers from necessity to special-case on variadic functions.

llvm-svn: 218625

10 years agoCUDA: Fix incorrect target inference for implicit members.
Eli Bendersky [Mon, 29 Sep 2014 20:38:29 +0000 (20:38 +0000)]
CUDA: Fix incorrect target inference for implicit members.

As PR20495 demonstrates, Clang currenlty infers the CUDA target (host/device,
etc) for implicit members (constructors, etc.) incorrectly. This causes errors
and even assertions in Clang when compiling code (assertions in C++11 mode where
implicit move constructors are added into the mix).

Fix the problem by inferring the target from the methods the implicit member
should call (depending on its base classes and fields).

llvm-svn: 218624

10 years agoSpeedup ClangToLLVMArgMapping construction. NFC.
Alexey Samsonov [Mon, 29 Sep 2014 20:30:22 +0000 (20:30 +0000)]
Speedup ClangToLLVMArgMapping construction. NFC.

Add a method to calculate the number of arguments given QualType
expnads to. Use this method in ClangToLLVMArgMapping calculation.
This number may be cached in CodeGenTypes for efficiency, if needed.

llvm-svn: 218623

10 years agoFixing the build for compilers which do not yet have support for constexpr functions...
Aaron Ballman [Mon, 29 Sep 2014 20:27:01 +0000 (20:27 +0000)]
Fixing the build for compilers which do not yet have support for constexpr functions, NFC.

llvm-svn: 218622

10 years agoObjective-C [qoi] - provide group name for
Fariborz Jahanian [Mon, 29 Sep 2014 20:17:04 +0000 (20:17 +0000)]
Objective-C [qoi] - provide group name for
warn_property_types_are_incompatible. rdar://18487506

llvm-svn: 218621

10 years ago[asan] add a test for array cookie if the operator new is defined inside the class...
Kostya Serebryany [Mon, 29 Sep 2014 19:40:56 +0000 (19:40 +0000)]
[asan] add a test for array cookie if the operator new is defined inside the class (the cookie should not be poisoned in such case); update the related comment in asan_poisoning.cc

llvm-svn: 218620

10 years agoAdd getValueOr to llvm::Optional<T>.
Jordan Rose [Mon, 29 Sep 2014 18:56:08 +0000 (18:56 +0000)]
Add getValueOr to llvm::Optional<T>.

This takes a single argument convertible to T, and
- if the Optional has a value, returns the existing value,
- otherwise, constructs a T from the argument and returns that.

Inspired by std::experimental::optional from the "Library Fundamentals" C++ TS.

llvm-svn: 218618

10 years agoAdd "typedef T value_type;" to llvm::Optional<T>.
Jordan Rose [Mon, 29 Sep 2014 18:56:05 +0000 (18:56 +0000)]
Add "typedef T value_type;" to llvm::Optional<T>.

Inspired by std::experimental::optional from the "Library Fundamentals" C++ TS.

llvm-svn: 218617

10 years agoRefactor Matcher<T> and DynTypedMatcher to reduce overhead of casts.
Samuel Benzaquen [Mon, 29 Sep 2014 18:43:20 +0000 (18:43 +0000)]
Refactor Matcher<T> and DynTypedMatcher to reduce overhead of casts.

Summary:
This change introduces DynMatcherInterface and changes the internal
representation of DynTypedMatcher and Matcher<T> to use a generic
interface instead.
It removes unnecessary indirections and virtual function calls when
converting matchers by implicit and dynamic casts.
DynTypedMatcher now remembers the stricter type in the chain of casts
and checks it before calling into DynMatcherInterface.
This change improves our clang-tidy related benchmark by ~14%.
Also, it opens the door for more optimizations of this kind that are
coming in future changes.

As a side effect of removing these template instantiations, it also
speeds up compilation of Dynamic/Registry.cpp by ~17% and reduces the number of
symbols generated by ~30%.

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

llvm-svn: 218616

10 years agoRefactor ABIArgInfo::Expand implementation (NFC).
Alexey Samsonov [Mon, 29 Sep 2014 18:41:28 +0000 (18:41 +0000)]
Refactor ABIArgInfo::Expand implementation (NFC).

Hoist the logic which determines the way QualType is expanded
into a separate method. Remove a bunch of copy-paste and simplify
getTypesFromArgs() / ExpandTypeFromArgs() / ExpandTypeToArgs() methods.

llvm-svn: 218615

10 years agoUpdate modules documentation now that C++ support is working pretty well.
Richard Smith [Mon, 29 Sep 2014 17:46:41 +0000 (17:46 +0000)]
Update modules documentation now that C++ support is working pretty well.

llvm-svn: 218614

10 years agoDisable runtime alias checks when we ignore aliasing.
Johannes Doerfert [Mon, 29 Sep 2014 17:06:29 +0000 (17:06 +0000)]
Disable runtime alias checks when we ignore aliasing.

  This is just a optimization to save the compile time and execution time
  for runtime alias checks if the user guarantees no aliasing all together.

llvm-svn: 218613

10 years agoFixing missing C++ mode comment
Matt Arsenault [Mon, 29 Sep 2014 15:55:18 +0000 (15:55 +0000)]
Fixing missing C++ mode comment

llvm-svn: 218612

10 years agoFix include order
Matt Arsenault [Mon, 29 Sep 2014 15:53:15 +0000 (15:53 +0000)]
Fix include order

llvm-svn: 218611

10 years agoR600/SI: Fix hardcoded values for modifiers.
Matt Arsenault [Mon, 29 Sep 2014 15:50:26 +0000 (15:50 +0000)]
R600/SI: Fix hardcoded values for modifiers.

Move enums to SIDefines.h

llvm-svn: 218610

10 years agoR600/SI: Also fix fsub + fadd a, a to mad combines
Matt Arsenault [Mon, 29 Sep 2014 14:59:38 +0000 (14:59 +0000)]
R600/SI: Also fix fsub + fadd a, a to mad combines

llvm-svn: 218609

10 years agoR600/SI: Fix using mad with multiplies by 2
Matt Arsenault [Mon, 29 Sep 2014 14:59:34 +0000 (14:59 +0000)]
R600/SI: Fix using mad with multiplies by 2

These turn into fadds, so combine them into the target
mad node.

fadd (fadd (a, a), b) -> mad 2.0, a, b

llvm-svn: 218608

10 years ago[AArch64] Improve cost model to handle sdiv by a pow-of-two.
Chad Rosier [Mon, 29 Sep 2014 13:59:31 +0000 (13:59 +0000)]
[AArch64] Improve cost model to handle sdiv by a pow-of-two.

This patch improves the target-specific cost model to better handle signed
division by a power of two. The immediate result is that this enables the SLP
vectorizer to do a better job.

http://reviews.llvm.org/D5469
PR20714

llvm-svn: 218607

10 years agoStore TypeUnits in a SmallVector<DWARFUnitSection> instead of a single DWARFUnitSection.
Frederic Riss [Mon, 29 Sep 2014 13:56:39 +0000 (13:56 +0000)]
Store TypeUnits in a SmallVector<DWARFUnitSection> instead of a single DWARFUnitSection.

There will be multiple TypeUnits in an unlinked object that will be extracted
from different sections. Now that we have DWARFUnitSection that is supposed
to represent an input section, we need a DWARFUnitSection<TypeUnit> per
input .debug_types section.

Once this is done, the interface is homogenous and we can move the Section
parsing code into DWARFUnitSection.

This is a respin of r218513 that got reverted because it broke some builders.
This new version features an explicit move constructor for the DWARFUnitSection
class to workaround compilers unable to generate correct C++11 default
constructors.

Reviewers: samsonov, dblaikie

Subscribers: llvm-commits

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

llvm-svn: 218606