platform/upstream/llvm.git
9 years agoReflect changes in LLVM getTypeInfo() API
Enrico Granata [Wed, 30 Jul 2014 21:02:00 +0000 (21:02 +0000)]
Reflect changes in LLVM getTypeInfo() API

llvm-svn: 214335

9 years ago[Sanitizer] Make SuppressionContext a singleton class, residing in sanitizer_common.
Alexey Samsonov [Wed, 30 Jul 2014 20:54:37 +0000 (20:54 +0000)]
[Sanitizer] Make SuppressionContext a singleton class, residing in sanitizer_common.

Convert TSan and LSan to the new interface. More changes will follow:
1) "suppressions" should become a common runtime flag.
2) Code for parsing suppressions file should be moved to SuppressionContext::Init().

llvm-svn: 214334

9 years agoAdd a state variable to the loop hint attribute.
Tyler Nowicki [Wed, 30 Jul 2014 20:54:33 +0000 (20:54 +0000)]
Add a state variable to the loop hint attribute.

This patch is necessary to support constant expressions which replaces the integer value in the loop hint attribute with an expression. The integer value was also storing the pragma’s state for options like vectorize(enable/disable) and the pragma unroll and nounroll directive. The state variable is introduced to hold the state of those options/pragmas. This moves the validation of the state (keywords) from SemaStmtAttr handler to the loop hint annotation token handler.

Reviewed by Aaron Ballman

llvm-svn: 214333

9 years agoAdd BookE's tlbre, tlbwe and tlbivax instructions.
Joerg Sonnenberger [Wed, 30 Jul 2014 20:44:04 +0000 (20:44 +0000)]
Add BookE's tlbre, tlbwe and tlbivax instructions.

llvm-svn: 214332

9 years agodocs: update the command guide documentation for llvm-profdata.
Alex Lorenz [Wed, 30 Jul 2014 20:30:11 +0000 (20:30 +0000)]
docs: update the command guide documentation for llvm-profdata.

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

llvm-svn: 214331

9 years agoFix test case introduced in r214322
Louis Gerbarg [Wed, 30 Jul 2014 20:26:09 +0000 (20:26 +0000)]
Fix test case introduced in r214322

This patch adds an explicit triple to the test case introduced by r214322. This
should fix build failueres that are occuring on bots that are cross building.

llvm-svn: 214330

9 years agoLangRef: add a note about the mangling-suppressing \01 prefix
Hans Wennborg [Wed, 30 Jul 2014 20:02:08 +0000 (20:02 +0000)]
LangRef: add a note about the mangling-suppressing \01 prefix

Someone asked about this on IRC the other day, and I couldn't
find the magic prefix documented anywhere.

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

llvm-svn: 214329

9 years agoRefactor duplicated code.
Rafael Espindola [Wed, 30 Jul 2014 19:42:16 +0000 (19:42 +0000)]
Refactor duplicated code.

llvm-svn: 214328

9 years agolldb is a scope, not a label
Ed Maste [Wed, 30 Jul 2014 19:33:25 +0000 (19:33 +0000)]
lldb is a scope, not a label

llvm-svn: 214327

9 years agoFix build: remove bogus ./ at end of line
Ed Maste [Wed, 30 Jul 2014 19:26:11 +0000 (19:26 +0000)]
Fix build: remove bogus ./ at end of line

llvm-svn: 214326

9 years agoFixing a few -Woverloaded-virtual warnings by exposing the hidden virtual function...
Aaron Ballman [Wed, 30 Jul 2014 19:23:59 +0000 (19:23 +0000)]
Fixing a few -Woverloaded-virtual warnings by exposing the hidden virtual function as well. No functional changes intended.

llvm-svn: 214325

9 years agoUse Process::ReadMemoryFromPointer() instead of manually reading the pointer.
Greg Clayton [Wed, 30 Jul 2014 18:34:58 +0000 (18:34 +0000)]
Use Process::ReadMemoryFromPointer() instead of manually reading the pointer.

llvm-svn: 214323

9 years agoRetain alignment requirements for load->selects modified by DAGCombine
Louis Gerbarg [Wed, 30 Jul 2014 18:24:41 +0000 (18:24 +0000)]
Retain alignment requirements for load->selects modified by DAGCombine

DAGCombine may choose to rewrite graphs where two loads feed a select into
graphs where a select of two addresses feed a load. While it sanity checks the
loads to make sure they are broadly equivalent it currently just uses the
alignment restriction of the left node. In cases where the right node has
stronger alignment requiresment this may lead to bad codegen, such as generating
an aligned load where an unaligned load is required. This patch makes the
combine generate a load with an alignment that is the same as whichever is more
restrictive of the two alignments.

Tests included.

rdar://17762530

llvm-svn: 214322

9 years agoUseListOrder: Visit global values
Duncan P. N. Exon Smith [Wed, 30 Jul 2014 17:51:09 +0000 (17:51 +0000)]
UseListOrder: Visit global values

When predicting use-list order, we visit functions in reverse order
followed by `GlobalValue`s and write out use-lists at the first
opportunity.  In the reader, this will translate to *after* the last use
has been added.

For this to work, we actually need to descend into `GlobalValue`s.
Added a targeted test in `use-list-order.ll` and `RUN` lines to the
newly passing tests in `test/Bitcode`.

There are two remaining failures in `test/Bitcode`:

  - blockaddress.ll: I haven't thought through how to model the way
    block addresses change the order of use-lists (or how to work around
    it).

  - metadata-2.ll: There's an old-style `@llvm.used` global array here
    that I suspect the .ll parser isn't upgrading properly.  When it
    round-trips through bitcode, the .bc reader *does* upgrade it, so
    the extra variable (`i8* null`) has an extra use, and the shuffle
    vector doesn't match.

    I think the fix is to upgrade old-style global arrays (or reject
    them?) in the .ll parser.

This is part of PR5680.

llvm-svn: 214321

9 years agoFix line endings before adding RUN lines, NFC
Duncan P. N. Exon Smith [Wed, 30 Jul 2014 17:49:00 +0000 (17:49 +0000)]
Fix line endings before adding RUN lines, NFC

llvm-svn: 214320

9 years ago(no commit message)
Greg Clayton [Wed, 30 Jul 2014 17:38:47 +0000 (17:38 +0000)]
(no commit message)

llvm-svn: 214319

9 years agoRename llvm-uselistorder => verify-uselistorder
Duncan P. N. Exon Smith [Wed, 30 Jul 2014 17:11:27 +0000 (17:11 +0000)]
Rename llvm-uselistorder => verify-uselistorder

llvm-svn: 214318

9 years agollvm-uselistorder: Improve the tool description
Duncan P. N. Exon Smith [Wed, 30 Jul 2014 16:59:19 +0000 (16:59 +0000)]
llvm-uselistorder: Improve the tool description

llvm-svn: 214317

9 years ago[AVX512] Add intrinsic for knot
Adam Nemet [Wed, 30 Jul 2014 16:51:27 +0000 (16:51 +0000)]
[AVX512] Add intrinsic for knot

Part of <rdar://problem/17688758>

llvm-svn: 214316

9 years ago[AVX512] Add some of the FP cast intrinsics
Adam Nemet [Wed, 30 Jul 2014 16:51:24 +0000 (16:51 +0000)]
[AVX512] Add some of the FP cast intrinsics

Part of <rdar://problem/17688758>

llvm-svn: 214315

9 years ago[AVX512] Add set1 intrinsics
Adam Nemet [Wed, 30 Jul 2014 16:51:22 +0000 (16:51 +0000)]
[AVX512] Add set1 intrinsics

(Dropped the byte and word variants from the patch.  Turns out these are not
part of AVX512F but only AVX512BW/VL.)

Part of <rdar://problem/17688758>

llvm-svn: 214314

9 years agollvm-uselistorder: Fix memory leak from r214125
Duncan P. N. Exon Smith [Wed, 30 Jul 2014 16:50:22 +0000 (16:50 +0000)]
llvm-uselistorder: Fix memory leak from r214125

Turns out `parseBitcodeFile()` does *not* take ownership of the buffer.
This was already clear in the header docs, but I obviously didn't read
them (having noticed that it gets stored in a `unique_ptr<>`).

llvm-svn: 214313

9 years agoAdd the missing hasLinkOnceODRLinkage predicate.
Rafael Espindola [Wed, 30 Jul 2014 15:57:51 +0000 (15:57 +0000)]
Add the missing hasLinkOnceODRLinkage predicate.

llvm-svn: 214312

9 years agoAdd a small test showing when a linkonce_odr symbol can be hidden.
Rafael Espindola [Wed, 30 Jul 2014 15:31:21 +0000 (15:31 +0000)]
Add a small test showing when a linkonce_odr symbol can be hidden.

llvm-svn: 214311

9 years agoAdd OpenCL/SPIR kernel_arg_base_type metadata node
Fraser Cormack [Wed, 30 Jul 2014 14:39:53 +0000 (14:39 +0000)]
Add OpenCL/SPIR kernel_arg_base_type metadata node

As defined in the SPIR 1.2 specification, this node behaves similarly to
kernel_arg_type but will print the underlying type name, e.g., without
typedefs.

Example:
  typedef unsigned int myunsignedint;
would report:
  'myunsignedint' in the kernel_arg_type node
  'uint' in the kernel_arg_base_type node

llvm-svn: 214308

9 years agoDon't warn on NewCallback argument comments, as they are arguments for the
Alexander Kornienko [Wed, 30 Jul 2014 14:31:36 +0000 (14:31 +0000)]
Don't warn on NewCallback argument comments, as they are arguments for the
function the callback points to.

Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits

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

llvm-svn: 214307

9 years ago[SKX] Enabling SKX target (Skylake server chip)
Robert Khasanov [Wed, 30 Jul 2014 13:53:40 +0000 (13:53 +0000)]
[SKX] Enabling SKX target (Skylake server chip)
a) add SKX support to Clang driver;
b) add tests for SKX target and AVX512BW, AVX512DQ, AVX512VL features into clang driver tests

Patch by Zinovy Nis <zinovy.y.nis@intel.com>

llvm-svn: 214306

9 years agoFix OpenCL/SPIR kernel_arg_type metadata node
Fraser Cormack [Wed, 30 Jul 2014 13:41:12 +0000 (13:41 +0000)]
Fix OpenCL/SPIR kernel_arg_type metadata node

This fixes a bug where kernel_arg_type was always changing 'unsigned ' to 'u'
for any parameter type, including non-canonical types.

Example:
  typedef unsigned int myunsignedint;
would report:
  "myunt"

llvm-svn: 214305

9 years ago[asan] XFAIL sized-delete test on Android.
Evgeniy Stepanov [Wed, 30 Jul 2014 12:39:30 +0000 (12:39 +0000)]
[asan] XFAIL sized-delete test on Android.

llvm-svn: 214303

9 years agoCorrect vector type definition in LangRef.
Manuel Jacob [Wed, 30 Jul 2014 12:30:06 +0000 (12:30 +0000)]
Correct vector type definition in LangRef.

According to VectorType::isValidElementType, any integer, floating point
or pointer type is a valid vector element type.

llvm-svn: 214302

9 years agoSuppress clang/test/Sema/struct-packed-align.c also on msvc for investigating.
NAKAMURA Takumi [Wed, 30 Jul 2014 12:17:38 +0000 (12:17 +0000)]
Suppress clang/test/Sema/struct-packed-align.c also on msvc for investigating.

FIXME: This test is incompatible to MS compat mode.
FIXME: Don't suppress this also on mingw. :-p
llvm-svn: 214301

9 years agoclang-format: Understand 'typename' in placement new.
Daniel Jasper [Wed, 30 Jul 2014 12:14:10 +0000 (12:14 +0000)]
clang-format: Understand 'typename' in placement new.

Before:
  new (aaaaaaaaaaaaaaaaaaaaaaaaaa(
      aaaaaaaaaaaaaaaaaaaaaaa)) typename aaaaaaaaaaaaaaaaaaaaaaaa();

After:
  new (aaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaa))
      typename aaaaaaaaaaaaaaaaaaaaaaaa();

llvm-svn: 214300

9 years ago[asan] rename new-delete-size-mismatch to new-delete-type-mismatch and make the repor...
Kostya Serebryany [Wed, 30 Jul 2014 11:20:37 +0000 (11:20 +0000)]
[asan] rename new-delete-size-mismatch to new-delete-type-mismatch and make the report more verbose

llvm-svn: 214299

9 years agoSuppress clang/test/Sema/struct-packed-align.c for targeting LLP64.
NAKAMURA Takumi [Wed, 30 Jul 2014 10:44:35 +0000 (10:44 +0000)]
Suppress clang/test/Sema/struct-packed-align.c for targeting LLP64.

llvm-svn: 214298

9 years agoAdd BookE's wrtee and wrteei instructions.
Joerg Sonnenberger [Wed, 30 Jul 2014 10:32:51 +0000 (10:32 +0000)]
Add BookE's wrtee and wrteei instructions.

llvm-svn: 214297

9 years ago[asan] add a feature to detect new-delete-size-mismatch (when used with -Xclang ...
Kostya Serebryany [Wed, 30 Jul 2014 09:48:23 +0000 (09:48 +0000)]
[asan] add a feature to detect new-delete-size-mismatch (when used with -Xclang -fsized-deallocation). Not yet on Mac. Also, remove some unused code.

llvm-svn: 214296

9 years agoSPRG 0 to 3 are valid outside BookE, so move them to the normal test
Joerg Sonnenberger [Wed, 30 Jul 2014 09:24:37 +0000 (09:24 +0000)]
SPRG 0 to 3 are valid outside BookE, so move them to the normal test
file. Add support for accessing SPRG 4 to 7 on BookE.

llvm-svn: 214295

9 years ago[Driver][Mips] Add function-wrapper so simplify creation of `Multilib` objects.
Simon Atanasyan [Wed, 30 Jul 2014 09:15:10 +0000 (09:15 +0000)]
[Driver][Mips] Add function-wrapper so simplify creation of `Multilib` objects.

No functional changes.

llvm-svn: 214294

9 years agoAST: Simplify some code
David Majnemer [Wed, 30 Jul 2014 08:42:33 +0000 (08:42 +0000)]
AST: Simplify some code

Iterator invalidation issues already force us to do one lookup and one
insert.
Don't use the particular bit-pattern of the 'Align' field to determine
whether or not we have already inserted into the TypeInfo DenseMap;
instead ask for an iterator to the TypeInfo entry.

llvm-svn: 214293

9 years agoFix some cases of incorrect handling of lifetime extended temporaries.
Manuel Klimek [Wed, 30 Jul 2014 08:34:42 +0000 (08:34 +0000)]
Fix some cases of incorrect handling of lifetime extended temporaries.

MaterializeTemporaryExpr already contains information about the lifetime
of the temporary; if the lifetime is not the full statement, we do not
want to emit a destructor at the end of the full statement for it.

llvm-svn: 214292

9 years agoUse __linux__ macro throughout, instead of ocasional __linux.
Sylvestre Ledru [Wed, 30 Jul 2014 08:33:21 +0000 (08:33 +0000)]
Use __linux__ macro throughout, instead of ocasional __linux.

__linux is not universally defined across all standards versions, compilers and architectures. Specifically at C99 and up, it's not defined in GCC on powerpc platform.

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28314

Bugzilla: http://llvm.org/bugs/show_bug.cgi?id=20380

Patch by Dimitri John Ledkov <dimitri.ledkov@canonical.com>

llvm-svn: 214291

9 years agoMS ABI: Mangle alias templates used as template-template arguments
David Majnemer [Wed, 30 Jul 2014 08:20:03 +0000 (08:20 +0000)]
MS ABI: Mangle alias templates used as template-template arguments

A templated using declaration may be used as a template-template
argument.

Unfortunately, the VS "14" chooses '?' as the sole marker for the
argument.  This is problematic because it presupposes the possibility of
using more than one template-aliases as arguments to the same template.

This fixes PR20047.

llvm-svn: 214290

9 years ago[msan] Use SIGHUP instead of SIGUSR1 in test.
Evgeniy Stepanov [Wed, 30 Jul 2014 08:17:58 +0000 (08:17 +0000)]
[msan] Use SIGHUP instead of SIGUSR1 in test.

Apparently, SIGUSR1 does not work on x86_64+ArchLinux for some reason.

For more details, see:
https://groups.google.com/forum/#!topic/llvm-dev/4Ag1FF4M2Dw

llvm-svn: 214289

9 years agoDon't manually (and forcibly) run the verifier on the entire module from
Chandler Carruth [Wed, 30 Jul 2014 05:44:04 +0000 (05:44 +0000)]
Don't manually (and forcibly) run the verifier on the entire module from
the jump instruction table pass. First, the verifier is already built
into all the tools. The test case is adapted to just run llvm-as
demonstrating that we still catch the broken module. Second, the
verifier is *extremely* slow. This was responsible for very significant
compile time regressions.

If you have deployed a Clang binary anywhere from r210280 to this
commit, you really want to re-deploy.

llvm-svn: 214287

9 years agoSimplify the code.
Rafael Espindola [Wed, 30 Jul 2014 04:40:23 +0000 (04:40 +0000)]
Simplify the code.

Thanks to David Balkie for the suggestion.

llvm-svn: 214286

9 years ago[MCJIT] Fix the ARM BR24 relocation in RuntimeDyldMachO.
Lang Hames [Wed, 30 Jul 2014 03:35:05 +0000 (03:35 +0000)]
[MCJIT] Fix the ARM BR24 relocation in RuntimeDyldMachO.

We now (1) correctly decode the branch immediate, (2) modify the immediate to
corretly treat it as PC-rel, and (3) properly populate the stub entry.
Previously we had been doing each of these wrong.

<rdar://problem/17750739>

llvm-svn: 214285

9 years ago[PowerPC] Add JMP_SLOT relocation definitions
Hal Finkel [Wed, 30 Jul 2014 03:20:45 +0000 (03:20 +0000)]
[PowerPC] Add JMP_SLOT relocation definitions

This will be required by upcoming patches for LLDB support.

Patch by Justin Hibbits!

llvm-svn: 214284

9 years agoR600/SI: Remove redundant setting of bits on instructions.
Matt Arsenault [Wed, 30 Jul 2014 03:18:57 +0000 (03:18 +0000)]
R600/SI: Remove redundant setting of bits on instructions.

neverHasSideEffects is deprecated, and hasSideEffects = 0 is already
set on the base classes of the basic ALU instruction classes. The
base classes also already set mayLoad = 0 and mayStore = 0

llvm-svn: 214283

9 years ago[MCJIT] Actually remap sections based llvm-rtdyld options added in r214255.
Lang Hames [Wed, 30 Jul 2014 03:12:41 +0000 (03:12 +0000)]
[MCJIT] Actually remap sections based llvm-rtdyld options added in r214255.

This line was accidentally left out of that patch.

llvm-svn: 214282

9 years agoFix a use after free bug.
Rafael Espindola [Wed, 30 Jul 2014 02:37:26 +0000 (02:37 +0000)]
Fix a use after free bug.

llvm-svn: 214281

9 years agoUse range loops.
Rafael Espindola [Wed, 30 Jul 2014 01:52:40 +0000 (01:52 +0000)]
Use range loops.

llvm-svn: 214280

9 years ago[UBSan] Introduce ScopedReport object.
Alexey Samsonov [Wed, 30 Jul 2014 01:49:19 +0000 (01:49 +0000)]
[UBSan] Introduce ScopedReport object.

This object is used to encapsulate all actions that need to be
done before/after printing UBSan diagnostics. Currently these
actions are:
* locking a mutex to ensure that UBSan diagnostics from several
threads won't mix with each other and with other sanitizers'
reports
* killing a program once the report is printed (if necessary).

Use this object in all UBSan handlers. Unify the way we implement
fatal and non-fatal handlers by making all the handlers simple
one-liners that redirect __ubsan_handle_foo(_abort)? to
handleFooImpl().

llvm-svn: 214279

9 years ago[mach-o] Fix test case comment and stray file copy
Nick Kledzik [Wed, 30 Jul 2014 01:43:21 +0000 (01:43 +0000)]
[mach-o] Fix test case comment and stray file copy

llvm-svn: 214278

9 years ago[mach-o] Fix arm interworking with movw/movt
Nick Kledzik [Wed, 30 Jul 2014 01:41:38 +0000 (01:41 +0000)]
[mach-o] Fix arm interworking with movw/movt

In some cases the address of a function will be materialized with a movw/movt
pair.  If the function is a thumb function, the low bit needs to be set on
the movw immediate value.

llvm-svn: 214277

9 years agoConvert a few more function pointer calls to just "f()".
Rafael Espindola [Wed, 30 Jul 2014 01:36:32 +0000 (01:36 +0000)]
Convert a few more function pointer calls to just "f()".

llvm-svn: 214276

9 years ago[AVX512] Test that _mm512_set1_* intrinsics generate broadcasts
Adam Nemet [Wed, 30 Jul 2014 01:30:51 +0000 (01:30 +0000)]
[AVX512] Test that _mm512_set1_* intrinsics generate broadcasts

llvm-svn: 214275

9 years agoMS ABI: Consider alignment attributes on typedefs for layout
David Majnemer [Wed, 30 Jul 2014 01:30:47 +0000 (01:30 +0000)]
MS ABI: Consider alignment attributes on typedefs for layout

The MS ABI has a notion of 'required alignment' for fields; this
alignment supercedes pragma pack directives.

MSVC takes into account alignment attributes on typedefs when
determining whether or not a field has a certain required alignment.

Do the same in clang by tracking whether or not we saw such an attribute
when calculating the type's bitwidth and alignment.

This fixes PR20418.

Reviewers: rnk

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

llvm-svn: 214274

9 years ago[AVX512] Add missing CHECK-LABEL
Adam Nemet [Wed, 30 Jul 2014 01:30:45 +0000 (01:30 +0000)]
[AVX512] Add missing CHECK-LABEL

llvm-svn: 214273

9 years agoDon't duplicate the function name in a comment.
Rafael Espindola [Wed, 30 Jul 2014 01:23:45 +0000 (01:23 +0000)]
Don't duplicate the function name in a comment.

llvm-svn: 214272

9 years agoReapply "UseListOrder: Order GlobalValue uses after initializers"
Duncan P. N. Exon Smith [Wed, 30 Jul 2014 01:22:16 +0000 (01:22 +0000)]
Reapply "UseListOrder: Order GlobalValue uses after initializers"

This reverts commit r214249, reapplying r214242 and r214243, now that
r214270 has fixed the UB.

llvm-svn: 214271

9 years agoUseListOrder: Fix undefined behaviour
Duncan P. N. Exon Smith [Wed, 30 Jul 2014 01:20:26 +0000 (01:20 +0000)]
UseListOrder: Fix undefined behaviour

This commit fixes undefined behaviour that caused the revert in r214249.

The problem was two unsequenced operations on a `DenseMap<>`, giving
different behaviour in GCC and Clang.  This:

    DenseMap<T*, unsigned> DM;
    for (auto &X : ...)
      DM[&X] = DM.size() + 1;

should have been:

    DenseMap<T*, unsigned> DM;
    for (auto &X : ...) {
      unsigned Size = DM.size();
      DM[&X] = Size + 1;
    }

Until r214242, this difference between compilers didn't matter.  In
r214242, `OrderMap::LastGlobalValueID` was introduced and compared
against IDs, which in GCC were off-by-one my expectations.

llvm-svn: 214270

9 years agoR600/SI: Consider adjacent offsets in getLdStBaseRegImmOfs
Matt Arsenault [Wed, 30 Jul 2014 01:01:10 +0000 (01:01 +0000)]
R600/SI: Consider adjacent offsets in getLdStBaseRegImmOfs

We can treat ds_read2_* as a single offset if the offsets are adjacent.

No test since emission of read2 instructions for partially
aligned loads isn't implemented yet.

llvm-svn: 214269

9 years ago[mach-o] Add support for -sectalign option
Nick Kledzik [Wed, 30 Jul 2014 00:58:06 +0000 (00:58 +0000)]
[mach-o] Add support for -sectalign option

The -sectalign option is used to increase the alignment required for a section.
It required some reworking of how the __TEXT segment is laid out because that
segment also contains the mach_header and load commands. And the size of load
commands depend on the number of segments, sections, and dependent dylibs used.

Using this option will simplify some future test cases because the final
address of code can be pinned down, making tests of its content easier.

llvm-svn: 214268

9 years agoNot all instantiated variable is odr-used. Do not mark non-odr-used variable template...
Larisse Voufo [Wed, 30 Jul 2014 00:49:55 +0000 (00:49 +0000)]
Not all instantiated variable is odr-used. Do not mark non-odr-used variable template specializations as such.

llvm-svn: 214267

9 years agoAdd support for scalarizing ctlz_zero_undef
Petar Jovanovic [Wed, 30 Jul 2014 00:44:03 +0000 (00:44 +0000)]
Add support for scalarizing ctlz_zero_undef

Fix the missing case in ScalarizeVectorResult() that was exposed with
libclcore.bc in Android.

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

llvm-svn: 214266

9 years agoUse function pointers with just f(1,2) instead of (*f)(1,2).
Rafael Espindola [Wed, 30 Jul 2014 00:38:58 +0000 (00:38 +0000)]
Use function pointers with just f(1,2) instead of (*f)(1,2).

llvm-svn: 214265

9 years agoRevert "UseListOrder: Remove move assignment"
Duncan P. N. Exon Smith [Wed, 30 Jul 2014 00:25:33 +0000 (00:25 +0000)]
Revert "UseListOrder: Remove move assignment"

This reverts commit r214260.  Turns out move assignment *is* necessary
for MSVC [1].

[1]: http://bb.pgr.jp/builders/ninja-clang-i686-msc17-R/builds/9631

llvm-svn: 214264

9 years agoHeader hygiene: remove using directive and #undef DEBUG_TYPE once we're done.
Richard Smith [Wed, 30 Jul 2014 00:25:24 +0000 (00:25 +0000)]
Header hygiene: remove using directive and #undef DEBUG_TYPE once we're done.

llvm-svn: 214263

9 years agoUseListOrder: Remove move assignment
Duncan P. N. Exon Smith [Wed, 30 Jul 2014 00:05:02 +0000 (00:05 +0000)]
UseListOrder: Remove move assignment

Remove the move assignment added in r214213, since it wasn't necessary
to fix the bots (r214224 was the magic touch).

llvm-svn: 214260

9 years ago[UBSan] Allow to override runtime flags defaults by providing
Alexey Samsonov [Wed, 30 Jul 2014 00:01:41 +0000 (00:01 +0000)]
[UBSan] Allow to override runtime flags defaults by providing
compile definition UBSAN_DEFAULT_OPTIONS when building the runtime.
This mirrors similar ASan functionality.

llvm-svn: 214259

9 years ago[UBSan] Move all runtime flags parsing to ubsan_flags.cc.
Alexey Samsonov [Tue, 29 Jul 2014 23:49:20 +0000 (23:49 +0000)]
[UBSan] Move all runtime flags parsing to ubsan_flags.cc.

No functionality change.

llvm-svn: 214258

9 years agoAdd rfci instruction.
Joerg Sonnenberger [Tue, 29 Jul 2014 23:45:20 +0000 (23:45 +0000)]
Add rfci instruction.

llvm-svn: 214256

9 years ago[MCJIT] Add options to llvm-rtdyld to describe a phony target address space for
Lang Hames [Tue, 29 Jul 2014 23:43:13 +0000 (23:43 +0000)]
[MCJIT] Add options to llvm-rtdyld to describe a phony target address space for
use in -verify mode.

This patch adds three hidden command line options to llvm-rtdyld:

 -target-addr-start <start-addr> : Specify the start of the virtual address
                                   space on the phony target.

 -target-addr-end   <end-addr>   : Specify the end of the virtual address space
                                   on the phony target.

 -target-section-sep <sep>       : Specify the separation (in bytes) between the
                                   end of one section and the start of the next.

These options automatically default to sane values for the target platform. In
particular, they allow narrow (e.g. 32-bit, 16-bit) targets to be tested from
wider (e.g. 64-bit, 32-bit) hosts without overflowing pointers.

The section separation option defaults to zero, but can be set to a large number
(e.g. 1 << 32) to force large separations between sections in order to
stress-test large-code-model code.

llvm-svn: 214255

9 years agombar without argument is equivalent to mbar 0.
Joerg Sonnenberger [Tue, 29 Jul 2014 23:31:27 +0000 (23:31 +0000)]
mbar without argument is equivalent to mbar 0.

llvm-svn: 214250

9 years agoRevert "UseListOrder: Order GlobalValue uses after initializers"
Duncan P. N. Exon Smith [Tue, 29 Jul 2014 23:31:11 +0000 (23:31 +0000)]
Revert "UseListOrder: Order GlobalValue uses after initializers"

This reverts commits r214242 and r214243 while I investigate buildbot
failures [1][2][3].  I can't reproduce these failures locally, so if
anyone can see what I've done wrong, I'd appreciate a note.

[1]: http://lab.llvm.org:8011/builders/llvm-hexagon-elf/builds/9840
[2]: http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/14981
[3]: http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/15191

llvm-svn: 214249

9 years agoSilence a warning saying "typedef requires a name" from clang.
Greg Clayton [Tue, 29 Jul 2014 23:23:58 +0000 (23:23 +0000)]
Silence a warning saying "typedef requires a name" from clang.

llvm-svn: 214247

9 years ago[modules] Factor out ODR checking, to avoid unnecessary repeated work in
Richard Smith [Tue, 29 Jul 2014 23:23:27 +0000 (23:23 +0000)]
[modules] Factor out ODR checking, to avoid unnecessary repeated work in
finishPendingActions loop.

llvm-svn: 214246

9 years ago[UBSan] Get pc/bp for stack unwinding as early as possible.
Alexey Samsonov [Tue, 29 Jul 2014 23:22:41 +0000 (23:22 +0000)]
[UBSan] Get pc/bp for stack unwinding as early as possible.

This will ensure that stack frames in error reports will not
contain internal UBSan failures, and frame #0 will be the
actual place in the program where the error happens.

llvm-svn: 214245

9 years agoRecognize BookE's mbar instruction.
Joerg Sonnenberger [Tue, 29 Jul 2014 23:16:31 +0000 (23:16 +0000)]
Recognize BookE's mbar instruction.

llvm-svn: 214244

9 years agoUseListOrder: Additional test coverage for r214242
Duncan P. N. Exon Smith [Tue, 29 Jul 2014 23:15:49 +0000 (23:15 +0000)]
UseListOrder: Additional test coverage for r214242

r214242 was subtle enough it really deserves a targeted test with
comments.  This adds some global variables that trigger the relevant
code path.  Sorry this wasn't committed with the fix.

llvm-svn: 214243

9 years agoUseListOrder: Order GlobalValue uses after initializers
Duncan P. N. Exon Smith [Tue, 29 Jul 2014 23:06:14 +0000 (23:06 +0000)]
UseListOrder: Order GlobalValue uses after initializers

To avoid unnecessary forward references, the reader doesn't process
initializers of `GlobalValue`s until after the constant pool has been
processed, and then in reverse order.  Model this when predicting
use-list order.  This gets two more Bitcode tests passing with
`llvm-uselistorder`.

Part of PR5680.

llvm-svn: 214242

9 years agoUseListOrder: Create a struct around OrderMap, NFC
Duncan P. N. Exon Smith [Tue, 29 Jul 2014 23:03:40 +0000 (23:03 +0000)]
UseListOrder: Create a struct around OrderMap, NFC

llvm-svn: 214241

9 years agoFeedback on r214189, no functionality change.
Manman Ren [Tue, 29 Jul 2014 22:58:13 +0000 (22:58 +0000)]
Feedback on r214189, no functionality change.

llvm-svn: 214240

9 years agoAdd missing test for r214210.
Eli Bendersky [Tue, 29 Jul 2014 22:57:59 +0000 (22:57 +0000)]
Add missing test for r214210.

Thanks dblaikie for reminding me.

llvm-svn: 214239

9 years agoFix typo in alias: DSIR -> DSISR
Joerg Sonnenberger [Tue, 29 Jul 2014 22:42:44 +0000 (22:42 +0000)]
Fix typo in alias: DSIR -> DSISR

llvm-svn: 214238

9 years agoclang-format vs plugin: include the license
Hans Wennborg [Tue, 29 Jul 2014 22:34:53 +0000 (22:34 +0000)]
clang-format vs plugin: include the license

The vsix installer will show the license when it starts, and it
would print an annoying message when there was none.

While we're here, add a MoreInfoUrl.

llvm-svn: 214237

9 years agoAdd $vAttach support to llgs.
Todd Fiala [Tue, 29 Jul 2014 22:30:01 +0000 (22:30 +0000)]
Add $vAttach support to llgs.

Also adds a new test case for vAttach;{pid} for llgs and debugserver.

llvm-svn: 214236

9 years agollvm-profdata: Clean up and reorganize some tests
Justin Bogner [Tue, 29 Jul 2014 22:29:23 +0000 (22:29 +0000)]
llvm-profdata: Clean up and reorganize some tests

This moves some tests around to make it clearer what's being tested,
and adds very rudimentary comment syntax to the text input format to
make specifying this kind of test a little bit simpler.

llvm-svn: 214235

9 years agoSupport move to/from segment register.
Joerg Sonnenberger [Tue, 29 Jul 2014 22:21:57 +0000 (22:21 +0000)]
Support move to/from segment register.

llvm-svn: 214234

9 years agoAttempt to fix the expression parser after r214119
Reid Kleckner [Tue, 29 Jul 2014 21:59:33 +0000 (21:59 +0000)]
Attempt to fix the expression parser after r214119

__INT?_TYPE__ is now explicitly, so adding an explicit 'signed'
specifier causes errors.

llvm-svn: 214233

9 years ago[UBSan] Build part of UBSan runtime that can be linked into C programs with -fno...
Alexey Samsonov [Tue, 29 Jul 2014 21:52:25 +0000 (21:52 +0000)]
[UBSan] Build part of UBSan runtime that can be linked into C programs with -fno-rtti flag.

llvm-svn: 214232

9 years ago[MCJIT] XFAIL some RuntimeDyld tests on MIPS - RuntimeDyldChecker isn't properly
Lang Hames [Tue, 29 Jul 2014 21:48:22 +0000 (21:48 +0000)]
[MCJIT] XFAIL some RuntimeDyld tests on MIPS - RuntimeDyldChecker isn't properly
endian-aware yet, and this is causing failures when cross-linking on MIPS.

llvm-svn: 214231

9 years agoRemove unused variable that was causing a warning.
Greg Clayton [Tue, 29 Jul 2014 21:47:02 +0000 (21:47 +0000)]
Remove unused variable that was causing a warning.

llvm-svn: 214230

9 years agoUse nullptr instead of NULL.
Rafael Espindola [Tue, 29 Jul 2014 21:46:05 +0000 (21:46 +0000)]
Use nullptr instead of NULL.

llvm-svn: 214229

9 years agoCoverage: improve efficiency of the counter propagation to the expansion regions.
Alex Lorenz [Tue, 29 Jul 2014 21:42:24 +0000 (21:42 +0000)]
Coverage: improve efficiency of the counter propagation to the expansion regions.

This patch reduces the complexity of the two inner loops in order to speed up
the loading of coverage data for very large functions.

llvm-svn: 214228

9 years ago[MCJIT] Make sure we print the full 64-bit result of exprs in RuntimeDyldChecker.
Lang Hames [Tue, 29 Jul 2014 21:38:20 +0000 (21:38 +0000)]
[MCJIT] Make sure we print the full 64-bit result of exprs in RuntimeDyldChecker.

llvm-svn: 214227

9 years agoRemove unused includes.
Rafael Espindola [Tue, 29 Jul 2014 21:38:05 +0000 (21:38 +0000)]
Remove unused includes.

llvm-svn: 214226

9 years agoR600/SI: Implement getLdStBaseRegImmOfs
Matt Arsenault [Tue, 29 Jul 2014 21:34:55 +0000 (21:34 +0000)]
R600/SI: Implement getLdStBaseRegImmOfs

llvm-svn: 214225

9 years agoUseListOrder: Try to resolve buildbot failure
Duncan P. N. Exon Smith [Tue, 29 Jul 2014 21:30:21 +0000 (21:30 +0000)]
UseListOrder: Try to resolve buildbot failure

MSVC [1] thinks `UseListShuffleVector` needs a copy constructor, but I
don't.  Let's see if being explicit about `UseListOrder` is convincing.

[1]: http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/11664/steps/build_Lld/logs/stdio

Here's the failure:

C:/lld-x86_64_win7/lld-x86_64-win7/llvm.src/include\llvm/IR/UseListOrder.h(92): error C2248: 'llvm::UseListShuffleVector::operator =' : cannot access private member declared in class 'llvm::UseListShuffleVector' (C:\lld-x86_64_win7\lld-x86_64-win7\llvm.src\lib\Bitcode\Writer\ValueEnumerator.cpp) [C:\lld-x86_64_win7\lld-x86_64-win7\llvm.obj\lib\Bitcode\Writer\LLVMBitWriter.vcxproj]
          C:/lld-x86_64_win7/lld-x86_64-win7/llvm.src/include\llvm/IR/UseListOrder.h(56) : see declaration of 'llvm::UseListShuffleVector::operator ='
          C:/lld-x86_64_win7/lld-x86_64-win7/llvm.src/include\llvm/IR/UseListOrder.h(32) : see declaration of 'llvm::UseListShuffleVector'
          This diagnostic occurred in the compiler generated function 'llvm::UseListOrder &llvm::UseListOrder::operator =(const llvm::UseListOrder &)'

llvm-svn: 214224

9 years agoResolve the executable _before_ we try to get the module specifications.
Greg Clayton [Tue, 29 Jul 2014 21:27:21 +0000 (21:27 +0000)]
Resolve the executable _before_ we try to get the module specifications.

Also fixed the host 32 and 64 bit arch to return "x86_64-apple-macosx" again instead of "x86_64-apple-" (unspecified OS) after recent changes.

<rdar://problem/17845078>

llvm-svn: 214223