platform/upstream/llvm.git
8 years ago[test] Follow-up for r243119, also add a test case using property methods.
Argyrios Kyrtzidis [Tue, 28 Jul 2015 17:38:51 +0000 (17:38 +0000)]
[test] Follow-up for r243119, also add a test case using property methods.

llvm-svn: 243455

8 years agoMove unit tests to target specific directories.
Chih-Hung Hsieh [Tue, 28 Jul 2015 17:32:49 +0000 (17:32 +0000)]
Move unit tests to target specific directories.

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

llvm-svn: 243454

8 years agoMIR Serialization: Serialize the block address machine operands.
Alex Lorenz [Tue, 28 Jul 2015 17:28:03 +0000 (17:28 +0000)]
MIR Serialization: Serialize the block address machine operands.

llvm-svn: 243453

8 years agoWebAssembly: MCAsmInfo only has one syntax variant for now.
JF Bastien [Tue, 28 Jul 2015 17:23:07 +0000 (17:23 +0000)]
WebAssembly: MCAsmInfo only has one syntax variant for now.

Summary: MCAsmInfo is set up with the default AssemblerDialect, which is zero.

Subscribers: llvm-commits, sunfish, jfb

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

llvm-svn: 243452

8 years agoadd tests to show broken current behavior of minsize attribute
Sanjay Patel [Tue, 28 Jul 2015 17:18:25 +0000 (17:18 +0000)]
add tests to show broken current behavior of minsize attribute

llvm-svn: 243451

8 years agoMIR Parser: Extract the method 'parseGlobalValue'. NFC.
Alex Lorenz [Tue, 28 Jul 2015 17:09:52 +0000 (17:09 +0000)]
MIR Parser: Extract the method 'parseGlobalValue'. NFC.

This commit extracts the code that parses a global value from the method
'parseGlobalAddressOperand' into a new method 'parseGlobalValue', so that this
code can be reused by the method which will parse the block address machine
operands.

llvm-svn: 243450

8 years agoMIR Parser: Move the function 'lexName'. NFC.
Alex Lorenz [Tue, 28 Jul 2015 17:03:40 +0000 (17:03 +0000)]
MIR Parser: Move the function 'lexName'. NFC.

This commit moves the function 'lexName' to the start of the file so it can
be reused by the function which will lex the named LLVM IR block references.

llvm-svn: 243449

8 years agoRemove eNewThreadMessage from FreeBSD process monitor
Ed Maste [Tue, 28 Jul 2015 16:57:36 +0000 (16:57 +0000)]
Remove eNewThreadMessage from FreeBSD process monitor

FreeBSD thread information is updated after stop - we do not use a
message for thread creation.

llvm-svn: 243448

8 years agoMIR Printer: Remove an outdated TODO comment and assertion. NFC.
Alex Lorenz [Tue, 28 Jul 2015 16:56:45 +0000 (16:56 +0000)]
MIR Printer: Remove an outdated TODO comment and assertion. NFC.

This commit removes an outdated TODO comment and a corresponding assertion
which asserts that the mir printer can't the print machine basic blocks that
aren't sequentially numbered.

This comment and assertion were correct when I was working on the patch which
serialized the machine basic blocks, but then I decided to add an 'ID'
attribute to the machine basic block's YAML mapping based on the patch review.
This comment and assertion then became invalid as with the 'ID' attribute we
can serialize the non sequential machine basic blocks and their references
without any problems.

llvm-svn: 243447

8 years agoLet cmake infer source file language by the file extension.
Douglas Katzman [Tue, 28 Jul 2015 16:52:42 +0000 (16:52 +0000)]
Let cmake infer source file language by the file extension.

This applies default compiler flags to .S files, in particular removing
the "-pedantic" option, which is desirable because there is nothing to
reasonably warn about; and the only thing that gcc warns about is that
you allegedly can't correctly invoke GLUE2 in lib/builtins/assembly.h
on platforms for which USER_LABEL_PREFIX is the empty string.

In the gcc bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=33305 that
added the warning, a commenter notes that giving a macro of zero characters
to another macro is not precisely the same as failing to supply an argument,
and "there is a widespread belief in C++ community that such usage is valid".
Unfortunately the only way to silence the warning is to avoid -pedantic.

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

llvm-svn: 243446

8 years agoMIR Parser: Remove redundant parameters. NFC.
Alex Lorenz [Tue, 28 Jul 2015 16:48:37 +0000 (16:48 +0000)]
MIR Parser: Remove redundant parameters. NFC.

This commit removes the redundant parameters from the two methods
'initializeRegisterInfo' and 'initializeFrameInfo'. The removed parameters are
redundant as we are already passing in the 'MachineFunction' to those methods,
and those parameters can be derived from the machine function parameter.

llvm-svn: 243445

8 years agoRename -Wmsvc-include to -Wmicrosoft-include, now that -Wmicrosoft is split up.
Nico Weber [Tue, 28 Jul 2015 16:48:12 +0000 (16:48 +0000)]
Rename -Wmsvc-include to -Wmicrosoft-include, now that -Wmicrosoft is split up.

(Keep -Wmsvc-include around as an alias.)

While here, also replace the one other mention of "MSVC" in diagnostics with
"Microsoft", for consistency.

llvm-svn: 243444

8 years agoAdd -femulated-tls flag to select the emulated TLS model.
Chih-Hung Hsieh [Tue, 28 Jul 2015 16:27:56 +0000 (16:27 +0000)]
Add -femulated-tls flag to select the emulated TLS model.

This will be used for old targets like Android that do not
support ELF TLS models.

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

llvm-svn: 243441

8 years ago[CodeGen] Simplify creation of shuffle masks.
Benjamin Kramer [Tue, 28 Jul 2015 16:25:32 +0000 (16:25 +0000)]
[CodeGen] Simplify creation of shuffle masks.

No functional change intended.

llvm-svn: 243439

8 years agoImplement target independent TLS compatible with glibc's emutls.c.
Chih-Hung Hsieh [Tue, 28 Jul 2015 16:24:05 +0000 (16:24 +0000)]
Implement target independent TLS compatible with glibc's emutls.c.

The 'common' section TLS is not implemented.
Current C/C++ TLS variables are not placed in common section.
DWARF debug info to get the address of TLS variables is not generated yet.

clang and driver changes in http://reviews.llvm.org/D10524

  Added -femulated-tls flag to select the emulated TLS model,
  which will be used for old targets like Android that do not
  support ELF TLS models.

Added TargetLowering::LowerToTLSEmulatedModel as a target-independent
function to convert a SDNode of TLS variable address to a function call
to __emutls_get_address.

Added into lib/Target/*/*ISelLowering.cpp to call LowerToTLSEmulatedModel
for TLSModel::Emulated. Although all targets supporting ELF TLS models are
enhanced, emulated TLS model has been tested only for Android ELF targets.
Modified AsmPrinter.cpp to print the emutls_v.* and emutls_t.* variables for
emulated TLS variables.
Modified DwarfCompileUnit.cpp to skip some DIE for emulated TLS variabls.

TODO: Add proper DIE for emulated TLS variables.
      Added new unit tests with emulated TLS.

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

llvm-svn: 243438

8 years agoSummary:
Martell Malone [Tue, 28 Jul 2015 16:18:17 +0000 (16:18 +0000)]
Summary:
Object: add IMAGE_FILE_MACHINE_ARM64

The official specifications state that the value of IMAGE_FILE_MACHINE_ARM64
is 0xAA64 (as per the Microsoft Portable Executable and Common Object Format
Specification v8.3).

Reviewers: rnk

Subscribers: llvm-commits, compnerd, ruiu

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

llvm-svn: 243434

8 years agoUpdate xcode for r243427
Ed Maste [Tue, 28 Jul 2015 16:11:12 +0000 (16:11 +0000)]
Update xcode for r243427

llvm-svn: 243432

8 years agoGetting rid of old iterator loops
Piotr Padlewski [Tue, 28 Jul 2015 16:10:58 +0000 (16:10 +0000)]
Getting rid of old iterator loops

llvm-svn: 243431

8 years ago[LVI] Cleanup whitespaces. NFC
Bruno Cardoso Lopes [Tue, 28 Jul 2015 15:53:21 +0000 (15:53 +0000)]
[LVI] Cleanup whitespaces. NFC

llvm-svn: 243430

8 years agoDo not force linebreaks when MaxEmptyLinesToKeep is 0.
Manuel Klimek [Tue, 28 Jul 2015 15:50:24 +0000 (15:50 +0000)]
Do not force linebreaks when MaxEmptyLinesToKeep is 0.

Previously we would format
 call(

     p);
as
 call(
     p);
with MaxEmptyLinesToKeep == 0.

Now we format it as:
  call(p);

llvm-svn: 243429

8 years agoRemove two additional files missed in r243427
Ed Maste [Tue, 28 Jul 2015 15:48:38 +0000 (15:48 +0000)]
Remove two additional files missed in r243427

llvm-svn: 243428

8 years agoRemove POSIX thread/process abstraction
Ed Maste [Tue, 28 Jul 2015 15:45:57 +0000 (15:45 +0000)]
Remove POSIX thread/process abstraction

As of r240543 ProcessPOSIX and POSIXThread are used only on FreeBSD, so
just roll them into ProcessFreeBSD and FreeBSDThread.

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

llvm-svn: 243427

8 years agoFix typo from r243418. Should fix the failing `abort_on_error.cc` test.
Kuba Brecka [Tue, 28 Jul 2015 15:43:45 +0000 (15:43 +0000)]
Fix typo from r243418.  Should fix the failing `abort_on_error.cc` test.
See http://reviews.llvm.org/D7203

llvm-svn: 243426

8 years ago[CodeGen] Clean up CGBuiltin a bit.
Benjamin Kramer [Tue, 28 Jul 2015 15:40:11 +0000 (15:40 +0000)]
[CodeGen] Clean up CGBuiltin a bit.

- Use cached LLVM types
- Turn SmallVectors into Arrays/ArrayRef if the size is static
- Use ConstantInt::get's implicit splatting for vector types

No functionality change intended.

llvm-svn: 243425

8 years agofix formatting; NFC
Sanjay Patel [Tue, 28 Jul 2015 15:38:43 +0000 (15:38 +0000)]
fix formatting; NFC

llvm-svn: 243424

8 years agoApplying the Darwin-specific default lit ASAN_OPTIONS to UBSan+ASan tests as
Kuba Brecka [Tue, 28 Jul 2015 15:35:04 +0000 (15:35 +0000)]
Applying the Darwin-specific default lit ASAN_OPTIONS to UBSan+ASan tests as
well. Should fix the test failures after r243418, see review at
http://reviews.llvm.org/D7203.

llvm-svn: 243423

8 years ago[AArch64] Match float round and convert to int instructions.
Geoff Berry [Tue, 28 Jul 2015 15:24:10 +0000 (15:24 +0000)]
[AArch64] Match float round and convert to int instructions.

Summary:
Add patterns for doing floating point round with various rounding modes
followed by conversion to int as a single FCVT* instruction.

Reviewers: t.p.northover, jmolloy

Subscribers: aemerson, rengolin, mcrosier, llvm-commits

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

llvm-svn: 243422

8 years agoFix typo in gdbremote.py
Pavel Labath [Tue, 28 Jul 2015 15:13:23 +0000 (15:13 +0000)]
Fix typo in gdbremote.py

llvm-svn: 243421

8 years agoKeep track of ScopArrayInfo objects that model PHI node storage
Tobias Grosser [Tue, 28 Jul 2015 14:53:44 +0000 (14:53 +0000)]
Keep track of ScopArrayInfo objects that model PHI node storage

Summary:
When translating PHI nodes into memory dependences during code generation we
require two kinds of memory. 'Normal memory' as for all scalar dependences and
'PHI node memory' to store the incoming values of the PHI node. With this
patch we now mark and track these two kinds of memories, which we previously
incorrectly marked as a single memory object.

Being aware of PHI node storage makes code generation easier, as we do not need
to guess what kind of storage a scalar reference requires. This simplifies the
code nicely.

Reviewers: jdoerfert

Subscribers: pollydev, llvm-commits

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

llvm-svn: 243420

8 years agoUse a specified list of languages in cmake project() command.
Douglas Katzman [Tue, 28 Jul 2015 14:43:53 +0000 (14:43 +0000)]
Use a specified list of languages in cmake project() command.

This allows asm files and Cxx files to be compiled with different flags
rather than treating them identically. LLVM itself has no asm files
other than tests, but this setting is inherited by the compiler-rt
project (unless compiled standalone), which does have asm files.

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

llvm-svn: 243419

8 years ago[asan] Set abort_on_error=1 by default on OS X
Kuba Brecka [Tue, 28 Jul 2015 14:34:13 +0000 (14:34 +0000)]
[asan] Set abort_on_error=1 by default on OS X

This sets the default ASan flags to abort_on_error=1 on OS X. For unit tests and lit tests we set ASAN_OPTIONS back to abort_on_error=0 before running the tests (to avoid crashing). I added two tests that intentionally don't respect the default ASAN_OPTIONS to test the behavior of an empty ASAN_OPTIONS (on OS X we should crash, on Linux we should exit()).

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

llvm-svn: 243418

8 years agoRegParmMax must be 0 for AArch64, as the regparm function attribute is not supported...
Kristof Beyls [Tue, 28 Jul 2015 14:23:47 +0000 (14:23 +0000)]
RegParmMax must be 0 for AArch64, as the regparm function attribute is not supported on AArch64.

llvm-svn: 243417

8 years ago[LAA] Add clarifying comments for the checking pointer grouping algorithm. NFC
Silviu Baranga [Tue, 28 Jul 2015 13:44:08 +0000 (13:44 +0000)]
[LAA] Add clarifying comments for the checking pointer grouping algorithm. NFC

llvm-svn: 243416

8 years agoConsolidate a bunch of #ifdef _LIBCPP_NO_EXCEPTIONS .. #endif blocks into a single...
Marshall Clow [Tue, 28 Jul 2015 13:30:47 +0000 (13:30 +0000)]
Consolidate a bunch of #ifdef _LIBCPP_NO_EXCEPTIONS .. #endif blocks into a single template function. NFC

llvm-svn: 243415

8 years agomisc-unused-parameters: Only remove parameters in the main source file.
Daniel Jasper [Tue, 28 Jul 2015 13:19:12 +0000 (13:19 +0000)]
misc-unused-parameters: Only remove parameters in the main source file.
In headers, they might always be pulled in to different TUs, even if
they are declared static or nested in an unnamed namespace.

llvm-svn: 243414

8 years ago[AArch64] Implement __builtin_thread_pointer
Adhemerval Zanella [Tue, 28 Jul 2015 13:10:10 +0000 (13:10 +0000)]
[AArch64] Implement __builtin_thread_pointer

This path add the aarch64 __builtin_thread_pointer support.  It will be
lowered to llvm.aarch64.thread.pointer.

llvm-svn: 243413

8 years agoImplement __builtin_thread_pointer
Adhemerval Zanella [Tue, 28 Jul 2015 13:03:31 +0000 (13:03 +0000)]
Implement __builtin_thread_pointer

This path add the aarch64 lowering of __builtin_thread_pointer.  It uses
the already implemented AArch64ISD::THREAD_POINTER used in TLS generation.

llvm-svn: 243412

8 years agoDo not compile GPU library with sanitizers
Tobias Grosser [Tue, 28 Jul 2015 12:51:23 +0000 (12:51 +0000)]
Do not compile GPU library with sanitizers

llvm-svn: 243411

8 years agoExtend documentation of scalar code generation [NFC]
Tobias Grosser [Tue, 28 Jul 2015 12:12:04 +0000 (12:12 +0000)]
Extend documentation of scalar code generation [NFC]

No functional change intended

--
Reviewers: jdoerfert

Projects: #polly

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

llvm-svn: 243410

8 years ago[X86][AVX512VL] add AVX512VL intrinsics 4 out of 4
Asaf Badouh [Tue, 28 Jul 2015 12:04:40 +0000 (12:04 +0000)]
[X86][AVX512VL] add AVX512VL intrinsics 4 out of 4

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

llvm-svn: 243409

8 years agodocs: update arcanist links
Martell Malone [Tue, 28 Jul 2015 11:43:37 +0000 (11:43 +0000)]
docs: update arcanist links

Summary:
I need a test commit for using arc.
This seems like an appropriate commit to use as a test

We may want to port this commit back to 3.7 also

Subscribers: llvm-commits

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

llvm-svn: 243408

8 years ago[X86][AVX512VL] add AVX512VL intrinsics 3 out of 4
Asaf Badouh [Tue, 28 Jul 2015 11:14:09 +0000 (11:14 +0000)]
[X86][AVX512VL] add AVX512VL intrinsics 3 out of 4

http://reviews.llvm.org/D11526

llvm-svn: 243406

8 years ago[GMR] Teach GlobalsModRef to distinguish an important and safe case of
Chandler Carruth [Tue, 28 Jul 2015 11:11:11 +0000 (11:11 +0000)]
[GMR] Teach GlobalsModRef to distinguish an important and safe case of
no-alias with non-addr-taken globals: they cannot alias a captured
pointer.

If the non-global underlying object would have been a capture were it to
alias the global, we can firmly conclude no-alias. It isn't reasonable
for a transformation to introduce a capture in a way observable by an
alias analysis. Consider, even if it were to temporarily capture one
globals address into another global and then restore the other global
afterward, there would be no way for the load in the alias query to
observe that capture event correctly. If it observes it then the
temporary capturing would have changed the meaning of the program,
making it an invalid transformation. Even instrumentation passes or
a pass which is synthesizing stores to global variables to expose race
conditions in programs could not trigger this unless it queried the
alias analysis infrastructure mid-transform, in which case it seems
reasonable to return results from before the transform started.

See the comments in the change for a more detailed outlining of the
theory here.

This should address the primary performance regression found when the
non-conservatively-correct path of the alias query was disabled.

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

llvm-svn: 243405

8 years agomisc-unused-parameters: Properly handle static class members.
Daniel Jasper [Tue, 28 Jul 2015 10:39:25 +0000 (10:39 +0000)]
misc-unused-parameters: Properly handle static class members.

Not sure why I wrote what I wrote before.

llvm-svn: 243403

8 years ago[X86][AVX512VL] add AVX512VL intrinsics 2 out of 4
Asaf Badouh [Tue, 28 Jul 2015 10:30:56 +0000 (10:30 +0000)]
[X86][AVX512VL] add AVX512VL intrinsics 2 out of 4

http://reviews.llvm.org/D11526

llvm-svn: 243402

8 years agoImproving lli documentation
Renato Golin [Tue, 28 Jul 2015 10:24:11 +0000 (10:24 +0000)]
Improving lli documentation

Too many people hope lli would act as an emulator when it's actually
just a tool to help prototype IR code and test the JIT compiler. This
commit makes that fact explicit in the documentation

It also migrates the old style bold/italic doc tags to the preferred
meta tags (.. option::, :program:, etc).

No errors when generating the documents, visual inspection in the HTML
result doesn't show any major difference, apart from the slight style
change.

llvm-svn: 243401

8 years agoFix warnings detected by -Wpessimizing-move
Pavel Labath [Tue, 28 Jul 2015 09:18:32 +0000 (09:18 +0000)]
Fix warnings detected by -Wpessimizing-move

patch by Eugene Zelenko

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

llvm-svn: 243399

8 years agoUse TargetParser to parse -mhwdiv command line option in Driver.
Alexandros Lamprineas [Tue, 28 Jul 2015 09:08:03 +0000 (09:08 +0000)]
Use TargetParser to parse -mhwdiv command line option in Driver.

Change-Id: I2ebc40f77af75ec6b43ce8364d6d5a1d29988bd6
Phabricator: http://reviews.llvm.org/D11501
llvm-svn: 243398

8 years ago[LLGS] Avoid bogus error message on process termination
Pavel Labath [Tue, 28 Jul 2015 09:06:56 +0000 (09:06 +0000)]
[LLGS] Avoid bogus error message on process termination

Summary:
Handle_k was printing an error when killing a process because KillSpawnedProcess was expecting to
be asynchronously notified of the process death, which no longer works, since we don't wait for
the process on a separate thread. However, the whole usage of KillSpawnedProcess is dubious here,
since it tries to be nice and terminate the process first with SIGTERM, which will not have the
intended effect on a ptraced process. I replace this code with a call to
NativeProcessProtocol::Kill, which does not suffer from these problems.

Reviewers: chaoren, ovyalov

Subscribers: lldb-commits

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

llvm-svn: 243397

8 years ago[X86] Remove mergeSPUpdatesUp()
Michael Kuperstein [Tue, 28 Jul 2015 08:56:13 +0000 (08:56 +0000)]
[X86] Remove mergeSPUpdatesUp()

X86FrameLowering has both a mergeSPUpdates() that accepts a direction, and an
mergeSPUpdatesUp(), which seem to do the same thing, except for a slightly
different interface. Removed the less general function.
NFC.

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

llvm-svn: 243396

8 years ago[X86][SSE] Use bitmasks instead of shuffles where possible.
Simon Pilgrim [Tue, 28 Jul 2015 08:54:41 +0000 (08:54 +0000)]
[X86][SSE] Use bitmasks instead of shuffles where possible.

VPAND is a lot faster than VPSHUFB and VPBLENDVB - this patch ensures we attempt to lower to a basic bitmask before lowering to the slower byte shuffle/blend instructions.

Split off from D11518.

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

llvm-svn: 243395

8 years ago[X86][AVX512VL] add AVX512VL intrinsics 1 out of 4
Asaf Badouh [Tue, 28 Jul 2015 08:26:14 +0000 (08:26 +0000)]
[X86][AVX512VL] add AVX512VL intrinsics 1 out of 4

http://reviews.llvm.org/D11526

llvm-svn: 243394

8 years agoMark async tests as UNSUPPORTED in C++03 because it requires variadics
Eric Fiselier [Tue, 28 Jul 2015 07:49:15 +0000 (07:49 +0000)]
Mark async tests as UNSUPPORTED in C++03 because it requires variadics

llvm-svn: 243393

8 years agoFix a handful of tests that fail in C++03
Eric Fiselier [Tue, 28 Jul 2015 07:31:50 +0000 (07:31 +0000)]
Fix a handful of tests that fail in C++03

llvm-svn: 243392

8 years agoAVX512: Add encoding tests to vptestnm instructions
Igor Breger [Tue, 28 Jul 2015 07:00:00 +0000 (07:00 +0000)]
AVX512: Add encoding tests to vptestnm instructions

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

llvm-svn: 243391

8 years agoAVX512: Implemented encoding and intrinsics for VGETEXPSS/D instructions
Igor Breger [Tue, 28 Jul 2015 06:53:28 +0000 (06:53 +0000)]
AVX512: Implemented encoding and intrinsics for VGETEXPSS/D instructions
Added tests for intrinsics and encoding.

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

llvm-svn: 243390

8 years agoChanges for MachineBasicBlock to use SortedVector for LiveIns.
Puyan Lotfi [Tue, 28 Jul 2015 06:38:41 +0000 (06:38 +0000)]
Changes for MachineBasicBlock to use SortedVector for LiveIns.

llvm-svn: 243389

8 years agoMove the Target way of overriding DAG Scheduler to a target hook
Mehdi Amini [Tue, 28 Jul 2015 06:18:04 +0000 (06:18 +0000)]
Move the Target way of overriding DAG Scheduler to a target hook

Summary:
The previous way of overriding it was relying on calling "setDefault"
on the global registry, which implies global mutable state.

Reviewers: echristo, atrick

Subscribers: llvm-commits

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

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

8 years ago[sema] Fix crash when typo-transforming an expression containing an ObjC super messag...
Argyrios Kyrtzidis [Tue, 28 Jul 2015 06:12:24 +0000 (06:12 +0000)]
[sema] Fix crash when typo-transforming an expression containing an ObjC super message expression.

rdar://21427916

llvm-svn: 243387

8 years agoAdding ADT SortedVector; client patch will follow.
Puyan Lotfi [Tue, 28 Jul 2015 06:04:00 +0000 (06:04 +0000)]
Adding ADT SortedVector; client patch will follow.

llvm-svn: 243386

8 years ago[GMR] Fix a long-standing bug in GlobalsModRef where it failed to clear
Chandler Carruth [Tue, 28 Jul 2015 06:01:57 +0000 (06:01 +0000)]
[GMR] Fix a long-standing bug in GlobalsModRef where it failed to clear
out the per-function modref data structures when functions were deleted
or when globals were deleted.

I don't actually know how the global deletion side of this bug hasn't
been hit before, but for the other it just-so-happens that functions
aren't likely to be deleted in the particular part of the LTO pipeline
where we currently enable GMR, so we got lucky.

With this patch, I can self-host with GMR enabled in the normal pass
pipeline!

I was a bit concerned about the compile-time impact of this chang, which
is part of what motivated my prior string of patches to make the
per-function datastructure very dense and fast to walk. With those
changes in place, I can't measure a significant compile time difference
(the difference is around 0.1% which is *way* below the noise) before
and after this patch when building a linked bitcode for all of Clang.

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

llvm-svn: 243385

8 years ago[UBSan][MIPS] Fix cast-overflow tests for mips big endian
Sagar Thakur [Tue, 28 Jul 2015 05:51:51 +0000 (05:51 +0000)]
[UBSan][MIPS] Fix cast-overflow tests for mips big endian

This fixes the bug https://llvm.org/bugs/show_bug.cgi?id=24152
The float value resides in the first 4 bytes of ValueHandle for both mips and mipsel.

Reviewers: dsanders, samsonov
Subscibers: rsmith, hans, mohit.bhakkad, jaydeep, llvm-commits
Differential: http://reviews.llvm.org/D11448
llvm-svn: 243384

8 years agoSupport escapes and quotes in string and character values.
Ilia K [Tue, 28 Jul 2015 05:43:47 +0000 (05:43 +0000)]
Support escapes and quotes in string and character values.

Summary:
Escape characters in strings and strings containing quotes were not appearing correctly in expression values.

Patch from paulmay@microsoft.com

Reviewers: abidh, ChuckR, paulmaybee

Subscribers: greggm, lldb-commits

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

llvm-svn: 243383

8 years ago[LDist][LVer] Explicitly pass the set of memchecks to LoopVersioning, NFC
Adam Nemet [Tue, 28 Jul 2015 05:01:53 +0000 (05:01 +0000)]
[LDist][LVer] Explicitly pass the set of memchecks to LoopVersioning, NFC

Before the patch, the checks were generated internally in
addRuntimeCheck.  Now, we use the new overloaded version of
addRuntimeCheck that takes the ready-made set of checks as a parameter.

The checks are now generated by the client (LoopDistribution) with the
new RuntimePointerChecking::generateChecks API.

Also the new printChecks API is used to print out the checks for
debugging.

This is to continue the transition over to the new model whereby clients
will get the full set of checks from LAA, filter it and then pass it to
LoopVersioning and in turn to addRuntimeCheck.

llvm-svn: 243382

8 years agoMake local function isWhitespaceExceptNL static instead of in anonymous namespace
Yaron Keren [Tue, 28 Jul 2015 04:54:03 +0000 (04:54 +0000)]
Make local function isWhitespaceExceptNL static instead of in anonymous namespace
per the coding standard. Thanks Craig Tooper for noticing this.

llvm-svn: 243381

8 years agoRemove unnecessary const_casts. NFC
Craig Topper [Tue, 28 Jul 2015 04:28:46 +0000 (04:28 +0000)]
Remove unnecessary const_casts. NFC

llvm-svn: 243380

8 years agoReserve some constant values for the Swift calling convention.
Bob Wilson [Tue, 28 Jul 2015 04:05:45 +0000 (04:05 +0000)]
Reserve some constant values for the Swift calling convention.

Swift has a custom calling convention that also requires some new flags
on arguments and one new attribute on alloca instructions. This patch
does not include the implementation of that calling convention - that
will be provided as part of the open-source release of Swift; this only
reserves the bitcode constant values so that they are not used for
other purposes.

llvm-svn: 243379

8 years agoFileCheck'ify some wc/grep based tests; NFCI.
Sanjoy Das [Tue, 28 Jul 2015 03:50:09 +0000 (03:50 +0000)]
FileCheck'ify some wc/grep based tests; NFCI.

llvm-svn: 243378

8 years agoCOFF: Update README to mention that it now supports 32-bit x86.
Rui Ueyama [Tue, 28 Jul 2015 03:40:58 +0000 (03:40 +0000)]
COFF: Update README to mention that it now supports 32-bit x86.

The linker is now able to link not only LLVM/Clang/LLD for x86 but
even larger programs. I confirmed that it successsfully linked Chrome
for x86. Because the browser is a pretty large program, I think I can
say that the linker is now mostly feature complete. (I'm pretty sure
that there are hidden bugs somewhere, but they shouldn't be significant.)

llvm-svn: 243377

8 years agoFix what looks like accidentally repeated file contents. No behavior change.
Nico Weber [Tue, 28 Jul 2015 03:37:54 +0000 (03:37 +0000)]
Fix what looks like accidentally repeated file contents.  No behavior change.

llvm-svn: 243376

8 years agoCOFF: Do not ignore /merge if /debug is specified.
Rui Ueyama [Tue, 28 Jul 2015 03:24:23 +0000 (03:24 +0000)]
COFF: Do not ignore /merge if /debug is specified.

Previously, we ignore /merge option if /debug is specified
because I thought that was MSVC linker did. This was wrong.
/merge shouldn't be ignored even in debug mode.

llvm-svn: 243375

8 years agoCOFF: /HighEntropyVA is on by default only on 64-bit.
Rui Ueyama [Tue, 28 Jul 2015 03:15:57 +0000 (03:15 +0000)]
COFF: /HighEntropyVA is on by default only on 64-bit.

llvm-svn: 243374

8 years agoCOFF: Add /LargeAddressAware command line option.
Rui Ueyama [Tue, 28 Jul 2015 03:12:00 +0000 (03:12 +0000)]
COFF: Add /LargeAddressAware command line option.

llvm-svn: 243373

8 years agoCOFF: Fix 32-bit delay-import address table.
Rui Ueyama [Tue, 28 Jul 2015 02:54:18 +0000 (02:54 +0000)]
COFF: Fix 32-bit delay-import address table.

The address table entry is 32-bit wide on 32-bit and 64-bit on 64-bit.
Previously, it was 64-bit even on 32-bit.

llvm-svn: 243372

8 years agoSplit -Wmicrosoft into many specific warnings.
Nico Weber [Tue, 28 Jul 2015 02:37:37 +0000 (02:37 +0000)]
Split -Wmicrosoft into many specific warnings.

Also move "pragma comment" warning from -Wmicrosoft to -Wignored-pragmas.

-Wmicrosoft currently covers many different areas, some more useful than
others.  Split it into many targeted flags, so that projects can choose to
enable only a subset of these warnings.  This is also useful for incrementally
fixing and turning on these warnings.

-Wno-microsoft still disables all these warnings, and -Wmicrosoft still enables
them all.  After this change, it's possible to pass `-Wno-microsoft
-Wmicrosoft-unqualified-friend` to only enable -Wmicrosoft-unqualified-friend,
and `-Wmicrosoft -Wno-microsoft-unqualified-friend` to enable all other
Microsoft warnings.

I put all the template-related warnings behind -Wmicrosoft-template; if that
turns out to be too coarse we can make that finer later on. (In practice, I
haven't seen the template-related warnings fire frequently.)

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

llvm-svn: 243371

8 years agoCleanup C++03 __invoke for Bullets 3 and 4.
Eric Fiselier [Tue, 28 Jul 2015 02:15:53 +0000 (02:15 +0000)]
Cleanup C++03 __invoke for Bullets 3 and 4.

The key changes in this patch are:

1. Remove the zero-argument overload in mem_fn. A member function must always
   be invoked with at least one argument, the class instance. The zero-argument
   operator()() in mem_fn would cause mem_fn to fail to compile when because
   the call to '__invoke(pm)' is not well formed.

2. Prevent evaluation of '__apply_cv<Tp, Ret>' when 'Ret' is a function type.
   'Ret' is a function type whenever 'Ret Tp::*' is a pointer to member function.
   Attempting to add cv and ref qualifiers to a function type can cause a hard
   compile error.

3. Remove the dummy overload __invoke(Rp Tp::*). It was present to help work
   around #1. It will be replaced with a different '__invoke' overload that
   represents a bad call to invoke.

After applying this patch the test func.wrap.func.inv/invoke.pass.cpp now
passes.

llvm-svn: 243370

8 years agoThere is no reason why this formatter should not cascade. Make it cascade
Enrico Granata [Tue, 28 Jul 2015 02:13:03 +0000 (02:13 +0000)]
There is no reason why this formatter should not cascade. Make it cascade

llvm-svn: 243369

8 years agoGet C++03 __invoke working for bullet 5 of INVOKE.
Eric Fiselier [Tue, 28 Jul 2015 01:52:08 +0000 (01:52 +0000)]
Get C++03 __invoke working for bullet 5 of INVOKE.

This patch does a couple of things to get __invoke working for free-functions
and call objects.

1. Turn all uses of declval<Tp>() into declval<Tp&>(). The C++03 __invoke only
   supports lvalues but it will be used when the compiler supports rvalue
   references but not variadic templates. This change makes sure we don't
   generate an rvalue.

2. Call objects for bullet 5 are now passed by reference and not value. Copying
   the functor is incorrect. It will fail to compile for non-copyable functors
   and it will discard cv-qualifiers on the call object, possibly leading to the
   wrong function being called. I suspect that the reason the call object
   was originally taken by value was to support temporary call objects.
   However __invoke is only used internally and it is never given a temporary.

llvm-svn: 243368

8 years agoSecond attempt at the fix for the recursion in ValueObjectChild::CanUpdateWithInvalid...
Enrico Granata [Tue, 28 Jul 2015 01:45:23 +0000 (01:45 +0000)]
Second attempt at the fix for the recursion in ValueObjectChild::CanUpdateWithInvalidExecutionContext()

This one should prevent the previous issues, and be the one true fix for rdar://21949558

llvm-svn: 243367

8 years agoChecking more __invoke tests.
Eric Fiselier [Tue, 28 Jul 2015 01:25:36 +0000 (01:25 +0000)]
Checking more __invoke tests.

Before I start trying to fix __invoke in C++03 it needs better test coverage.
This patch adds a large amount of tests for __invoke.

llvm-svn: 243366

8 years ago[libFuzzer] ensure that the dfsan tracing hooks actually run (using -verbosity=3...
Kostya Serebryany [Tue, 28 Jul 2015 01:25:00 +0000 (01:25 +0000)]
[libFuzzer] ensure that the dfsan tracing hooks actually run (using -verbosity=3 in tests)

llvm-svn: 243365

8 years agoCOFF: Skip non-DWARF debug info sections.
Rui Ueyama [Tue, 28 Jul 2015 01:06:58 +0000 (01:06 +0000)]
COFF: Skip non-DWARF debug info sections.

Leaving them in an executable is basically harmless but wastes disk space.
Because no one is using non-DWARF debug info linked by LLD, we can just
remove them.

llvm-svn: 243364

8 years ago[libFuzzer] when using cmp traces, first check that the CMP is evaluated to one value...
Kostya Serebryany [Tue, 28 Jul 2015 00:59:53 +0000 (00:59 +0000)]
[libFuzzer] when using cmp traces, first check that the CMP is evaluated to one value much more frequently than to the other value (heuristic)

llvm-svn: 243363

8 years ago[dfsan/libFuzzer] correctly ignore sanitizer coverage calls in dfsan
Kostya Serebryany [Tue, 28 Jul 2015 00:57:07 +0000 (00:57 +0000)]
[dfsan/libFuzzer] correctly ignore sanitizer coverage calls in dfsan

llvm-svn: 243362

8 years agofix invalid load folding with SSE/AVX FP logical instructions (PR22371)
Sanjay Patel [Tue, 28 Jul 2015 00:48:32 +0000 (00:48 +0000)]
fix invalid load folding with SSE/AVX FP logical instructions (PR22371)

This is a follow-up to the FIXME that was added with D7474 ( http://reviews.llvm.org/rL229531 ).
I thought this load folding bug had been made hard-to-hit, but it turns out to be very easy
when targeting 32-bit x86 and causes a miscompile/crash in Wine:
https://bugs.winehq.org/show_bug.cgi?id=38826
https://llvm.org/bugs/show_bug.cgi?id=22371#c25

The quick fix is to simply remove the scalar FP logical instructions from the load folding table
in X86InstrInfo, but that causes us to miss load folds that should be possible when lowering fabs,
fneg, fcopysign. So the majority of this patch is altering those lowerings to use *vector* FP
logical instructions (because that's all x86 gives us anyway). That lets us do the load folding
legally.

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

llvm-svn: 243361

8 years agoInstrProf: Fix a misuse of the FunctionDecl API when generating coverage
Justin Bogner [Tue, 28 Jul 2015 00:41:51 +0000 (00:41 +0000)]
InstrProf: Fix a misuse of the FunctionDecl API when generating coverage

This was calling FD->hasBody(), meaning "Does the function that this
decl refers to have a body?", rather than
FD->doesThisDeclarationHaveABody(), meaning "Is this decl a
non-deleted definition?".

We might want to consider renaming these APIs :/

llvm-svn: 243360

8 years ago[sanitizer] Fix FreeBSD build of sanitizer_common.
Evgeniy Stepanov [Tue, 28 Jul 2015 00:29:47 +0000 (00:29 +0000)]
[sanitizer] Fix FreeBSD build of sanitizer_common.

Broken in r243051.

llvm-svn: 243359

8 years agoUse SmallDenseMap instead of std::map where we don't care about order of keys.
Rui Ueyama [Tue, 28 Jul 2015 00:17:25 +0000 (00:17 +0000)]
Use SmallDenseMap instead of std::map where we don't care about order of keys.

llvm-svn: 243358

8 years ago[LSR] Move X86 specific test case to X86/
Sanjoy Das [Tue, 28 Jul 2015 00:13:42 +0000 (00:13 +0000)]
[LSR] Move X86 specific test case to X86/

rL243348 added the test case in the wrong directory.

llvm-svn: 243357

8 years ago[opaque pointer type] Avoid using pointee types to retrieve InlineAsm's function...
David Blaikie [Tue, 28 Jul 2015 00:06:38 +0000 (00:06 +0000)]
[opaque pointer type] Avoid using pointee types to retrieve InlineAsm's function type

As a stop-gap, retrieving the InlineAsm's function type was done via the
pointee type of its (pointer) Value type.

Instead, pass down and store the FunctionType in the InlineAsm object.

The only wrinkle with this is the ConstantUniqueMap, which then needs to
ferry the FunctionType down through the InlineAsmKeyType. This could be
done a bit differently if the ConstantInfo trait were broadened a bit to
provide an extension point for access to the TypeClass object from the
ValType objects, so that the ConstantUniqueMap<InlineAsm> would then be
keyed on FunctionTypes instead of PointerTypes that point to
FunctionTypes.

This drops the number of IR tests that don't roundtrip through bitcode*
without calling PointerType::getElementType from 416 to 8 (out of
10733). 3 of those crash when roundtripping at ToT anyway.

* modulo various unavoidable uses of pointer types when validating IR
  (for now) and in the way globals are parsed, unfortunately. These
  cases will either go away (because such validation will no longer be
  necessary or possible when pointee types are opaque), or have to be
  made simultaneously with the removal of pointee types.

llvm-svn: 243356

8 years ago[test] Follow-up for r243343, also add a test case using an enum for designated enum.
Argyrios Kyrtzidis [Tue, 28 Jul 2015 00:01:13 +0000 (00:01 +0000)]
[test] Follow-up for r243343, also add a test case using an enum for designated enum.

llvm-svn: 243355

8 years ago[LAA] Split out a helper to print a collection of memchecks
Adam Nemet [Mon, 27 Jul 2015 23:54:41 +0000 (23:54 +0000)]
[LAA] Split out a helper to print a collection of memchecks

This is effectively an NFC but we can no longer print the index of the
pointer group so instead I print its address.  This still lets us
cross-check the section that list the checks against the section that
list the groups (see how I modified the test).

E.g. before we printed this:

    Run-time memory checks:
    Check 0:
      Comparing group 0:
        %arrayidxC = getelementptr inbounds i16, i16* %c, i64 %store_ind
        %arrayidxC1 = getelementptr inbounds i16, i16* %c, i64 %store_ind_inc
      Against group 1:
        %arrayidxA = getelementptr i16, i16* %a, i64 %ind
        %arrayidxA1 = getelementptr i16, i16* %a, i64 %add
    ...
    Grouped accesses:
      Group 0:
        (Low: %c High: (78 + %c))
          Member: {%c,+,4}<%for.body>
          Member: {(2 + %c),+,4}<%for.body>

Now we print this (changes are underlined):

    Run-time memory checks:
    Check 0:
      Comparing group (0x7f9c6040c320):
                       ~~~~~~~~~~~~~~
        %arrayidxC1 = getelementptr inbounds i16, i16* %c, i64 %store_ind_inc
        %arrayidxC = getelementptr inbounds i16, i16* %c, i64 %store_ind
      Against group (0x7f9c6040c358):
                     ~~~~~~~~~~~~~~
        %arrayidxA1 = getelementptr i16, i16* %a, i64 %add
        %arrayidxA = getelementptr i16, i16* %a, i64 %ind
    ...
    Grouped accesses:
      Group 0x7f9c6040c320:
            ~~~~~~~~~~~~~~
        (Low: %c High: (78 + %c))
          Member: {(2 + %c),+,4}<%for.body>
          Member: {%c,+,4}<%for.body>

llvm-svn: 243354

8 years ago[ARM] Implement -Wa,-mfpu and friends for assemblers
Renato Golin [Mon, 27 Jul 2015 23:44:45 +0000 (23:44 +0000)]
[ARM] Implement -Wa,-mfpu and friends for assemblers

This patch allows Clang to pass on -Wa,-mfpu, -Wa,-mhwdiv and
-Wa,-mcpu to the integrated assembler (via target-features), but
-march is still not being passed, but validated.

In case the command line has both -mxxx and -Wa,-mxxx, we warn
that the naked one will not be used in assembler mode.

llvm-svn: 243353

8 years ago[ARM] Changes to Arch/CPU handling to help with -Wa,-mfpu etc. (nfc)
Renato Golin [Mon, 27 Jul 2015 23:44:42 +0000 (23:44 +0000)]
[ARM] Changes to Arch/CPU handling to help with -Wa,-mfpu etc. (nfc)

To be able to handle -Wa, options in the assembler (ClangAs), we need to
make the handling of options based on the value of the options, not direct
Arguments from the list, since the list is immutable.

No functional change in this patch, but this allows validating of -Wa,-mfpu
and friends in the same way we validate -mfpu and friends, *just* for the
assembler.

llvm-svn: 243352

8 years agofix typo; NFC
Sanjay Patel [Mon, 27 Jul 2015 23:43:09 +0000 (23:43 +0000)]
fix typo; NFC

llvm-svn: 243351

8 years agoCOFF: Write import library symbols to a symbol table.
Rui Ueyama [Mon, 27 Jul 2015 23:40:20 +0000 (23:40 +0000)]
COFF: Write import library symbols to a symbol table.

Previously no __imp_ symbols nor dllimport thunk functions were
written to a symbol table.

llvm-svn: 243350

8 years ago[opaque pointers] Avoid the use of pointee types when parsing inline asm in IR
David Blaikie [Mon, 27 Jul 2015 23:32:19 +0000 (23:32 +0000)]
[opaque pointers] Avoid the use of pointee types when parsing inline asm in IR

When parsing calls to inline asm the pointee type (of the pointer type
representing the value type of the InlineAsm value) was used. To avoid
using it, use the ValID structure to ferry the FunctionType directly
through to the InlineAsm construction.

This is a bit of a workaround - alternatively the inline asm could
explicitly describe the type but that'd be verbose/redundant in the IR
and so long as the inline asm calls directly in the context of a call or
invoke, this should suffice.

llvm-svn: 243349

8 years ago[LSR] Generate and use zero extends
Sanjoy Das [Mon, 27 Jul 2015 23:27:51 +0000 (23:27 +0000)]
[LSR] Generate and use zero extends

Summary:
If a scale or a base register can be rewritten as "Zext({A,+,1})" then
LSR will now consider a formula of that form in its normal cost
computation.

Depends on D9180

Reviewers: qcolombet, atrick

Subscribers: llvm-commits

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

llvm-svn: 243348

8 years ago[TargetTransformInfo][NFCI] Add TargetTransformInfo::isZExtFree.
Sanjoy Das [Mon, 27 Jul 2015 23:27:43 +0000 (23:27 +0000)]
[TargetTransformInfo][NFCI] Add TargetTransformInfo::isZExtFree.

Summary:
This function is not used in this change but will be used in a
subsequent change.

Reviewers: mcrosier, chandlerc

Subscribers: llvm-commits

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

llvm-svn: 243347

8 years agoCOFF: Add REQUIRES arm to tests which use the ARM disassembler.
Rui Ueyama [Mon, 27 Jul 2015 23:27:03 +0000 (23:27 +0000)]
COFF: Add REQUIRES arm to tests which use the ARM disassembler.

llvm-svn: 243346