platform/upstream/llvm.git
9 years agoR600/SI: Implement enableAggressiveFMAFusion
Matt Arsenault [Thu, 29 Jan 2015 19:34:32 +0000 (19:34 +0000)]
R600/SI: Implement enableAggressiveFMAFusion

Add tests for the various combines. This should
always be at least cycle neutral on all subtargets for f64,
and faster on some. For f32 we should prefer selecting
v_mad_f32 over v_fma_f32.

llvm-svn: 227484

9 years agoR600/SI: Add subtarget feature for if f32 fma is fast
Matt Arsenault [Thu, 29 Jan 2015 19:34:25 +0000 (19:34 +0000)]
R600/SI: Add subtarget feature for if f32 fma is fast

llvm-svn: 227483

9 years agoR600/SI: Fix tonga's basic scheduling model
Matt Arsenault [Thu, 29 Jan 2015 19:34:18 +0000 (19:34 +0000)]
R600/SI: Fix tonga's basic scheduling model

llvm-svn: 227482

9 years agoDebugInfo: Teach Fast ISel to respect the debug location of comparisons in jumps
David Blaikie [Thu, 29 Jan 2015 19:09:18 +0000 (19:09 +0000)]
DebugInfo: Teach Fast ISel to respect the debug location of comparisons in jumps

The use of the DbgLoc in FastISel is probably something we should fix.
It's prone to leaking the wrong location into instructions - we should
have a clear chain of custody from the debug location of an IR
Instruction to that of a MachineInstr to avoid such leakage.

llvm-svn: 227481

9 years ago[PowerPC] Work around TLS linker bug
Ulrich Weigand [Thu, 29 Jan 2015 19:08:51 +0000 (19:08 +0000)]
[PowerPC] Work around TLS linker bug

Work around a bug in GNU ld (and gold) linker versions up to 2.25
that may mis-optimize code generated by this version of clang/LLVM
to access general-dynamic or local-dynamic TLS variables.

Bug is fixed here:
https://sourceware.org/ml/binutils/2015-01/msg00318.html

llvm-svn: 227480

9 years agoDisable compilation of llvm-pdbdump for versions of MSVC < 2013.
Zachary Turner [Thu, 29 Jan 2015 18:44:14 +0000 (18:44 +0000)]
Disable compilation of llvm-pdbdump for versions of MSVC < 2013.

Certain aspects of llvm-pdbdump require language support only present in
MSVC 2013 and higher.  Since this is strictly a utility, and since we hope
to drop support for MSVC 2012 soon, don't build this unless MSVC 2013 or
higher.

llvm-svn: 227479

9 years ago[fuzzer] fix warning in a test
Kostya Serebryany [Thu, 29 Jan 2015 18:13:36 +0000 (18:13 +0000)]
[fuzzer] fix warning in a test

llvm-svn: 227478

9 years agoCompute the ELF SectionKind from the flags.
Rafael Espindola [Thu, 29 Jan 2015 17:33:21 +0000 (17:33 +0000)]
Compute the ELF SectionKind from the flags.

Any code creating an MCSectionELF knows ELF and already provides the flags.

SectionKind is an abstraction used by common code that uses a plain
MCSection.

Use the flags to compute the SectionKind. This removes a lot of
guessing and boilerplate from the MCSectionELF construction.

llvm-svn: 227476

9 years ago[Hexagon] Deleting old variants of intrinsics and adding missing tests.
Colin LeMahieu [Thu, 29 Jan 2015 17:26:56 +0000 (17:26 +0000)]
[Hexagon] Deleting old variants of intrinsics and adding missing tests.

llvm-svn: 227474

9 years ago[asan] Add one more wait-for-device in the Android setup script.
Evgeniy Stepanov [Thu, 29 Jan 2015 17:24:21 +0000 (17:24 +0000)]
[asan] Add one more wait-for-device in the Android setup script.

llvm-svn: 227473

9 years agoThis reverts commit r227432, r227438 and r227448.
Rafael Espindola [Thu, 29 Jan 2015 17:22:53 +0000 (17:22 +0000)]
This reverts commit r227432, r227438 and r227448.

It should bring the bots back.

Original messagses:

r227448:
   Remove unnecessary default.

r227438:
   Fix Index/print-type.cpp test following r227432.

r227432:
    libclang: Add three functions useful for dealing with anonymous fields:
       clang_Cursor_getOffsetOfField
       clang_Cursor_isAnonymous
       clang_Type_visitFields
    Python: Add corresponding methods for dealing with anonymous fields.

    Patch by Loïc Jaquemet

llvm-svn: 227472

9 years ago[lto] Disable dialog boxes on crash on Windows.
Michael J. Spencer [Thu, 29 Jan 2015 17:20:41 +0000 (17:20 +0000)]
[lto] Disable dialog boxes on crash on Windows.

This has to be done in the DLL because the state doesn't cross DLL boundaries.

llvm-svn: 227471

9 years ago[Support][Windows] Unify dialog box suppression and print stack traces on abort.
Michael J. Spencer [Thu, 29 Jan 2015 17:20:29 +0000 (17:20 +0000)]
[Support][Windows] Unify dialog box suppression and print stack traces on abort.

llvm-svn: 227470

9 years agoPin the libiomp5.dll for the lifetime of application, Windows-specific
Andrey Churbanov [Thu, 29 Jan 2015 17:18:20 +0000 (17:18 +0000)]
Pin the libiomp5.dll for the lifetime of application, Windows-specific

llvm-svn: 227469

9 years ago[fuzzer] minor cleanup based on reviews: remove redundant includes, fix a copy-pasto...
Kostya Serebryany [Thu, 29 Jan 2015 17:16:23 +0000 (17:16 +0000)]
[fuzzer] minor cleanup based on reviews: remove redundant includes, fix a copy-pasto in tests

llvm-svn: 227468

9 years agoenable environment variable KMP_PLACE_THREADS also for non-MIC architectures
Andrey Churbanov [Thu, 29 Jan 2015 17:14:58 +0000 (17:14 +0000)]
enable environment variable KMP_PLACE_THREADS also for non-MIC architectures

llvm-svn: 227467

9 years ago[fuzzer] add FAQ section to the README.txt
Kostya Serebryany [Thu, 29 Jan 2015 17:11:30 +0000 (17:11 +0000)]
[fuzzer] add FAQ section to the README.txt

llvm-svn: 227466

9 years agoReverting r227453, which adds back the fuzzer library. Now excluding the clang-format...
Aaron Ballman [Thu, 29 Jan 2015 16:58:53 +0000 (16:58 +0000)]
Reverting r227453, which adds back the fuzzer library. Now excluding the clang-format fuzzer functionality based on LLVM_USE_SANITIZE_COVERAGE being set or unset.

llvm-svn: 227465

9 years agoReverting r227452, which adds back the fuzzer library. Now excluding the fuzzer libra...
Aaron Ballman [Thu, 29 Jan 2015 16:58:29 +0000 (16:58 +0000)]
Reverting r227452, which adds back the fuzzer library. Now excluding the fuzzer library based on LLVM_USE_SANITIZE_COVERAGE being set or unset.

llvm-svn: 227464

9 years ago[Hexagon] Adding CR intrinsic tests.
Colin LeMahieu [Thu, 29 Jan 2015 16:55:37 +0000 (16:55 +0000)]
[Hexagon] Adding CR intrinsic tests.

llvm-svn: 227463

9 years agoR600/SI: Remove stray debug statements
Tom Stellard [Thu, 29 Jan 2015 16:55:28 +0000 (16:55 +0000)]
R600/SI: Remove stray debug statements

llvm-svn: 227462

9 years agoR600/SI: Define a schedule model and enable the generic machine scheduler
Tom Stellard [Thu, 29 Jan 2015 16:55:25 +0000 (16:55 +0000)]
R600/SI: Define a schedule model and enable the generic machine scheduler

The schedule model is not complete yet, and could be improved.

llvm-svn: 227461

9 years ago[Hexagon] Deleting unused classes.
Colin LeMahieu [Thu, 29 Jan 2015 16:35:38 +0000 (16:35 +0000)]
[Hexagon] Deleting unused classes.

llvm-svn: 227460

9 years agoOops -- accidentally commit some debug code! Removing that code; NFC (this time for...
Aaron Ballman [Thu, 29 Jan 2015 16:18:59 +0000 (16:18 +0000)]
Oops -- accidentally commit some debug code! Removing that code; NFC (this time for real).

llvm-svn: 227459

9 years ago[X86] Use single add/sub for large stack offsets
Robert Lougher [Thu, 29 Jan 2015 16:18:29 +0000 (16:18 +0000)]
[X86] Use single add/sub for large stack offsets

For large stack offsets the compiler generates multiple immediate mode
sub/add instructions in the prologue/epilogue.  This patch makes the
compiler place the final amount to be added/subtracted into a register,
which is then added/substracted with a single operation.

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

llvm-svn: 227458

9 years ago[Hexagon] Adding XTYPE/PRED intrinsic tests. Converting predicate types to i32 inste...
Colin LeMahieu [Thu, 29 Jan 2015 16:08:43 +0000 (16:08 +0000)]
[Hexagon] Adding XTYPE/PRED intrinsic tests.  Converting predicate types to i32 instead of i1.

llvm-svn: 227457

9 years agoAttempting to fix a build issue with MSVC 2012; NFC
Aaron Ballman [Thu, 29 Jan 2015 16:02:06 +0000 (16:02 +0000)]
Attempting to fix a build issue with MSVC 2012; NFC

llvm-svn: 227456

9 years ago[PowerPC] Complete setting the baseline for ppc64le
Bill Schmidt [Thu, 29 Jan 2015 15:59:09 +0000 (15:59 +0000)]
[PowerPC] Complete setting the baseline for ppc64le

Patch by Nemanja Ivanovic.

As was uncovered by the failing test case (when run on non-PPC
platforms), the feature set when compiling with -march=ppc64le was not
being picked up. This change ensures that if the -mcpu option is not
specified, the correct feature set is picked up regardless of whether
we are on PPC or not.

llvm-svn: 227455

9 years agofix that sets proc-bind-var to proc_bind_false if affinity is not supported
Andrey Churbanov [Thu, 29 Jan 2015 15:52:20 +0000 (15:52 +0000)]
fix that sets proc-bind-var to proc_bind_false if affinity is not supported

llvm-svn: 227454

9 years agoTemporarily reverting the fuzzer library as it causes too many build issues for MSVC...
Aaron Ballman [Thu, 29 Jan 2015 15:49:46 +0000 (15:49 +0000)]
Temporarily reverting the fuzzer library as it causes too many build issues for MSVC users. This reverts: 227354

llvm-svn: 227453

9 years agoTemporarily reverting the fuzzer library as it causes too many build issues for MSVC...
Aaron Ballman [Thu, 29 Jan 2015 15:49:22 +0000 (15:49 +0000)]
Temporarily reverting the fuzzer library as it causes too many build issues for MSVC users. This reverts: 227445, 227395, 227389, 227357, 227254, 227252

llvm-svn: 227452

9 years agofixing typo in error message
Andrey Churbanov [Thu, 29 Jan 2015 15:49:22 +0000 (15:49 +0000)]
fixing typo in error message

llvm-svn: 227451

9 years agofixing mistake in kmp_get_affinity_max_proc() api function
Andrey Churbanov [Thu, 29 Jan 2015 15:48:21 +0000 (15:48 +0000)]
fixing mistake in kmp_get_affinity_max_proc() api function

llvm-svn: 227450

9 years agofixing the Fortran modules dependencies
Andrey Churbanov [Thu, 29 Jan 2015 15:43:48 +0000 (15:43 +0000)]
fixing the Fortran modules dependencies

llvm-svn: 227449

9 years agoRemove unnecessary default.
Francois Pichet [Thu, 29 Jan 2015 15:42:56 +0000 (15:42 +0000)]
Remove unnecessary default.

llvm-svn: 227448

9 years agoadding the jobs variable for parallel build
Andrey Churbanov [Thu, 29 Jan 2015 15:37:15 +0000 (15:37 +0000)]
adding the jobs variable for parallel build

llvm-svn: 227447

9 years agoMake the test actually test what it's supposed to test. Add a test for the from memor...
Alex Rosenberg [Thu, 29 Jan 2015 15:19:54 +0000 (15:19 +0000)]
Make the test actually test what it's supposed to test. Add a test for the from memory variant of vcvtph2ps for 256-bit.

llvm-svn: 227446

9 years agoAdding missing #includes to try to get this to compile on Windows with Visual Studio.
Aaron Ballman [Thu, 29 Jan 2015 15:19:13 +0000 (15:19 +0000)]
Adding missing #includes to try to get this to compile on Windows with Visual Studio.

llvm-svn: 227445

9 years ago[clang-tidy] Fix some false positives in google-readability-casting
Alexander Kornienko [Thu, 29 Jan 2015 15:17:13 +0000 (15:17 +0000)]
[clang-tidy] Fix some false positives in google-readability-casting

Summary:
Ignore C-style casts in extern "C" {} sections. Be more careful when
detecting redundant casts between typedefs to the same type - emit a more
specific warning and don't automatically fix them.

Reviewers: klimek

Reviewed By: klimek

Subscribers: curdeius, cfe-commits

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

llvm-svn: 227444

9 years ago[xcore] Make the exceptions test actually check for the absence of -fexceptions in...
Filipe Cabecinhas [Thu, 29 Jan 2015 15:03:36 +0000 (15:03 +0000)]
[xcore] Make the exceptions test actually check for the absence of -fexceptions in the proper place

llvm-svn: 227443

9 years agoRemove unused tokens in the ll lexer.
Sean Silva [Thu, 29 Jan 2015 14:45:09 +0000 (14:45 +0000)]
Remove unused tokens in the ll lexer.

Patch by Robin Eklind!

llvm-svn: 227442

9 years agoUse isMergeableConst now that it is sane.
Rafael Espindola [Thu, 29 Jan 2015 14:23:28 +0000 (14:23 +0000)]
Use isMergeableConst now that it is sane.

llvm-svn: 227441

9 years agoRemove MergeableConst.
Rafael Espindola [Thu, 29 Jan 2015 14:12:41 +0000 (14:12 +0000)]
Remove MergeableConst.

Only the specific ones (MergeableConst4, MergeableConst8, MergeableConst16) are
handled specially.

llvm-svn: 227440

9 years ago[LoopReroll] Refactor most of reroll() into a helper class
James Molloy [Thu, 29 Jan 2015 13:48:05 +0000 (13:48 +0000)]
[LoopReroll] Refactor most of reroll() into a helper class

reroll() was slightly monolithic and a pain to modify. Refactor
a bunch of its state from local variables to member variables
of a helper class, and do some trivial simplification while we're
there.

llvm-svn: 227439

9 years agoFix Index/print-type.cpp test following r227432.
Francois Pichet [Thu, 29 Jan 2015 13:33:44 +0000 (13:33 +0000)]
Fix Index/print-type.cpp test following r227432.

llvm-svn: 227438

9 years agoCleanup a few tests on sse4a machines and FileCheckize along the way.
Alex Rosenberg [Thu, 29 Jan 2015 13:31:32 +0000 (13:31 +0000)]
Cleanup a few tests on sse4a machines and FileCheckize along the way.

llvm-svn: 227437

9 years agoEHPrepare: Remove leftover initialization code for DomTrees.
Benjamin Kramer [Thu, 29 Jan 2015 13:26:50 +0000 (13:26 +0000)]
EHPrepare: Remove leftover initialization code for DomTrees.

While there modernize some loops. NFC.

llvm-svn: 227436

9 years agoUse enum values. NFC.
Rafael Espindola [Thu, 29 Jan 2015 13:25:44 +0000 (13:25 +0000)]
Use enum values. NFC.

llvm-svn: 227435

9 years agoDisable a couple of crash-* tests for now. It seems they might be incompatible to...
NAKAMURA Takumi [Thu, 29 Jan 2015 13:23:23 +0000 (13:23 +0000)]
Disable a couple of crash-* tests for now. It seems they might be incompatible to win32.

llvm-svn: 227434

9 years agoclang-format: FIXME that led to access of uninitialized memory.
Daniel Jasper [Thu, 29 Jan 2015 13:11:47 +0000 (13:11 +0000)]
clang-format: FIXME that led to access of uninitialized memory.

I have so far not succeeded in finding a nicely reduced test case or an
observable difference which could help me create a test failure without
msan.

Committing without test to unblock kcc's further fuzzing progress.

llvm-svn: 227433

9 years agolibclang: Add three functions useful for dealing with anonymous fields:
Francois Pichet [Thu, 29 Jan 2015 12:45:29 +0000 (12:45 +0000)]
libclang: Add three functions useful for dealing with anonymous fields:
   clang_Cursor_getOffsetOfField
   clang_Cursor_isAnonymous
   clang_Type_visitFields
Python: Add corresponding methods for dealing with anonymous fields.

Patch by Loïc Jaquemet

llvm-svn: 227432

9 years agoDon't create multiple mergeable sections with -fdata-sections.
Rafael Espindola [Thu, 29 Jan 2015 12:43:28 +0000 (12:43 +0000)]
Don't create multiple mergeable sections with -fdata-sections.

ELF has support for sections that can be split into fixed size or
null terminated entities.

Since these sections can be split by the linker, it is not necessary
to split them in codegen.

This reduces the combined .o size in a llvm+clang build from
202,394,570 to 173,819,098 bytes.

The time for linking clang with gold (on a VM, on a laptop) goes
from 2.250089985 to 1.383001792 seconds.

The flip side is the size of rodata in clang goes from 10,926,785
to 10,929,345 bytes.

The increase seems to be because of http://sourceware.org/bugzilla/show_bug.cgi?id=17902.

llvm-svn: 227431

9 years ago[Mips][Disassembler] When disassembler meets cache/pref instructions for r6 it crashe...
Vladimir Medic [Thu, 29 Jan 2015 11:33:41 +0000 (11:33 +0000)]
[Mips][Disassembler] When disassembler meets cache/pref instructions for r6 it crashes as the access to operands array is out of range. This patch adds dedicated decoder method for R6 CACHE_HINT_DESC class that properly handles decoding of these instructions.

llvm-svn: 227430

9 years agoAdd a missing Tag_DIV_use test for Cortex-M7.
Charlie Turner [Thu, 29 Jan 2015 11:19:54 +0000 (11:19 +0000)]
Add a missing Tag_DIV_use test for Cortex-M7.

llvm-svn: 227429

9 years agoCommandLineParser: Avoid non-static member nitializer(s).
NAKAMURA Takumi [Thu, 29 Jan 2015 11:06:59 +0000 (11:06 +0000)]
CommandLineParser: Avoid non-static member nitializer(s).

llvm-svn: 227428

9 years agoclang-format: Fix crasher caused by not properly setting dry-run.
Daniel Jasper [Thu, 29 Jan 2015 10:47:14 +0000 (10:47 +0000)]
clang-format: Fix crasher caused by not properly setting dry-run.

llvm-svn: 227427

9 years agoMS ABI: Implement proper support for setjmp
David Majnemer [Thu, 29 Jan 2015 09:29:21 +0000 (09:29 +0000)]
MS ABI: Implement proper support for setjmp

On targets which use the MSVCRT, setjmp is a macro which expands to
_setjmp or _setjmpex.

_setjmp and _setjmpex have a secret, hidden argument which is not listed
in the function prototype on X64 and WoA.  This hidden argument always
seems to be the frame pointer.

_setjmpex isn't used on X86, _setjmp is magically replaced with a call
to _setjmp3.  The second argument is zero for 'normal' setjmp/longjmp
pairs, otherwise it is a count of additional variadic arguments.  This
is used when setjmp appears inside of a try or __try.

It is not safe to use a pointer to setjmp because _setjmp, _setjmpex and
_setmp3 are not compatible with setjmp.

llvm-svn: 227426

9 years agoBasic: Re-sort these builtins
David Majnemer [Thu, 29 Jan 2015 09:29:17 +0000 (09:29 +0000)]
Basic: Re-sort these builtins

No functional change, it just makes it a little easier to find what you
are looking for.

llvm-svn: 227425

9 years agoFix the preprocessor checks used to determine if backtraces have been enabled.
Owen Anderson [Thu, 29 Jan 2015 07:53:13 +0000 (07:53 +0000)]
Fix the preprocessor checks used to determine if backtraces have been enabled.

llvm-svn: 227424

9 years agoUse the existing build configuration parameter ENABLE_BACKTRACE to compile out all...
Owen Anderson [Thu, 29 Jan 2015 07:35:31 +0000 (07:35 +0000)]
Use the existing build configuration parameter ENABLE_BACKTRACE to compile out all pretty stack trace support when backtraces are disabled.

This has the nice secondary effect of allowing LLVM to continue to build
for targets without __thread or thread_local support to continue to work
so long as they build without support for backtraces.

llvm-svn: 227423

9 years ago[ELFYAML] Provide default value 0 for YAML relocation addendum field
Simon Atanasyan [Thu, 29 Jan 2015 06:56:24 +0000 (06:56 +0000)]
[ELFYAML] Provide default value 0 for YAML relocation addendum field

Follow up to r227318.

llvm-svn: 227422

9 years agoIf lldb is being built with ASAN instrumentation, have lldb
Jason Molenda [Thu, 29 Jan 2015 06:28:36 +0000 (06:28 +0000)]
If lldb is being built with ASAN instrumentation, have lldb
create its own threads with 8MB additional maximum stack size.
Extra room is needed for the bookkeeping needed for this
instrumentation.

llvm-svn: 227421

9 years agoMake a codegen warning a real warning instead of a getCustomDiagID().
Nico Weber [Thu, 29 Jan 2015 06:25:59 +0000 (06:25 +0000)]
Make a codegen warning a real warning instead of a getCustomDiagID().

Warnings shouldn't use getCustomDiagID(), since then they can't be disabled
via a flag, can't be remapped, etc.

llvm-svn: 227420

9 years agoWhen starting a kernel debug session (PlatformDarwinKernel), scan
Jason Molenda [Thu, 29 Jan 2015 06:20:05 +0000 (06:20 +0000)]
When starting a kernel debug session (PlatformDarwinKernel), scan
for executable binaries on the local filesystem so the user doesn't
need to provide the path to the correct binary manually.

Also have lldb search for kexts/the kernel in the current working
directory in addition to all the usual places.

<rdar://problem/18126501>

llvm-svn: 227419

9 years agoSema: Turn some applicable functions static. NBC.
Francisco Lopes da Silva [Thu, 29 Jan 2015 05:54:59 +0000 (05:54 +0000)]
Sema: Turn some applicable functions static. NBC.

llvm-svn: 227418

9 years agoDon't use BCPL comments here, in case someone wants to use <stdatomic.h> from C89...
Richard Smith [Thu, 29 Jan 2015 03:34:39 +0000 (03:34 +0000)]
Don't use BCPL comments here, in case someone wants to use <stdatomic.h> from C89 mode.

llvm-svn: 227417

9 years ago[asan] use getrusage as an alternative to reading /proc/self/statm. Also move GetRSS...
Kostya Serebryany [Thu, 29 Jan 2015 02:54:39 +0000 (02:54 +0000)]
[asan] use getrusage as an alternative to reading /proc/self/statm. Also move GetRSS to sanitizer_linux_libcdep.cc (no change in the function itself)

llvm-svn: 227416

9 years agoRemove an unused private field added r227405 to fix a Clang warning.
Chandler Carruth [Thu, 29 Jan 2015 02:44:53 +0000 (02:44 +0000)]
Remove an unused private field added r227405 to fix a Clang warning.

llvm-svn: 227415

9 years ago[LPM] Try again to appease powerpc64 in its self host. I've been unable
Chandler Carruth [Thu, 29 Jan 2015 02:34:17 +0000 (02:34 +0000)]
[LPM] Try again to appease powerpc64 in its self host. I've been unable
to get a powerpc64 host so that I can reproduce and test this, but it
only impacts that platform so trying the only other realistic option.

According to Ulrich, who debugged this initially, initial-exec is likely
to be sufficient for our needs and not subject to this bug. Will watch
the build bots to see.

If this doesn't work, I'll be forced to cut a really ugly pthread-based
approach into the primary user (our stack trace printing) as that user
cannot use the ThreadLocal implementation due to lifetime issues.

llvm-svn: 227414

9 years ago[ASan] Generalize/simplify lit test configs generation.
Alexey Samsonov [Thu, 29 Jan 2015 02:28:53 +0000 (02:28 +0000)]
[ASan] Generalize/simplify lit test configs generation.

llvm-svn: 227413

9 years ago[LPM] Fix an "obvious" typo from r227411. Really sorry for the noise.
Chandler Carruth [Thu, 29 Jan 2015 01:29:22 +0000 (01:29 +0000)]
[LPM] Fix an "obvious" typo from r227411. Really sorry for the noise.
Too many cases to compile everything quickly.

llvm-svn: 227412

9 years ago[LPM] Clean up the use of TLS in pretty stack trace and disable it
Chandler Carruth [Thu, 29 Jan 2015 01:23:04 +0000 (01:23 +0000)]
[LPM] Clean up the use of TLS in pretty stack trace and disable it
entirely when threads are not enabled. This should allow anyone who
needs to bootstrap or cope with a host loader without TLS support to
limp along without threading support.

There is still some bug in the PPC TLS stuff that is not worked around.
I'm getting access to a machine to reproduce and debug this further.
There is some chance that I'll have to add a terrible workaround for
PPC.

There is also some problem with iOS, but I have no ability to really
evaluate what the issue is there. I'm leaving it to folks maintaining
that platform to suggest a path forward -- personally I don't see any
useful path forward that supports threading in LLVM but does so without
support for *very basic* TLS. Note that we don't need more than some
pointers, and we don't need constructors, destructors, or any of the
other fanciness which remains widely unimplemented.

llvm-svn: 227411

9 years agoFix MSVC C4060 warning (switch statement contains no case or default).
Rui Ueyama [Thu, 29 Jan 2015 00:56:24 +0000 (00:56 +0000)]
Fix MSVC C4060 warning (switch statement contains no case or default).

llvm-svn: 227410

9 years agoEnsure that -fsyntax-only with fortran 90 passes along silently
Eric Christopher [Thu, 29 Jan 2015 00:56:17 +0000 (00:56 +0000)]
Ensure that -fsyntax-only with fortran 90 passes along silently
to the underlying gcc.
PR22234

Patch by Artem Belevich.

llvm-svn: 227409

9 years agoRemove unused variable
Reid Kleckner [Thu, 29 Jan 2015 00:55:44 +0000 (00:55 +0000)]
Remove unused variable

llvm-svn: 227408

9 years ago[FIX] Correct two C snippets in test cases
Johannes Doerfert [Thu, 29 Jan 2015 00:50:46 +0000 (00:50 +0000)]
[FIX] Correct two C snippets in test cases

llvm-svn: 227407

9 years agoRemove NaClX86_64TargetCodeGenInfo and NaClARMTargetCodeGenInfo
Derek Schuff [Thu, 29 Jan 2015 00:47:04 +0000 (00:47 +0000)]
Remove NaClX86_64TargetCodeGenInfo and NaClARMTargetCodeGenInfo

Summary:
They just existed before to use NaCl's custom ABIInfos; now that those are gone,
the custom TargetCodeGenInfos are no longer needed either.

Test Plan: don't break the existing tests

Reviewers: jvoung

Subscribers: jfb, cfe-commits

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

llvm-svn: 227406

9 years agoAdd a Windows EH preparation pass that zaps resumes
Reid Kleckner [Thu, 29 Jan 2015 00:41:44 +0000 (00:41 +0000)]
Add a Windows EH preparation pass that zaps resumes

If the personality is not a recognized MSVC personality function, this
pass delegates to the dwarf EH preparation pass. This chaining supports
people on *-windows-itanium or *-windows-gnu targets.

Currently this recognizes some personalities used by MSVC and turns
resume instructions into traps to avoid link errors.  Even if cleanups
are not used in the source program, LLVM requires the frontend to emit a
code path that resumes unwinding after an exception.  Clang does this,
and we get unreachable resume instructions. PR20300 covers cleaning up
these unreachable calls to resume.

Reviewers: majnemer

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

llvm-svn: 227405

9 years ago[FIX] Handle pointer-pointer comparisons
Johannes Doerfert [Thu, 29 Jan 2015 00:41:33 +0000 (00:41 +0000)]
[FIX] Handle pointer-pointer comparisons

  This should fix a problem introduced by r225464.

llvm-svn: 227404

9 years agoirgen: don't emit debug metadata for locals
Andrew Wilkins [Thu, 29 Jan 2015 00:34:30 +0000 (00:34 +0000)]
irgen: don't emit debug metadata for locals

Summary:
The debug metadata we generate is wrong, and is
now causing build failures. This revision disables
the only llvm.dbg.declare calls we make.

(There is also a drive-by fix to CMakeLists.txt,
adding in a missing .go dependency.)

Fixes http://llvm.org/bugs/show_bug.cgi?id=22330

Reviewers: pcc

Reviewed By: pcc

Subscribers: dblaikie, llvm-commits

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

llvm-svn: 227403

9 years agoRemove getSubtargetImpl from AArch64ISelLowering and cache the
Eric Christopher [Thu, 29 Jan 2015 00:19:42 +0000 (00:19 +0000)]
Remove getSubtargetImpl from AArch64ISelLowering and cache the
correct subtarget by passing it in during the constructor as
TargetLowering is Subtarget specific.

llvm-svn: 227402

9 years agoRemove getSubtargetImpl from ARMISelLowering and cache the
Eric Christopher [Thu, 29 Jan 2015 00:19:39 +0000 (00:19 +0000)]
Remove getSubtargetImpl from ARMISelLowering and cache the
correct subtarget by passing it in during the constructor as
TargetLowering is Subtarget specific.

llvm-svn: 227401

9 years agoSmall cleanup in ARMFastISel initialization.
Eric Christopher [Thu, 29 Jan 2015 00:19:37 +0000 (00:19 +0000)]
Small cleanup in ARMFastISel initialization.

llvm-svn: 227400

9 years agoMigrate ARM except for TTI, AsmPrinter, and frame lowering
Eric Christopher [Thu, 29 Jan 2015 00:19:33 +0000 (00:19 +0000)]
Migrate ARM except for TTI, AsmPrinter, and frame lowering
away from getSubtargetImpl.

llvm-svn: 227399

9 years agoAdd nullptr checks for TargetSelectionDAGInfo in SelectionDAG.
Manuel Jacob [Wed, 28 Jan 2015 23:50:40 +0000 (23:50 +0000)]
Add nullptr checks for TargetSelectionDAGInfo in SelectionDAG.

TSI is not guaranteed be non-null in SelectionDAG.

llvm-svn: 227397

9 years ago[fuzzer] add option -save_minimized_corpus
Kostya Serebryany [Wed, 28 Jan 2015 23:48:39 +0000 (23:48 +0000)]
[fuzzer] add option -save_minimized_corpus

llvm-svn: 227395

9 years agoFor the --be8 flag, check explicitly for pre-v7 / pre-v6m cores.
Joerg Sonnenberger [Wed, 28 Jan 2015 23:30:39 +0000 (23:30 +0000)]
For the --be8 flag, check explicitly for pre-v7 / pre-v6m cores.
Those used the old Big Endian support on ARM and don't need flags.
Refactor the logic in a separate common function, which also looks at
-march. Add corresponding logic for the Linux toolchain.

llvm-svn: 227393

9 years ago[clang] Use -android environment for all compiler-rt libs.
Dan Albert [Wed, 28 Jan 2015 23:23:36 +0000 (23:23 +0000)]
[clang] Use -android environment for all compiler-rt libs.

Summary:
This was already done for the sanitizers, but it needs to be done for
the profile and builtin libs as well.

Reviewers: srhines, timmurray, eugenis, samsonov

Reviewed By: samsonov

Subscribers: compnerd, cfe-commits

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

llvm-svn: 227392

9 years ago[LPM] Fix the PPC attribute to be spelled 'global-dynamic'. This should
Chandler Carruth [Wed, 28 Jan 2015 23:10:57 +0000 (23:10 +0000)]
[LPM] Fix the PPC attribute to be spelled 'global-dynamic'. This should
let the build bot make finish compiling stage2.

llvm-svn: 227391

9 years agoTeach SplitBlockPredecessors how to handle landingpad blocks.
Philip Reames [Wed, 28 Jan 2015 23:06:47 +0000 (23:06 +0000)]
Teach SplitBlockPredecessors how to handle landingpad blocks.

Patch by: Igor Laevsky <igor@azulsystems.com>

"Currently SplitBlockPredecessors generates incorrect code in case if basic block we are going to split has a landingpad. Also seems like it is fairly common case among it's users to conditionally call either SplitBlockPredecessors or SplitLandingPadPredecessors. Because of this I think it is reasonable to add this condition directly into SplitBlockPredecessors."

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

llvm-svn: 227390

9 years agoAdd lit-style tests for the Fuzzer library
Kostya Serebryany [Wed, 28 Jan 2015 22:49:25 +0000 (22:49 +0000)]
Add lit-style tests for the Fuzzer library

Summary: Add test targets and the lit-style runner.

Test Plan: Run the tests on bot.

Reviewers: samsonov

Reviewed By: samsonov

Subscribers: llvm-commits

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

llvm-svn: 227389

9 years agoNFC. Migrating clang-tools-extra to the cl::HideUnrelatedOptions API.
Chris Bieneman [Wed, 28 Jan 2015 22:45:26 +0000 (22:45 +0000)]
NFC. Migrating clang-tools-extra to the cl::HideUnrelatedOptions API.

llvm-svn: 227388

9 years ago[sanitizer] allow to reset the bb/edge coverage data inside the process while it...
Kostya Serebryany [Wed, 28 Jan 2015 22:39:44 +0000 (22:39 +0000)]
[sanitizer] allow to reset the bb/edge coverage data inside the process while it is running (single-threaded). Also expose the current coverage set to the process.

llvm-svn: 227387

9 years agofix typos; NFC
Sanjay Patel [Wed, 28 Jan 2015 22:37:32 +0000 (22:37 +0000)]
fix typos; NFC

llvm-svn: 227386

9 years agoBuild fix for Visual Studio. NFC.
Chris Bieneman [Wed, 28 Jan 2015 22:25:00 +0000 (22:25 +0000)]
Build fix for Visual Studio. NFC.

llvm-svn: 227385

9 years agoFix for PR22061 by K-ballo
Marshall Clow [Wed, 28 Jan 2015 22:22:35 +0000 (22:22 +0000)]
Fix for PR22061 by K-ballo

llvm-svn: 227384

9 years agoAdd logic to ClangASTType and SBType to discover information about vector types
Enrico Granata [Wed, 28 Jan 2015 22:18:02 +0000 (22:18 +0000)]
Add logic to ClangASTType and SBType to discover information about vector types

llvm-svn: 227383

9 years ago[dsymutil] Gather the DIE tree child->parent relationships.
Frederic Riss [Wed, 28 Jan 2015 22:15:14 +0000 (22:15 +0000)]
[dsymutil] Gather the DIE tree child->parent relationships.

The libDebugInfo DIE parsing doesn't store these relationships, we have to
recompute them. This commit introduces the CompileUnit bookkeeping class to
store this data. It will be expanded with more fields in the future.

No tests as this produces no visible output.

llvm-svn: 227382

9 years agoAdd DWARFUnit::getNumDIEs() and getDIEIndex()
Frederic Riss [Wed, 28 Jan 2015 22:15:07 +0000 (22:15 +0000)]
Add DWARFUnit::getNumDIEs() and getDIEIndex()

Parsed DIEs are stored in a vector and that makes it easy to get their
indices. Having easy access to a DIE's index makes it possible to use
arrays or vectors to efficiently store/access DIE related information.

There's no test for that new functionality (I don't see how to test
it standalone), but it'll be used in a subsequent dsymutil commit.

llvm-svn: 227381

9 years agoFixed the failing test:
Greg Clayton [Wed, 28 Jan 2015 22:08:17 +0000 (22:08 +0000)]
Fixed the failing test:

./dotest.py -A x86_64 -C clang -v -t  -f TestImageListMultiArchitecture.test_image_list_shows_multiple_architectures

The problem was that if the platform wasn't compatible with the current file in the "target create" command, it wasn't finding a platform that was like it used to.

Also, the currently selected platform was being used upload the file _before_ the target was created which was incorrect as "target create a.out" might switch platforms if its architecture doesn't match, so I moved the uploading to happen after the target was created so we use the right platform (the one in the target, not the selected one).

llvm-svn: 227380