platform/upstream/llvm.git
10 years agoMS ABI: Mangle u8 string literals
David Majnemer [Fri, 21 Nov 2014 23:56:50 +0000 (23:56 +0000)]
MS ABI: Mangle u8 string literals

UTF8 string literals are mangled just like ASCII string literals.

llvm-svn: 222591

10 years ago[InstCombine] Re-commit of r218721 (Optimize icmp-select-icmp sequence)
Gerolf Hoflehner [Fri, 21 Nov 2014 23:36:44 +0000 (23:36 +0000)]
[InstCombine] Re-commit of  r218721 (Optimize icmp-select-icmp sequence)

Fixes the self-host fail. Note that this commit activates dominator
analysis in the combiner by default (like the original commit did).

llvm-svn: 222590

10 years agoRemove print statement that was accidentally left in.
Greg Clayton [Fri, 21 Nov 2014 23:34:35 +0000 (23:34 +0000)]
Remove print statement that was accidentally left in.

llvm-svn: 222589

10 years agoDon't make check-sanitizer depend on profile on Windows
Reid Kleckner [Fri, 21 Nov 2014 23:09:51 +0000 (23:09 +0000)]
Don't make check-sanitizer depend on profile on Windows

We don't build the profiling library on Windows, so CMake warns that the
target doesn't exist.

llvm-svn: 222588

10 years agoFix transformation of add with pc argument to adr for non-immediate
Joerg Sonnenberger [Fri, 21 Nov 2014 22:39:34 +0000 (22:39 +0000)]
Fix transformation of add with pc argument to adr for non-immediate
arguments.

llvm-svn: 222587

10 years ago[asan] remove old experimental code
Kostya Serebryany [Fri, 21 Nov 2014 22:34:29 +0000 (22:34 +0000)]
[asan] remove old experimental code

llvm-svn: 222586

10 years agoR600/SI: Add a failing test case for offset order in ds_read2 instructions
Tom Stellard [Fri, 21 Nov 2014 22:31:47 +0000 (22:31 +0000)]
R600/SI: Add a failing test case for offset order in ds_read2 instructions

llvm-svn: 222585

10 years agoR600/SI: Add an s_mov_b32 to patterns which use the M0RegClass
Tom Stellard [Fri, 21 Nov 2014 22:31:46 +0000 (22:31 +0000)]
R600/SI: Add an s_mov_b32 to patterns which use the M0RegClass

We need to use a s_mov_b32 rather than a copy, so that CSE will
eliminate redundant moves to the m0 register.

llvm-svn: 222584

10 years agoR600/SI: Emit s_mov_b32 m0, -1 before every DS instruction
Tom Stellard [Fri, 21 Nov 2014 22:31:44 +0000 (22:31 +0000)]
R600/SI: Emit s_mov_b32 m0, -1 before every DS instruction

This s_mov_b32 will write to a virtual register from the M0Reg
class and all the ds instructions now take an extra M0Reg explicit
argument.

This change is necessary to prevent issues with the scheduler
mixing together instructions that expect different values in the m0
registers.

llvm-svn: 222583

10 years agoPer off-list feedback, this API returns the *first* value with a given name, not...
Enrico Granata [Fri, 21 Nov 2014 22:23:08 +0000 (22:23 +0000)]
Per off-list feedback, this API returns the *first* value with a given name, not the *only* one. Rename it to reflect that

llvm-svn: 222582

10 years agoR600/SI: Add SIFoldOperands pass
Tom Stellard [Fri, 21 Nov 2014 22:06:37 +0000 (22:06 +0000)]
R600/SI: Add SIFoldOperands pass

This pass attempts to fold the source operands of mov and copy
instructions into their uses.

llvm-svn: 222581

10 years ago[mips][microMIPS] This patch implements functionality in MIPS delay slot
Jozef Kolek [Fri, 21 Nov 2014 22:04:35 +0000 (22:04 +0000)]
[mips][microMIPS] This patch implements functionality in MIPS delay slot
filler such as if delay slot filler have to put NOP instruction into the
delay slot of microMIPS BEQ or BNE instruction which uses the register $0,
then instead of emitting NOP this instruction is replaced by the corresponding
microMIPS compact branch instruction, i.e. BEQZC or BNEZC.

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

llvm-svn: 222580

10 years agoR600/SI: Mark s_mov_b32 and s_mov_b64 as rematerializable
Tom Stellard [Fri, 21 Nov 2014 22:00:16 +0000 (22:00 +0000)]
R600/SI: Mark s_mov_b32 and s_mov_b64 as rematerializable

llvm-svn: 222579

10 years agoR600/SI: Use hex notation for constant in test
Tom Stellard [Fri, 21 Nov 2014 22:00:13 +0000 (22:00 +0000)]
R600/SI: Use hex notation for constant in test

llvm-svn: 222578

10 years ago[Hexagon] Adding sxth instruction.
Colin LeMahieu [Fri, 21 Nov 2014 21:54:59 +0000 (21:54 +0000)]
[Hexagon] Adding sxth instruction.

llvm-svn: 222577

10 years agoAdd an API on SBValueList to find the first value with a given name stored in the...
Enrico Granata [Fri, 21 Nov 2014 21:45:03 +0000 (21:45 +0000)]
Add an API on SBValueList to find the first value with a given name stored in the list

llvm-svn: 222576

10 years ago[Hexagon] Adding sxtb instruction. Renaming some identically named classes that...
Colin LeMahieu [Fri, 21 Nov 2014 21:35:52 +0000 (21:35 +0000)]
[Hexagon] Adding sxtb instruction.  Renaming some identically named classes that will be removed after converting referencing defs.

llvm-svn: 222575

10 years ago[Mips] Use endian::read() for relocation addendum reading
Simon Atanasyan [Fri, 21 Nov 2014 21:26:32 +0000 (21:26 +0000)]
[Mips] Use endian::read() for relocation addendum reading

llvm-svn: 222574

10 years ago[asan] add statistic counter to dynamic alloca instrumentation
Kostya Serebryany [Fri, 21 Nov 2014 21:25:18 +0000 (21:25 +0000)]
[asan] add statistic counter to dynamic alloca instrumentation

llvm-svn: 222573

10 years ago[ASan] Get fake stack code working with GCC 4.8.2.
Jay Foad [Fri, 21 Nov 2014 21:25:09 +0000 (21:25 +0000)]
[ASan] Get fake stack code working with GCC 4.8.2.

Summary:
TestCases/Linux/heavy_uar_test.cc was failing on my
PowerPC64 box with GCC 4.8.2, because the compiler recognised
a memset-like loop and turned it into a call to memset, which
got intercepted by __asan_memset, which got upset because it was
being called on an address in high shadow memory.

Use break_optimization to stop the compiler from doing this.

Reviewers: kcc, samsonov

Reviewed By: kcc

Subscribers: llvm-commits

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

llvm-svn: 222572

10 years ago[Hexagon] Removing SUB_rr and replacing with A2_sub.
Colin LeMahieu [Fri, 21 Nov 2014 21:19:18 +0000 (21:19 +0000)]
[Hexagon] Removing SUB_rr and replacing with A2_sub.

llvm-svn: 222571

10 years agoObjective-C ARC. Fixes a crash when checking for 'weak' propery
Fariborz Jahanian [Fri, 21 Nov 2014 21:12:11 +0000 (21:12 +0000)]
Objective-C ARC. Fixes a crash when checking for 'weak' propery
whose base is not an expression. rdar://19053620

llvm-svn: 222570

10 years agoSema: Don't permit variably modified types in typeid
David Majnemer [Fri, 21 Nov 2014 21:09:12 +0000 (21:09 +0000)]
Sema: Don't permit variably modified types in typeid

GCC and ICC both reject this and the 'Runtime-sized arrays with
automatic storage duration' (N3639) paper forbade this as well.
Previously, we would crash on our way to mangling.

This fixes PR21632.

llvm-svn: 222569

10 years agoImplement -Wcast-qual, fixing #13772.
Roman Divacky [Fri, 21 Nov 2014 21:03:10 +0000 (21:03 +0000)]
Implement -Wcast-qual, fixing #13772.

Many thanks to dblaikie for his advices and suggestions!

llvm-svn: 222568

10 years agoRemove duplication of relocation names in lib/Object/ELFYAML.cpp
Tim Northover [Fri, 21 Nov 2014 20:16:09 +0000 (20:16 +0000)]
Remove duplication of relocation names in lib/Object/ELFYAML.cpp

We can now use the ELF relocation .def files to create the mapping
of relocation numbers to names and avoid having to duplicate the
list of relocations.

Patch by Will Newton.

llvm-svn: 222567

10 years agoRemove duplication of relocation names in lib/Object/ELF.cpp
Tim Northover [Fri, 21 Nov 2014 20:16:07 +0000 (20:16 +0000)]
Remove duplication of relocation names in lib/Object/ELF.cpp

We can now use the ELF relocation .def files to create the mapping
of relocation numbers to names and avoid having to duplicate the
list of relocations.

Patch by Will Newton.

llvm-svn: 222566

10 years agoSplit ELF relocation defintions into per-architecture .def files
Tim Northover [Fri, 21 Nov 2014 20:16:02 +0000 (20:16 +0000)]
Split ELF relocation defintions into per-architecture .def files

This should allow the list of relocations for a particular
architecture to be kept in a single header rather than duplicated
whenever we need to enumerate all the relocations.

Patch by Will Newton.

llvm-svn: 222565

10 years agoMS ABI: Mangle char16_t and char32_t string literals
David Majnemer [Fri, 21 Nov 2014 19:57:25 +0000 (19:57 +0000)]
MS ABI: Mangle char16_t and char32_t string literals

We previously had support for char and wchar_t string literals.  VS 2015
added support for char16_t and char32_t.

String literals must be mangled in the MS ABI in order for them to be
deduplicated across translation units: their linker has no notion of
mergeable section.  Instead, they use the mangled name to make a COMDAT
for the string literal; the COMDAT will merge with other COMDATs in
other object files.

This allows strings in object files generated by clang to get merged
with strings in object files generated by MSVC.

llvm-svn: 222564

10 years agoDebug Info: revert r222195, r222210 and r222239.
Manman Ren [Fri, 21 Nov 2014 19:55:23 +0000 (19:55 +0000)]
Debug Info: revert r222195, r222210 and r222239.

This is no longer needed after David's fix at r222377 + r222485.
rdar://18958417

llvm-svn: 222563

10 years agoDisable header duplication at -Oz in loop-rotate pass.
Roman Divacky [Fri, 21 Nov 2014 19:53:24 +0000 (19:53 +0000)]
Disable header duplication at -Oz in loop-rotate pass.

llvm-svn: 222562

10 years agoDebug Info: add an assertion that the context field of a global variable can not
Manman Ren [Fri, 21 Nov 2014 19:47:48 +0000 (19:47 +0000)]
Debug Info: add an assertion that the context field of a global variable can not
be a DIType with identifier.

This makes sure that there is no need to use DIScopeRef for global variable's
context.

rdar://18958417

llvm-svn: 222561

10 years agoUse isl_schedule_get_ctx
Tobias Grosser [Fri, 21 Nov 2014 19:39:42 +0000 (19:39 +0000)]
Use isl_schedule_get_ctx

llvm-svn: 222560

10 years agoFix typo
Tobias Grosser [Fri, 21 Nov 2014 19:39:38 +0000 (19:39 +0000)]
Fix typo

llvm-svn: 222559

10 years ago[Objective-C] Support a new special module flag that will be put into the
Manman Ren [Fri, 21 Nov 2014 19:24:55 +0000 (19:24 +0000)]
[Objective-C] Support a new special module flag that will be put into the
objc_imageinfo struct.

rdar://17954668

llvm-svn: 222558

10 years agoLazyValueInfo: range'ify some for-loops. No functional change.
Hans Wennborg [Fri, 21 Nov 2014 19:07:46 +0000 (19:07 +0000)]
LazyValueInfo: range'ify some for-loops. No functional change.

llvm-svn: 222557

10 years agoAdd params() to FunctionType. NFC.
Rafael Espindola [Fri, 21 Nov 2014 19:03:35 +0000 (19:03 +0000)]
Add params() to FunctionType. NFC.

While at it, also use makeArrayRef in elements().

llvm-svn: 222556

10 years agoDon't repeat class/function/variable names in comments. NFC.
Sanjay Patel [Fri, 21 Nov 2014 18:58:38 +0000 (18:58 +0000)]
Don't repeat class/function/variable names in comments. NFC.

llvm-svn: 222555

10 years agoLazyValueInfo: fix some typos and indentation, etc. NFC.
Hans Wennborg [Fri, 21 Nov 2014 18:58:23 +0000 (18:58 +0000)]
LazyValueInfo: fix some typos and indentation, etc. NFC.

llvm-svn: 222554

10 years agoAdd and use a helper elements() to StructType. NFC.
Rafael Espindola [Fri, 21 Nov 2014 18:53:05 +0000 (18:53 +0000)]
Add and use a helper elements() to StructType. NFC.

llvm-svn: 222553

10 years agoAdd an assertion for detecting missed/uncorrected TypoExprs.
Kaelyn Takata [Fri, 21 Nov 2014 18:48:06 +0000 (18:48 +0000)]
Add an assertion for detecting missed/uncorrected TypoExprs.

llvm-svn: 222552

10 years agoEnable ActOnIdExpression to use delayed typo correction for non-C++ code
Kaelyn Takata [Fri, 21 Nov 2014 18:48:04 +0000 (18:48 +0000)]
Enable ActOnIdExpression to use delayed typo correction for non-C++ code
when calling DiagnoseEmptyLookup.

llvm-svn: 222551

10 years agoProperly correct initializer expressions based on whether they would be valid.
Kaelyn Takata [Fri, 21 Nov 2014 18:48:00 +0000 (18:48 +0000)]
Properly correct initializer expressions based on whether they would be valid.

llvm-svn: 222550

10 years agoUse the full-Expr filter to disambiguate equidistant correction
Kaelyn Takata [Fri, 21 Nov 2014 18:47:58 +0000 (18:47 +0000)]
Use the full-Expr filter to disambiguate equidistant correction
candidates.

llvm-svn: 222549

10 years agoDo some cleanup of DumpValueObjectOptions. The whole concept of raw printing was...
Enrico Granata [Fri, 21 Nov 2014 18:47:26 +0000 (18:47 +0000)]
Do some cleanup of DumpValueObjectOptions. The whole concept of raw printing was split between feature-specific flags, and an m_be_raw flag, which then drove some other changes in printing behavior. Clean that up, so that each functionality has its own flag .. oh, and make the bools all go in a bitfield since I may want to add more of those over time

llvm-svn: 222548

10 years agoAllow multiple -debug-only args
Matthias Braun [Fri, 21 Nov 2014 18:06:09 +0000 (18:06 +0000)]
Allow multiple -debug-only args

Debug output is shown if any of the -debug-only arguments match.

llvm-svn: 222547

10 years agoLess space; NFC
Sanjay Patel [Fri, 21 Nov 2014 18:05:59 +0000 (18:05 +0000)]
Less space; NFC

llvm-svn: 222546

10 years agoFix formatting. NFC.
Rafael Espindola [Fri, 21 Nov 2014 18:05:55 +0000 (18:05 +0000)]
Fix formatting. NFC.

llvm-svn: 222545

10 years agoAdd a feature flag for slow 32-byte unaligned memory accesses [x86].
Sanjay Patel [Fri, 21 Nov 2014 17:40:04 +0000 (17:40 +0000)]
Add a feature flag for slow 32-byte unaligned memory accesses [x86].

This patch adds a feature flag to avoid unaligned 32-byte load/store AVX codegen
for Sandy Bridge and Ivy Bridge. There is no functionality change intended for
those chips. Previously, the absence of AVX2 was being used as a proxy to detect
this feature. But that hindered codegen for AVX-enabled AMD chips such as btver2
that do not have the 32-byte unaligned access slowdown.

Performance measurements are included in PR21541 ( http://llvm.org/bugs/show_bug.cgi?id=21541 ).

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

llvm-svn: 222544

10 years agoRevert "Allow FDE references outside the +/-2GB range supported by PC relative offset...
Duncan P. N. Exon Smith [Fri, 21 Nov 2014 17:21:18 +0000 (17:21 +0000)]
Revert "Allow FDE references outside the +/-2GB range supported by PC relative offsets for code models other than small/medium. For JIT application, memory layout is less controlled and can result in truncations otherwise."

This reverts commit r222538.

It's causing test failures for CFI, at least on Darwin:

http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental/1189/
http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA_check/1391/

Note that the previous incremental build was on r222537, and the CFI
tests weren't failing:
http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental/1188/

llvm-svn: 222542

10 years agoExtend PipePosix with child_processes_inherit support - to control whether pipe handl...
Oleksiy Vyalov [Fri, 21 Nov 2014 16:18:57 +0000 (16:18 +0000)]
Extend PipePosix with child_processes_inherit support - to control whether pipe handles should be inherited by a child process.

http://reviews.llvm.org/D6348

llvm-svn: 222541

10 years ago[x86] Restructure the checking patterns for v16 and v32 avx2 vector
Chandler Carruth [Fri, 21 Nov 2014 14:53:03 +0000 (14:53 +0000)]
[x86] Restructure the checking patterns for v16 and v32 avx2 vector
shuffle lowering to allow much better blend matching.

Specifically, with the new structure the code seems clearer to me and we
correctly can hit the cases where merging two 128-bit lanes is a clear
win and can be shuffled cheaply afterward.

llvm-svn: 222539

10 years agoAllow FDE references outside the +/-2GB range supported by PC relative
Joerg Sonnenberger [Fri, 21 Nov 2014 14:42:43 +0000 (14:42 +0000)]
Allow FDE references outside the +/-2GB range supported by PC relative
offsets for code models other than small/medium. For JIT application,
memory layout is less controlled and can result in truncations
otherwise.

Patch from Akos Kiss.

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

llvm-svn: 222538

10 years ago[x86] Make the previous logic significantly less conservative and get
Chandler Carruth [Fri, 21 Nov 2014 14:33:24 +0000 (14:33 +0000)]
[x86] Make the previous logic significantly less conservative and get
a bunch more improvements.

Non-lane-crossing is fine, the key is that lane merging only makes sense
for single-input shuffles. Not sure why I got so turned around here. The
code all works, I was just using the wrong model for it.

This only updates v4 and v8 lowering. The v16 and v32 lowering requires
restructuring the entire check sequence.

llvm-svn: 222537

10 years ago[DAG] Teach how to turn a build_vector into a shuffle if some of the operands are...
Andrea Di Biagio [Fri, 21 Nov 2014 14:32:06 +0000 (14:32 +0000)]
[DAG] Teach how to turn a build_vector into a shuffle if some of the operands are zero.

Before this patch, the DAGCombiner only tried to convert build_vector dag nodes
into shuffles if all operands were either extract_vector_elt or undef.

This patch improves that logic and teaches the DAGCombiner how to deal with
build_vector dag nodes where one or more operands are zero. A build_vector
dag node with some zero operands is turned into a shuffle only if the resulting
shuffle mask is legal for the target.

llvm-svn: 222536

10 years ago[ASan] Allow the users of SymbolizationLoop to make use of the --dsym_hint option...
Alexander Potapenko [Fri, 21 Nov 2014 14:12:00 +0000 (14:12 +0000)]
[ASan] Allow the users of SymbolizationLoop to make use of the --dsym_hint option in llvm-symbolizer

Let the users of SymbolizationLoop define a function that produces the list of .dSYM hints (possible path to the .dSYM bundle) for the given binary.
Because the hints can't be added to an existing llvm-symbolizer process, we spawn a new symbolizer process ones each time a new hint appears.
Those can only appear for binaries that we haven't seen before.

llvm-svn: 222535

10 years agoclang-format: Understand more lambda return types.
Daniel Jasper [Fri, 21 Nov 2014 14:08:38 +0000 (14:08 +0000)]
clang-format: Understand more lambda return types.

Before:
  auto a = [&b, c ](D * d) -> D * {}

After:
 auto a = [&b, c](D* d) -> D* {}

llvm-svn: 222534

10 years ago[x86] Teach the x86 vector shuffle lowering to detect mergable 128-bit
Chandler Carruth [Fri, 21 Nov 2014 13:56:05 +0000 (13:56 +0000)]
[x86] Teach the x86 vector shuffle lowering to detect mergable 128-bit
lanes.

By special casing these we can often either reduce the total number of
shuffles significantly or reduce the number of (high latency on Haswell)
AVX2 shuffles that potentially cross 128-bit lanes. Even when these
don't actually cross lanes, they have much higher latency to support
that. Doing two of them and a blend is worse than doing a single insert
across the 128-bit lanes to blend and then doing a single interleaved
shuffle.

While this seems like a narrow case, it kept cropping up on me and the
difference is *huge* as you can see in many of the test cases. I first
hit this trying to perfectly fix the interleaving shuffle patterns used
by Halide for AVX2.

llvm-svn: 222533

10 years agosanitizer_common: fix function w/o return
Dmitry Vyukov [Fri, 21 Nov 2014 13:55:19 +0000 (13:55 +0000)]
sanitizer_common: fix function w/o return
When SANITIZER_USES_CANONICAL_LINUX_SYSCALLS the function misses return statement.

llvm-svn: 222532

10 years agoclang-format: Use nested block special case for all languages.
Daniel Jasper [Fri, 21 Nov 2014 13:38:53 +0000 (13:38 +0000)]
clang-format: Use nested block special case for all languages.

Previously this was only used for JavaScript.

Before:
  functionCall({
                 int i;
                 int j;
               },
               aaaa, bbbb, cccc);

After:
  functionCall({
    int i;
    int j;
  }, aaaa, bbbb, cccc);

llvm-svn: 222531

10 years agoFix test after r222526.
Dmitry Vyukov [Fri, 21 Nov 2014 12:48:43 +0000 (12:48 +0000)]
Fix test after r222526.

llvm-svn: 222530

10 years agoclang-format: Handle comments in short case labels.
Daniel Jasper [Fri, 21 Nov 2014 12:36:25 +0000 (12:36 +0000)]
clang-format: Handle comments in short case labels.

With AllowShortCaseLabelsOnASingleLine set to true:
This gets now left unchanged:
  case 1:
    // comment
    return;

Whereas before it was changed into:
  case 1: // comment return;

This fixes llvm.org/PR21630.

llvm-svn: 222529

10 years ago[x86] Remove more windows line endings that slipped into this file...
Chandler Carruth [Fri, 21 Nov 2014 12:33:46 +0000 (12:33 +0000)]
[x86] Remove more windows line endings that slipped into this file...

llvm-svn: 222528

10 years agoclang-format: [Java] Support more Java keywords.
Daniel Jasper [Fri, 21 Nov 2014 12:19:07 +0000 (12:19 +0000)]
clang-format: [Java] Support more Java keywords.

Before:
  public final<X> Foo foo() {
  }

  public abstract<X> Foo foo();

After:
  public final <X> Foo foo() {
  }

  public abstract <X> Foo foo();

Patch by Harry Terkelsen. Thank you.

llvm-svn: 222527

10 years agoclang: do not add -pie for tsan
Dmitry Vyukov [Fri, 21 Nov 2014 12:19:01 +0000 (12:19 +0000)]
clang: do not add -pie for tsan

Revision 220571 removes the requirement to use -pie for tsan binaries. So remove -pie from driver.
Also s/hasZeroBaseShadow/requiresPIE/ because that is what it is used for. Msan does not have zero-based shadow, but requires pie. And in general the relation between zero-based shadow and pie is unclear.

http://reviews.llvm.org/D6318

llvm-svn: 222526

10 years ago[x86] Add a bunch of test cases to 256-bit shuffles that exercise
Chandler Carruth [Fri, 21 Nov 2014 12:17:50 +0000 (12:17 +0000)]
[x86] Add a bunch of test cases to 256-bit shuffles that exercise
merging 128-bit subvectors and also shuffling all the elements of those
subvectors. Currently we generate pretty bad code for many of these, but
I'm testing a patch that should dramatically improve this in addition to
making the shuffle lowering robust to other changes.

llvm-svn: 222525

10 years agoclang-format: [Java] Basic lambda support.
Daniel Jasper [Fri, 21 Nov 2014 12:14:12 +0000 (12:14 +0000)]
clang-format: [Java] Basic lambda support.

llvm-svn: 222524

10 years ago[OPENMP] Disable CapturedStmt generation for standalone directives.
Alexey Bataev [Fri, 21 Nov 2014 11:33:46 +0000 (11:33 +0000)]
[OPENMP] Disable CapturedStmt generation for standalone directives.
No functional changes, just code improvement.

llvm-svn: 222523

10 years ago[DAG] Refactor the shuffle combining logic in DAGCombiner. NFC.
Andrea Di Biagio [Fri, 21 Nov 2014 11:33:07 +0000 (11:33 +0000)]
[DAG] Refactor the shuffle combining logic in DAGCombiner. NFC.

This patch simplifies the logic that combines a pair of shuffle nodes into
a single shuffle if there is a legal mask. Also added comments to better
describe the algorithm. No functional change intended.

llvm-svn: 222522

10 years ago[X86] For Silvermont CPU use 16-bit division instead of 64-bit for small positive...
Alexey Volkov [Fri, 21 Nov 2014 11:19:34 +0000 (11:19 +0000)]
[X86] For Silvermont CPU use 16-bit division instead of 64-bit for small positive numbers

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

llvm-svn: 222521

10 years ago[asan] Runtime support for asan-instrument-allocas which enables instrumentation...
Yury Gribov [Fri, 21 Nov 2014 10:32:05 +0000 (10:32 +0000)]
[asan] Runtime support for asan-instrument-allocas which enables instrumentation of variable-sized dynamic allocas. Patch by Max Ostapenko.

Reviewed at http://reviews.llvm.org/D6055

llvm-svn: 222520

10 years ago[asan] Add new hidden compile-time flag asan-instrument-allocas to sanitize variable...
Yury Gribov [Fri, 21 Nov 2014 10:29:50 +0000 (10:29 +0000)]
[asan] Add new hidden compile-time flag asan-instrument-allocas to sanitize variable-sized dynamic allocas. Patch by Max Ostapenko.

Reviewed at http://reviews.llvm.org/D6055

llvm-svn: 222519

10 years agoAdd LLVMScalarOpts to LLVMPowerPCCodeGen.
NAKAMURA Takumi [Fri, 21 Nov 2014 09:14:45 +0000 (09:14 +0000)]
Add LLVMScalarOpts to LLVMPowerPCCodeGen.

llvm-svn: 222516

10 years agoMS ABI: Mangle char16_t and char32_t types
David Majnemer [Fri, 21 Nov 2014 09:06:49 +0000 (09:06 +0000)]
MS ABI: Mangle char16_t and char32_t types

These mangling make clang more compatible with MSVC 2015.
Correctly mangling char16_t and char32_t will take a little more work.

llvm-svn: 222515

10 years agoHandle extra whitespace in linux distribution name.
Eric Fiselier [Fri, 21 Nov 2014 08:54:35 +0000 (08:54 +0000)]
Handle extra whitespace in linux distribution name.

llvm-svn: 222514

10 years agoMark some locale tests as XFAIL on debian and opensuse.
Eric Fiselier [Fri, 21 Nov 2014 08:02:38 +0000 (08:02 +0000)]
Mark some locale tests as XFAIL on debian and opensuse.

llvm-svn: 222513

10 years agoFix missing diagnostic for unsupported TLS for some thread_local variables.
Bob Wilson [Fri, 21 Nov 2014 06:52:52 +0000 (06:52 +0000)]
Fix missing diagnostic for unsupported TLS for some thread_local variables.

Clang r181627 moved a check for block-scope variables into this code for
handling thread storage class specifiers, but in the process, it broke the
logic for checking if the target supports TLS. Fix this with some simple
restructuring of the code. rdar://problem/18796883

llvm-svn: 222512

10 years agofix Bug21211 : reworked test/api/multithreaded/test_listener_event_description.cpp...
Shawn Best [Fri, 21 Nov 2014 06:49:39 +0000 (06:49 +0000)]
fix Bug21211 : reworked test/api/multithreaded/test_listener_event_description.cpp to work properly on Linux/FreeBSD

Issue D5632 fixed an issue where linux would dump spurious output to tty on startup (due to a broadcast stop event). After the checkin, it was noticed on FreeBSD a unit test was now failing. On closer investigation I found the test was using the C++ API to launch an inferior while using an SBListener to monitor the public state changes. As on OSx, it was expecting to see:

eStateRunning
eStateStopped

On Linux/FreeBSD, there is an extra state change

eStateLaunching
eStateRunning
eStateStopped

I reworked the test to work for both cases and re-enabled the test of FreeBSD.

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

llvm-svn: 222511

10 years agoDAGCombiner: Allow the DAGCombiner to combine multiple FDIVs with the same divisor...
Hao Liu [Fri, 21 Nov 2014 06:39:58 +0000 (06:39 +0000)]
DAGCombiner: Allow the DAGCombiner to combine multiple FDIVs with the same divisor info FMULs by the reciprocal.
E.g., ( a / D; b / D ) -> ( recip = 1.0 / D; a * recip; b * recip)

A hook is added to allow the target to control whether it needs to do such combine.

Reviewed in http://reviews.llvm.org/D6334

llvm-svn: 222510

10 years agoRemove a bunch of unnecessary typecasts to 'const TargetRegisterClass *'
Craig Topper [Fri, 21 Nov 2014 05:58:21 +0000 (05:58 +0000)]
Remove a bunch of unnecessary typecasts to 'const TargetRegisterClass *'

llvm-svn: 222509

10 years agoAdd extra new line and remove some trailing whitespace from tablegen RegisterInfo...
Craig Topper [Fri, 21 Nov 2014 05:58:14 +0000 (05:58 +0000)]
Add extra new line and remove some trailing whitespace from tablegen RegisterInfo output file.

llvm-svn: 222508

10 years ago[modules] When explicitly importing a module, it's fine for the imported module
Richard Smith [Fri, 21 Nov 2014 05:37:20 +0000 (05:37 +0000)]
[modules] When explicitly importing a module, it's fine for the imported module
to be newer than we were expecting. That happens if .pcm's get moved between
file systems during a distributed build. (It's still not OK for them to actually
be different, though, so we still check the size and signature matches.)

llvm-svn: 222507

10 years agoPR21323: Fix iterator invalidation issue when looking for redeclarations of a
Richard Smith [Fri, 21 Nov 2014 05:16:13 +0000 (05:16 +0000)]
PR21323: Fix iterator invalidation issue when looking for redeclarations of a
special member function.

No test yet: the only testcases we have for this issue are extremely complex.
Testcase will be added once I get a reasonable reduction.

llvm-svn: 222506

10 years agoFix a silly bug in StreamingMemoryObject.cpp.
Rafael Espindola [Fri, 21 Nov 2014 05:15:41 +0000 (05:15 +0000)]
Fix a silly bug in StreamingMemoryObject.cpp.

The logic for detecting EOF was wrong and would fail if we ever requested
more than 16k past the last read position.

llvm-svn: 222505

10 years ago[PPC] Use SeparateConstOffsetFromGEP
Hal Finkel [Fri, 21 Nov 2014 04:35:51 +0000 (04:35 +0000)]
[PPC] Use SeparateConstOffsetFromGEP

This mirrors r222331, which enabled SeparateConstOffsetFromGEP on AArch64, in
the PowerPC backend. Yields, on a POWER7 machine, a 30% speedup on
SingleSource/Benchmarks/Shootout/nestedloop (this might just be from LICM,
there is a store moved out of the inner loop) and a potential speedup on
MultiSource/Benchmarks/mediabench/mpeg2/mpeg2dec/mpeg2decode. Regardless, it
makes some code look cleaner, and synchronizing the backends in this regard
seems like a generally good thing.

llvm-svn: 222504

10 years agoExtend -Wuninitialized to warn when accessing uninitialized base classes in a
Richard Trieu [Fri, 21 Nov 2014 03:10:30 +0000 (03:10 +0000)]
Extend -Wuninitialized to warn when accessing uninitialized base classes in a
constructor.

llvm-svn: 222503

10 years agoAdd accessor marcos to ConstantPlaceHolder, similar to those in the base class.
Richard Trieu [Fri, 21 Nov 2014 02:42:08 +0000 (02:42 +0000)]
Add accessor marcos to ConstantPlaceHolder, similar to those in the base class.

llvm-svn: 222502

10 years agoRework parallel test process count logic
Ed Maste [Fri, 21 Nov 2014 02:41:25 +0000 (02:41 +0000)]
Rework parallel test process count logic

The default value for opt.thread_count was multiprocessing.cpu_count(),
which meant the LLDB_TEST_THREADS environment variable was never used.
It's not easy to pass the -t option to the test run when invoking it
from e.g. 'ninja check-lldb', so having the environment variable as an
option is useful.

Change the logic so that the thread count is set by the first one of:

  1. The -t option to test/dosep.py
  2. The LLDB_TEST_THREADS environment variable
  3. The machine's CPU count from multiprocessing.cpu_count()

llvm-svn: 222501

10 years agoThis Reassociate change unintentionally slipped in r222499
David Majnemer [Fri, 21 Nov 2014 02:37:38 +0000 (02:37 +0000)]
This Reassociate change unintentionally slipped in r222499

llvm-svn: 222500

10 years agoSROA: The alloca type isn't a candidate promotion type for vectors
David Majnemer [Fri, 21 Nov 2014 02:34:55 +0000 (02:34 +0000)]
SROA: The alloca type isn't a candidate promotion type for vectors

The alloca's type is irrelevant, only those types which are used in a
load or store of the exact size of the slice should be considered.

This manifested as an assertion failure when we compared the various
types: we had a size mismatch.

This fixes PR21480.

llvm-svn: 222499

10 years agoChange CommandObjectTargetModulesLoad so that the filename argument
Jason Molenda [Fri, 21 Nov 2014 02:25:15 +0000 (02:25 +0000)]
Change CommandObjectTargetModulesLoad so that the filename argument
is treated as a string instead of a FileSpec.

OptionValueFileSpec::SetValueFromCString() passes the c string to
FileSpec::SetFile(str, true /* resolve */) - and with Zachary's
changes to FileSpec we're using llvm::sys::fs::make_absolute() to
do that "resolve" action now, where we used to use realpath().

One important difference between llvm::sys::fs::make_absolute and
realpath is that when they're handed a filename (no directory),
realpath prepends the current working directory *and if the file exists*,
returns that full path.  If that file doesn't exist, the caller
uses the basename only.

llvm::sys::fs::make_absolute prepends the current working directory
regardless of whether it exists or not.

I considered having FileSpec::SetFile save the initial pathname,
call FileSpec::Resolve, and then check to see if the Resolve return
path exists - and if not, go back to the original one.

But instead I just went with changing 'target modules load' to treat its
filename argument as a string instead of a FileSpec.  This brings it
in line with how 'target modules list' works.

<rdar://problem/18955416>

llvm-svn: 222498

10 years agoClarify the description of the noalias attribute
Hal Finkel [Fri, 21 Nov 2014 02:22:46 +0000 (02:22 +0000)]
Clarify the description of the noalias attribute

The previous description of the noalias attribute did not accurately specify
the implemented semantics, and the terminology used differed unnecessarily
from that used by the C specification to define the semantics of restrict. For
the argument attribute, the semantics can be precisely specified in terms of
objects accessed through pointers based on the arguments, and this is now what
is done.

Saying that the semantics are 'slightly weaker' than that provided by C99
restrict is not really useful without further elaboration, so that has been
removed from the sentence.

noalias on a return value is really used to mean that the function is
malloc-like (and, in fact, we use this attribute to represent
__attribute__((malloc)) in Clang), and this is a stronger guarantee than that
provided by restrict (because it is a property of the pointed-to memory region,
not just a guarantee on object access). Clarifying this is relevant to fixing
(and was motivated by the discussion on) PR21556.

llvm-svn: 222497

10 years agoEnsure llvm-sanitizer is found by the tests when using sanitizers.
Eric Fiselier [Fri, 21 Nov 2014 02:16:19 +0000 (02:16 +0000)]
Ensure llvm-sanitizer is found by the tests when using sanitizers.

llvm-svn: 222496

10 years agoRename lldb registers to contain lldb_ prefix.
Zachary Turner [Fri, 21 Nov 2014 02:00:21 +0000 (02:00 +0000)]
Rename lldb registers to contain lldb_ prefix.

LLDB supports many different register numbering schemes, and these
are typically prefixed with an indicator that lets the user know
what numbering scheme is used.  The gcc numbering scheme is
prefixed with gcc, and there are similar ones for dwarf, gdb,
and gcc_dwarf.

LLDB also contains its own internal numbering scheme, but the enum
for LLDB's numbering scheme was prefixed differently.  This patch
changes the names of these enums to use the same naming scheme for
the enum values as the rest of the register kinds by removing gpr_
and fpu_ prefixes, and instead using lldb_ prefixes for all enum
values.

Differential Revision: http://reviews.llvm.org/D6351
Reviewed by: Greg Clayton

llvm-svn: 222495

10 years ago[MCJIT] Remove JITEventListener::NotifyFreeingMachineCode. This method is dead
Lang Hames [Fri, 21 Nov 2014 01:57:09 +0000 (01:57 +0000)]
[MCJIT] Remove JITEventListener::NotifyFreeingMachineCode. This method is dead
now that the old JIT has been removed.

llvm-svn: 222494

10 years ago[libcxxabi] Cleanup memory in tests to placate ASAN.
Eric Fiselier [Fri, 21 Nov 2014 01:53:51 +0000 (01:53 +0000)]
[libcxxabi] Cleanup memory in tests to placate ASAN.

Summary: ASAN fires on these tests because they don't clean up their memory.

Reviewers: danalbert, jroelofs, mclow.lists

Reviewed By: jroelofs

Subscribers: dblaikie, cfe-commits

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

llvm-svn: 222493

10 years agoAdd more REQUIRES: LOCALE.* to tests.
Dan Albert [Fri, 21 Nov 2014 01:23:04 +0000 (01:23 +0000)]
Add more REQUIRES: LOCALE.* to tests.

llvm-svn: 222492

10 years agoAdd curly braces to workaround an MSVC bug.
Zachary Turner [Fri, 21 Nov 2014 01:19:09 +0000 (01:19 +0000)]
Add curly braces to workaround an MSVC bug.

MSVC can't parse this pattern for range-based for loops.

llvm-svn: 222491

10 years agorelax this testcase to not depend on a specific alignment.
Adrian Prantl [Fri, 21 Nov 2014 00:48:22 +0000 (00:48 +0000)]
relax this testcase to not depend on a specific alignment.

llvm-svn: 222490

10 years ago[X86] Do not custom lower UINT_TO_FP when the target type does not
Quentin Colombet [Fri, 21 Nov 2014 00:47:19 +0000 (00:47 +0000)]
[X86] Do not custom lower UINT_TO_FP when the target type does not
match the custom lowering.

<rdar://problem/19026326>

llvm-svn: 222489

10 years agoVerifier: Check that all instructions have their parent pointers set up
Adrian Prantl [Fri, 21 Nov 2014 00:39:43 +0000 (00:39 +0000)]
Verifier: Check that all instructions have their parent pointers set up
correctly. This helps with catching problems caused by IRBuilder abuse
such as the one fixed in CFE r222487.

llvm-svn: 222488