platform/upstream/llvm.git
8 years ago[libFuzzer] fix docs build
Kostya Serebryany [Tue, 11 Aug 2015 04:16:37 +0000 (04:16 +0000)]
[libFuzzer] fix docs build

llvm-svn: 244566

8 years agoCOFF: Update README.
Rui Ueyama [Tue, 11 Aug 2015 03:44:51 +0000 (03:44 +0000)]
COFF: Update README.

It's no longer "new" because the old COFF linker has been removed.
Update the introduction accordingly.

llvm-svn: 244565

8 years ago[MSVC Compat] Implement __is_destructible, __is_nothrow_destructible
David Majnemer [Tue, 11 Aug 2015 03:03:28 +0000 (03:03 +0000)]
[MSVC Compat] Implement __is_destructible, __is_nothrow_destructible

Our implementations of these type trait intrinsics simply mapped them to
__has_trivial_destructor.  Instead, flesh these intrinsics out with a
full implementation which matches the standard's description.

llvm-svn: 244564

8 years ago[IR] Verify EH pad predecessors
David Majnemer [Tue, 11 Aug 2015 02:48:30 +0000 (02:48 +0000)]
[IR] Verify EH pad predecessors

Make sure that an EH pad's predecessors are using their unwind edge to
transfer control to the EH pad.

llvm-svn: 244563

8 years agoWebAssembly: add basic floating-point tests
JF Bastien [Tue, 11 Aug 2015 02:45:15 +0000 (02:45 +0000)]
WebAssembly: add basic floating-point tests

Summary: I somehow forgot to add these when I added the basic floating-point opcodes. Also remove ceil/floor/trunc/nearestint for now, and add them only when properly tested.

Subscribers: llvm-commits, sunfish, jfb

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

llvm-svn: 244562

8 years agoMake the analysis reporting test with x86 to fix the hexagon build.
Tyler Nowicki [Tue, 11 Aug 2015 01:54:48 +0000 (01:54 +0000)]
Make the analysis reporting test with x86 to fix the hexagon build.

llvm-svn: 244561

8 years ago[libFuzzer] add the list of trophies to the docs. It is incomplete, additions are...
Kostya Serebryany [Tue, 11 Aug 2015 01:53:45 +0000 (01:53 +0000)]
[libFuzzer] add the list of trophies to the docs. It is incomplete, additions are welcome :)

llvm-svn: 244560

8 years ago[libFuzzer] add -only_ascii flag
Kostya Serebryany [Tue, 11 Aug 2015 01:44:42 +0000 (01:44 +0000)]
[libFuzzer] add -only_ascii flag

llvm-svn: 244559

8 years ago[WinEHPrepare] Add rudimentary support for the new EH instructions
David Majnemer [Tue, 11 Aug 2015 01:15:26 +0000 (01:15 +0000)]
[WinEHPrepare] Add rudimentary support for the new EH instructions

This adds somewhat basic preparation functionality including:
- Formation of funclets via coloring basic blocks.
- Cloning of polychromatic blocks to ensure that funclets have unique
  program counters.
- Demotion of values used between different funclets.
- Some amount of cleanup once we have removed predecessors from basic
  blocks.
- Verification that we are left with a CFG that makes some amount of
  sense.

N.B. Arguments and numbering still need to be done.

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

llvm-svn: 244558

8 years agoExplicitly clear the MI operand list when getInstruction() is called. Call MI.clear...
Cameron Esfahani [Tue, 11 Aug 2015 01:15:07 +0000 (01:15 +0000)]
Explicitly clear the MI operand list when getInstruction() is called.  Call MI.clear() within MCD::OPC_Decode case and inside of translateInstruction() for the X86 target.  Remove now unnecessary MI.clear() from ARMDisassembler.

Summary: Explicitly clear the MI operand list when getInstruction() is called.

Reviewers: hfinkel, t.p.northover, hvarga, kparzysz, jyknight, qcolombet, uweigand

Subscribers: llvm-commits

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

llvm-svn: 244557

8 years agoPrint vectorization analysis when loop hint is specified.
Tyler Nowicki [Tue, 11 Aug 2015 01:10:08 +0000 (01:10 +0000)]
Print vectorization analysis when loop hint is specified.

This patche and a related llvm patch solve the problem of having to explicitly enable analysis when specifying a loop hint pragma to get the diagnostics. Passing AlwasyPrint as the pass name (see below) causes the front-end to print the diagnostic if the user has specified '-Rpass-analysis' without an '=<target-pass>’. Users of loop hints can pass that compiler option without having to specify the pass and they will get diagnostics for only those loops with loop hints.

llvm-svn: 244556

8 years agoPrint vectorization analysis when loop hint is specified.
Tyler Nowicki [Tue, 11 Aug 2015 01:09:15 +0000 (01:09 +0000)]
Print vectorization analysis when loop hint is specified.

This patch and a relatec clang patch solve the problem of having to explicitly enable analysis when specifying a loop hint pragma to get the diagnostics. Passing AlwasyPrint as the pass name (see below) causes the front-end to print the diagnostic if the user has specified '-Rpass-analysis' without an '=<target-pass>’. Users of loop hints can pass that compiler option without having to specify the pass and they will get diagnostics for only those loops with loop hints.

llvm-svn: 244555

8 years agoUpdate the syntax for load instruction in this example.
Nick Lewycky [Tue, 11 Aug 2015 01:05:16 +0000 (01:05 +0000)]
Update the syntax for load instruction in this example.

llvm-svn: 244554

8 years agoMoved LoopVectorizeHints and related functions before LoopVectorizationLegality and...
Tyler Nowicki [Tue, 11 Aug 2015 00:52:54 +0000 (00:52 +0000)]
Moved LoopVectorizeHints and related functions before LoopVectorizationLegality and LoopVectorizationCostModel.

llvm-svn: 244552

8 years agoWebAssembly: simply assert on SNaN and NaNs with payloads
JF Bastien [Tue, 11 Aug 2015 00:49:20 +0000 (00:49 +0000)]
WebAssembly: simply assert on SNaN and NaNs with payloads

Summary: convertToHexString doesn't represent them correctly at this point in time. This is a follow-up to sunfish's suggestion in D11914.

Subscribers: llvm-commits, sunfish, jfb

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

llvm-svn: 244551

8 years agoSimplify processLoop() by moving loop hint verification into Hints::allowVectorization().
Tyler Nowicki [Tue, 11 Aug 2015 00:35:44 +0000 (00:35 +0000)]
Simplify processLoop() by moving loop hint verification into Hints::allowVectorization().

llvm-svn: 244550

8 years ago[cmake] Hoist check for LLD sources up into root CMakeLists.txt
Reid Kleckner [Tue, 11 Aug 2015 00:33:07 +0000 (00:33 +0000)]
[cmake] Hoist check for LLD sources up into root CMakeLists.txt

We will use this for ASan on Windows soon. When the ELF port of LLD
matures, we can add other sanitizer integration tests to make sure they
work with LLD.

llvm-svn: 244549

8 years agoMIR Serialization: Serialize UsedPhysRegMask from the machine register info.
Alex Lorenz [Tue, 11 Aug 2015 00:32:49 +0000 (00:32 +0000)]
MIR Serialization: Serialize UsedPhysRegMask from the machine register info.

This commit serializes the UsedPhysRegMask register mask from the machine
register information class. The mask is serialized as an inverted
'calleeSavedRegisters' mask to keep the output minimal.

This commit also allows the MIR parser to infer this mask from the register
mask operands if the machine function doesn't specify it.

Reviewers: Duncan P. N. Exon Smith
llvm-svn: 244548

8 years ago[modules] Don't suggest deleting the module cache on an error if there is no module...
Richard Smith [Tue, 11 Aug 2015 00:32:42 +0000 (00:32 +0000)]
[modules] Don't suggest deleting the module cache on an error if there is no module cache for this build.

llvm-svn: 244547

8 years ago[sanitizers] Use portable file read/write wrappers on process pipes
Reid Kleckner [Tue, 11 Aug 2015 00:30:22 +0000 (00:30 +0000)]
[sanitizers] Use portable file read/write wrappers on process pipes

This fixes a minor error checking bug around calling
internal_read/write, and makes the code more portable for D11791.

llvm-svn: 244546

8 years agouse range-based for loops; NFCI
Sanjay Patel [Tue, 11 Aug 2015 00:26:05 +0000 (00:26 +0000)]
use range-based for loops; NFCI

llvm-svn: 244545

8 years ago[libFuzzer] don't crash if the condition in a switch has unusual type (e.g. i72)
Kostya Serebryany [Tue, 11 Aug 2015 00:24:39 +0000 (00:24 +0000)]
[libFuzzer] don't crash if the condition in a switch has unusual type (e.g. i72)

llvm-svn: 244544

8 years agoAddress post-commit review from r243378.
Sanjoy Das [Tue, 11 Aug 2015 00:20:24 +0000 (00:20 +0000)]
Address post-commit review from r243378.

This checks that bork_directive occurs exactly twice in the test output.

llvm-svn: 244543

8 years agoadd comment
Derek Schuff [Tue, 11 Aug 2015 00:19:54 +0000 (00:19 +0000)]
add comment

llvm-svn: 244542

8 years agoAdd NaCl to long double/fp128 mangling test
Derek Schuff [Tue, 11 Aug 2015 00:19:53 +0000 (00:19 +0000)]
Add NaCl to long double/fp128 mangling test

Summary:
NaCl is a platform where long double is the same as double.
Its mangling is spelled with "long double" but its ABI lowering is the same
as double.

Reviewers: rnk, chh

Subscribers: jfb, cfe-commits, dschuff

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

llvm-svn: 244541

8 years ago[LAA] Change name from addRuntimeCheck to addRuntimeChecks, NFC
Adam Nemet [Tue, 11 Aug 2015 00:09:37 +0000 (00:09 +0000)]
[LAA] Change name from addRuntimeCheck to addRuntimeChecks, NFC

This was requested by Hal in D11205.

llvm-svn: 244540

8 years ago[modules] Properly diagnose errors in module files for which we have no
Richard Smith [Tue, 11 Aug 2015 00:05:21 +0000 (00:05 +0000)]
[modules] Properly diagnose errors in module files for which we have no
corresponding include location (those specified on the command line).

llvm-svn: 244538

8 years agoFix some tabs.
Richard Smith [Tue, 11 Aug 2015 00:03:28 +0000 (00:03 +0000)]
Fix some tabs.

llvm-svn: 244537

8 years agoMIR Parser: Report an error when a stack object is redefined.
Alex Lorenz [Mon, 10 Aug 2015 23:50:41 +0000 (23:50 +0000)]
MIR Parser: Report an error when a stack object is redefined.

llvm-svn: 244536

8 years agoAdd lduw and lwua aliases for SPARCv9.
Joerg Sonnenberger [Mon, 10 Aug 2015 23:47:22 +0000 (23:47 +0000)]
Add lduw and lwua aliases for SPARCv9.

llvm-svn: 244535

8 years agoMIR Parser: Report an error when a fixed stack object is redefined.
Alex Lorenz [Mon, 10 Aug 2015 23:45:02 +0000 (23:45 +0000)]
MIR Parser: Report an error when a fixed stack object is redefined.

llvm-svn: 244534

8 years ago[Windows] Implement FileExists, ReadFromFile, and FindPathToBinary
Reid Kleckner [Mon, 10 Aug 2015 23:40:27 +0000 (23:40 +0000)]
[Windows] Implement FileExists, ReadFromFile, and FindPathToBinary

Summary: These are needed to talk to llvm-symbolizer on Windows.

Reviewers: samsonov

Subscribers: llvm-commits

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

llvm-svn: 244533

8 years agoLoad/store for float registers from/to alternate space.
Joerg Sonnenberger [Mon, 10 Aug 2015 23:33:17 +0000 (23:33 +0000)]
Load/store for float registers from/to alternate space.

llvm-svn: 244532

8 years agouse range-based for loop; NFCI
Sanjay Patel [Mon, 10 Aug 2015 23:29:41 +0000 (23:29 +0000)]
use range-based for loop; NFCI

llvm-svn: 244531

8 years agoRemove some dead code.
Richard Smith [Mon, 10 Aug 2015 23:26:54 +0000 (23:26 +0000)]
Remove some dead code.

llvm-svn: 244530

8 years agoMIR Serialization: Serialize the liveout register mask machine operands.
Alex Lorenz [Mon, 10 Aug 2015 23:24:42 +0000 (23:24 +0000)]
MIR Serialization: Serialize the liveout register mask machine operands.

llvm-svn: 244529

8 years agofix minsize detection: minsize attribute implies optimizing for size
Sanjay Patel [Mon, 10 Aug 2015 23:07:26 +0000 (23:07 +0000)]
fix minsize detection: minsize attribute implies optimizing for size

llvm-svn: 244528

8 years ago[LoopVer] Remove unused pointer partition argument, NFC.
Adam Nemet [Mon, 10 Aug 2015 23:05:31 +0000 (23:05 +0000)]
[LoopVer] Remove unused pointer partition argument, NFC.

llvm-svn: 244527

8 years agoAppend options for vectorization when pointer checking threshold is exceeded.
Tyler Nowicki [Mon, 10 Aug 2015 23:05:16 +0000 (23:05 +0000)]
Append options for vectorization when pointer checking threshold is exceeded.

Following one of the appended options will allow the loop to be vectorized. We do not include a command line option for modifying the pointer checking threshold because there is no clang-level interface for this currently.

llvm-svn: 244526

8 years agoMove file-local classes to an anonymous namespace. NFC.
Rui Ueyama [Mon, 10 Aug 2015 23:02:57 +0000 (23:02 +0000)]
Move file-local classes to an anonymous namespace. NFC.

llvm-svn: 244525

8 years agoAdd NaCl (a target where long double = double) to long double ABI test
Derek Schuff [Mon, 10 Aug 2015 23:02:37 +0000 (23:02 +0000)]
Add NaCl (a target where long double = double) to long double ABI test

A test was recently (r244468) added to cover long double calling convention
codegen, distinguishing between Android and GNU conventions (where long doubles
are fp128 and x86_fp80, respectively). Native Client is a target where long
doubles are the same as doubles. This change augments the test to cover
that case.

Also rename the test to test/codeGen/X86_64-longdouble.c

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

llvm-svn: 244524

8 years agoExtend late diagnostics to include late test for runtime pointer checks.
Tyler Nowicki [Mon, 10 Aug 2015 23:01:55 +0000 (23:01 +0000)]
Extend late diagnostics to include late test for runtime pointer checks.

This patch moves checking the threshold of runtime pointer checks to the vectorization requirements (late diagnostics) and emits a diagnostic that infroms the user the loop would be vectorized if not for exceeding the pointer-check threshold. Clang will also append the options that can be used to allow vectorization.

llvm-svn: 244523

8 years ago[Windows] Relax test case patterns to allow parameter lists
Reid Kleckner [Mon, 10 Aug 2015 22:43:04 +0000 (22:43 +0000)]
[Windows] Relax test case patterns to allow parameter lists

llvm-symbolizer will print parameter types.  Split out from D11791.

NFC

llvm-svn: 244522

8 years agotest case for poisoning trivial members
Naomi Musgrave [Mon, 10 Aug 2015 22:39:09 +0000 (22:39 +0000)]
test case for poisoning trivial members

Summary:
A virtual base class and derived class should only poison their
respective members upon destruction. In particular, trivial members should
be poisoned directly, non-trivial members should be poisoned by their
respective destructors, and references to non-trivial members should be
poisoned.

Reviewers: eugenis, kcc

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

Test case avoids casting to access members

Run configurations to reflect expected runtime failure on assertions.

Simplified access to internal members.

Updated internal member structure of base.

Revised assert in main to verify successful poisoning after dtor.

Verify address of pointer is poisoned.

Fixed assert err.

Cleaned up test by removing extraneous prints, asserts.

llvm-svn: 244521

8 years agoWebAssembly: print immediates
JF Bastien [Mon, 10 Aug 2015 22:36:48 +0000 (22:36 +0000)]
WebAssembly: print immediates

Summary:
For now output using C99's hexadecimal floating-point representation.

This patch also cleans up how machine operands are printed: instead of special-casing per type of machine instruction, the code now handles operands generically.

Reviewers: sunfish

Subscribers: llvm-commits, jfb

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

llvm-svn: 244520

8 years agoAdd support for the signx instrution alias of SPARCv9.
Joerg Sonnenberger [Mon, 10 Aug 2015 22:32:25 +0000 (22:32 +0000)]
Add support for the signx instrution alias of SPARCv9.

llvm-svn: 244519

8 years agoNFC. Fix some format issues in lib/CodeGen/MachineBasicBlock.cpp.
Cong Hou [Mon, 10 Aug 2015 22:27:10 +0000 (22:27 +0000)]
NFC. Fix some format issues in lib/CodeGen/MachineBasicBlock.cpp.

llvm-svn: 244518

8 years agoMake frontend floating-point commutivity test X86 specific to avoid cost-model relate...
Tyler Nowicki [Mon, 10 Aug 2015 22:17:40 +0000 (22:17 +0000)]
Make frontend floating-point commutivity test X86 specific to avoid cost-model related problems on arm-thumb and hexagon.

llvm-svn: 244517

8 years agocmake: Make CMAKE_BUILD_TYPE check case-insensitive
Justin Bogner [Mon, 10 Aug 2015 21:58:27 +0000 (21:58 +0000)]
cmake: Make CMAKE_BUILD_TYPE check case-insensitive

Juergen pointed out that this variable is treated in a case
insensitive way.

llvm-svn: 244516

8 years agoIf a variable template is inside a context with template arguments that is being...
Nick Lewycky [Mon, 10 Aug 2015 21:54:08 +0000 (21:54 +0000)]
If a variable template is inside a context with template arguments that is being instantiated, and that instantiation fails, fail our instantiation instead of crashing. Errors have already been emitted.

llvm-svn: 244515

8 years agoRevert r244308 since it's introducing test regressions on Linux:
Oleksiy Vyalov [Mon, 10 Aug 2015 21:49:50 +0000 (21:49 +0000)]
Revert r244308 since it's introducing test regressions on Linux:
 - TestLldbGdbServer.py both clang & gcc, i386 and x86_64
 - TestConstVariables.py gcc, i386 and x86_64
 - 112 failures clang, i386

llvm-svn: 244514

8 years agoMachineVerifier: Handle the optional def operand in a PATCHPOINT instruction.
Alex Lorenz [Mon, 10 Aug 2015 21:47:36 +0000 (21:47 +0000)]
MachineVerifier: Handle the optional def operand in a PATCHPOINT instruction.

The PATCHPOINT instructions have a single optional defined register operand,
but the machine verifier can't verify the optional defined register operands.
This commit makes sure that the machine verifier won't report an error when a
PATCHPOINT instruction doesn't have its optional defined register operand.
This change will allow us to enable the machine verifier for the code
generation tests for the patchpoint intrinsics.

Reviewers: Juergen Ributzka
llvm-svn: 244513

8 years ago[llvm-symbolizer] Remove underscores and other C mangling on Windows
Reid Kleckner [Mon, 10 Aug 2015 21:47:11 +0000 (21:47 +0000)]
[llvm-symbolizer] Remove underscores and other C mangling on Windows

Summary:
This makes it so that reports symbolized after the fact with
llvm-symbolizer are more similar to the ones we generate at runtime with
in-process dbghelp.

Reviewers: samsonov

Subscribers: llvm-commits

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

llvm-svn: 244512

8 years agoUpdate for llvm api change.
Rafael Espindola [Mon, 10 Aug 2015 21:30:13 +0000 (21:30 +0000)]
Update for llvm api change.

llvm-svn: 244511

8 years agoDon't iterate over all sections in the ELFFile constructor.
Rafael Espindola [Mon, 10 Aug 2015 21:29:35 +0000 (21:29 +0000)]
Don't iterate over all sections in the ELFFile constructor.

With this we finally have an ELFFile that is O(1) to construct. This is helpful
for programs like lld which have to do their own section walk.

llvm-svn: 244510

8 years agoremove function names from comments; NFC
Sanjay Patel [Mon, 10 Aug 2015 21:28:16 +0000 (21:28 +0000)]
remove function names from comments; NFC

llvm-svn: 244509

8 years agoStackMap: FastISel: Add an appropriate number of immediate operands to the
Alex Lorenz [Mon, 10 Aug 2015 21:27:03 +0000 (21:27 +0000)]
StackMap: FastISel: Add an appropriate number of immediate operands to the
frame setup instruction.

This commit ensures that the stack map lowering code in FastISel adds an
appropriate number of immediate operands to the frame setup instruction.

The previous code added just one immediate operand, which was fine for a target
like AArch64, but on X86 the ADJCALLSTACKDOWN64 instruction needs two explicit
operands. This caused the machine verifier to report an error when the old code
added just one.

Reviewers: Juergen Ributzka

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

llvm-svn: 244508

8 years agoRename improperly named variable. NFC.
Rafael Espindola [Mon, 10 Aug 2015 21:25:44 +0000 (21:25 +0000)]
Rename improperly named variable. NFC.

llvm-svn: 244507

8 years agoRemove non-ascii characters.
Tyler Nowicki [Mon, 10 Aug 2015 21:18:01 +0000 (21:18 +0000)]
Remove non-ascii characters.

llvm-svn: 244506

8 years agoMake fp vectorization test X86 specified to avoid cost-model related problems on...
Tyler Nowicki [Mon, 10 Aug 2015 21:14:38 +0000 (21:14 +0000)]
Make fp vectorization test X86 specified to avoid cost-model related problems on arm-thumb and hexagon.

llvm-svn: 244505

8 years agoAdd a test showing that objdump (and so ObjectFIle) can handle shndx.
Rafael Espindola [Mon, 10 Aug 2015 21:00:15 +0000 (21:00 +0000)]
Add a test showing that objdump (and so ObjectFIle) can handle shndx.

It was already passing, we were just not testing the code.

llvm-svn: 244504

8 years agox86: Emit LAHF/SAHF instead of PUSHF/POPF
JF Bastien [Mon, 10 Aug 2015 20:59:36 +0000 (20:59 +0000)]
x86: Emit LAHF/SAHF instead of PUSHF/POPF

NaCl's sandbox doesn't allow PUSHF/POPF out of security concerns (priviledged emulators have forgotten to mask system bits in the past, and EFLAGS's DF bit is a constant source of hilarity). Commit r220529 fixed PR20376 by saving cmpxchg's flags result using EFLAGS, this commit now generated LAHF/SAHF instead, for all of x86 (not just NaCl) because it leads to an overall performance gain over PUSHF/POPF.

As with the previous patch this code generation is pretty bad because it occurs very later, after register allocation, and in many cases it rematerializes flags which were already available (e.g. already in a register through SETE). Fortunately it's somewhat rare that this code needs to fire.

I did [[ https://github.com/jfbastien/benchmark-x86-flags | a bit of benchmarking ]], the results on an Intel Haswell E5-2690 CPU at 2.9GHz are:

| Time per call (ms)  | Runtime (ms) | Benchmark                      |
| 0.000012514         |      6257    | sete.i386                      |
| 0.000012810         |      6405    | sete.i386-fast                 |
| 0.000010456         |      5228    | sete.x86-64                    |
| 0.000010496         |      5248    | sete.x86-64-fast               |
| 0.000012906         |      6453    | lahf-sahf.i386                 |
| 0.000013236         |      6618    | lahf-sahf.i386-fast            |
| 0.000010580         |      5290    | lahf-sahf.x86-64               |
| 0.000010304         |      5152    | lahf-sahf.x86-64-fast          |
| 0.000028056         |     14028    | pushf-popf.i386                |
| 0.000027160         |     13580    | pushf-popf.i386-fast           |
| 0.000023810         |     11905    | pushf-popf.x86-64              |
| 0.000026468         |     13234    | pushf-popf.x86-64-fast         |

Clearly `PUSHF`/`POPF` are suboptimal. It doesn't really seems to be worth teaching LLVM about individual flags, at least not for this purpose.

Reviewers: rnk, jvoung, t.p.northover

Subscribers: llvm-commits

Differential revision: http://reviews.llvm.org/D6629

llvm-svn: 244503

8 years agoFix test case to work with -Asserts builds.
Chih-Hung Hsieh [Mon, 10 Aug 2015 20:58:54 +0000 (20:58 +0000)]
Fix test case to work with -Asserts builds.

When clang is built with -DLLVM_ENABLE_ASSERTIONS=Off,
it does not create names for IR values.

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

llvm-svn: 244502

8 years ago[CUDA] Add implicit __attribute__((used)) to all __global__ functions.
Artem Belevich [Mon, 10 Aug 2015 20:57:02 +0000 (20:57 +0000)]
[CUDA] Add implicit __attribute__((used)) to all __global__ functions.

This allows emitting kernels that were instantiated from the host code
and which would never be explicitly referenced otherwise.

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

llvm-svn: 244501

8 years agoUse higher level functions in llvm-objdump.
Rafael Espindola [Mon, 10 Aug 2015 20:50:40 +0000 (20:50 +0000)]
Use higher level functions in llvm-objdump.

This matches the rest of llvm-objdump better and isolates it from upcoming
changes to ELFFile.

llvm-svn: 244500

8 years agofix minsize detection: minsize attribute implies optimizing for size
Sanjay Patel [Mon, 10 Aug 2015 20:45:44 +0000 (20:45 +0000)]
fix minsize detection: minsize attribute implies optimizing for size

llvm-svn: 244499

8 years ago[x86, SSE]]add missing tests for load folding with partial register update
Sanjay Patel [Mon, 10 Aug 2015 20:34:34 +0000 (20:34 +0000)]
[x86, SSE]]add missing tests for load folding with partial register update

The minsize case is wrong; that will be fixed in the next commit.

llvm-svn: 244498

8 years ago[CUDA] Added stubs for new attributes used by CUDA headers.
Artem Belevich [Mon, 10 Aug 2015 20:33:56 +0000 (20:33 +0000)]
[CUDA] Added stubs for new attributes used by CUDA headers.

The main purpose is to avoid errors and warnings while parsing CUDA
header files. The attributes are currently unused otherwise.

Differential version: http://reviews.llvm.org/D11690

llvm-svn: 244497

8 years agoDelete getDotSymtabSec.
Rafael Espindola [Mon, 10 Aug 2015 20:25:04 +0000 (20:25 +0000)]
Delete getDotSymtabSec.

Another step in avoiding iterating over all sections in the ELFFile constructor.

llvm-svn: 244496

8 years ago[InstCombine] Move SSE2/AVX2 arithmetic vector shift folding to instcombiner
Simon Pilgrim [Mon, 10 Aug 2015 20:21:15 +0000 (20:21 +0000)]
[InstCombine] Move SSE2/AVX2 arithmetic vector shift folding to instcombiner

As discussed in D11760, this patch moves the (V)PSRA(WD) arithmetic shift-by-constant folding to InstCombine to match the logical shift implementations.

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

llvm-svn: 244495

8 years agoRemoved unused and incorrectly implemented classof() on Optimization Remark base...
Tyler Nowicki [Mon, 10 Aug 2015 20:13:32 +0000 (20:13 +0000)]
Removed unused and incorrectly implemented classof() on Optimization Remark base class.

llvm-svn: 244494

8 years ago[TableGen] NFC improving comments about what the tokenized identifiers will contain.
Colin LeMahieu [Mon, 10 Aug 2015 19:58:06 +0000 (19:58 +0000)]
[TableGen] NFC improving comments about what the tokenized identifiers will contain.

llvm-svn: 244493

8 years agoAppend options for floating-point commutivity when related diagnostics are produced.
Tyler Nowicki [Mon, 10 Aug 2015 19:56:40 +0000 (19:56 +0000)]
Append options for floating-point commutivity when related diagnostics are produced.

With this patch clang appends the command line options that would allow vectorization when floating-point commutativity is required. Specifically those are enabling fast-math or specifying a loop hint.

llvm-svn: 244492

8 years agoFix a few more cases of 'CHECK[^:]*$'. NFCI
Jonathan Roelofs [Mon, 10 Aug 2015 19:56:39 +0000 (19:56 +0000)]
Fix a few more cases of 'CHECK[^:]*$'. NFCI

llvm-svn: 244491

8 years agoFix typo.
Nick Lewycky [Mon, 10 Aug 2015 19:54:11 +0000 (19:54 +0000)]
Fix typo.

llvm-svn: 244490

8 years agoLate evaluation of the fast-math vectorization requirement.
Tyler Nowicki [Mon, 10 Aug 2015 19:51:46 +0000 (19:51 +0000)]
Late evaluation of the fast-math vectorization requirement.

This patch moves the verification of fast-math to just before vectorization is done. This way we can tell clang to append the command line options would that allow floating-point commutativity. Specifically those are enableing fast-math or specifying a loop hint.

llvm-svn: 244489

8 years ago[dllimport] A non-imported class with an imported key can't have a key
Reid Kleckner [Mon, 10 Aug 2015 19:39:01 +0000 (19:39 +0000)]
[dllimport] A non-imported class with an imported key can't have a key

Summary:
The vtable takes its DLL storage class from the class, not the key
function. When they disagree, the vtable won't be exported by the DLL
that defines the key function. The easiest way to ensure that importers
of the class emit their own vtable is to say that the class has no key
function.

Reviewers: hans, majnemer

Subscribers: cfe-commits

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

llvm-svn: 244488

8 years agoFix another case of 'CHECK[^:]*$'. NFCI
Jonathan Roelofs [Mon, 10 Aug 2015 19:22:55 +0000 (19:22 +0000)]
Fix another case of 'CHECK[^:]*$'. NFCI

llvm-svn: 244486

8 years agoModify diagnostic messages to clearly indicate the why interleaving wasn't done.
Tyler Nowicki [Mon, 10 Aug 2015 19:14:16 +0000 (19:14 +0000)]
Modify diagnostic messages to clearly indicate the why interleaving wasn't done.

Sometimes interleaving is not beneficial, as determined by the cost-model and sometimes it is disabled by a loop hint (by the user). This patch modifies the diagnostic messages to make it clear why interleaving wasn't done.

llvm-svn: 244485

8 years ago[Sparc] Implement i64 load/store support for 32-bit sparc.
James Y Knight [Mon, 10 Aug 2015 19:11:39 +0000 (19:11 +0000)]
[Sparc] Implement i64 load/store support for 32-bit sparc.

The LDD/STD instructions can load/store a 64bit quantity from/to
memory to/from a consecutive even/odd pair of (32-bit) registers. They
are part of SparcV8, and also present in SparcV9. (Although deprecated
there, as you can store 64bits in one register).

As recommended on llvmdev in the thread "How to enable use of 64bit
load/store for 32bit architecture" from Apr 2015, I've modeled the
64-bit load/store operations as working on a v2i32 type, rather than
making i64 a legal type, but with few legal operations. The latter
does not (currently) work, as there is much code in llvm which assumes
that if i64 is legal, operations like "add" will actually work on it.

The same assumption does not hold for v2i32 -- for vector types, it is
workable to support only load/store, and expand everything else.

This patch:
- Adds a new register class, IntPair, for even/odd pairs of registers.

- Modifies the list of reserved registers, the stack spilling code,
  and register copying code to support the IntPair register class.

- Adds support in AsmParser. (note that in asm text, you write the
  name of the first register of the pair only. So the parser has to
  morph the single register into the equivalent paired register).

- Adds the new instructions themselves (LDD/STD/LDDA/STDA).

- Hooks up the instructions and registers as a vector type v2i32. Adds
  custom legalizer to transform i64 load/stores into v2i32 load/stores
  and bitcasts, so that the new instructions can actually be
  generated, and marks all operations other than load/store on v2i32
  as needing to be expanded.

- Copies the unfortunate SelectInlineAsm hack from ARMISelDAGToDAG.
  This hack undoes the transformation of i64 operands into two
  arbitrarily-allocated separate i32 registers in
  SelectionDAGBuilder. and instead passes them in a single
  IntPair. (Arbitrarily allocated registers are not useful, asm code
  expects to be receiving a pair, which can be passed to ldd/std.)

Also adds a bunch of test cases covering all the bugs I've added along
the way.

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

llvm-svn: 244484

8 years agorename toELFShdrIter to getSection and move it closer to getSymbol. NFC.
Rafael Espindola [Mon, 10 Aug 2015 19:10:37 +0000 (19:10 +0000)]
rename toELFShdrIter to getSection and move it closer to getSymbol. NFC.

llvm-svn: 244483

8 years agotoELFSymIter and getSymbol are now the same thing. Merge them.
Rafael Espindola [Mon, 10 Aug 2015 19:07:56 +0000 (19:07 +0000)]
toELFSymIter and getSymbol are now the same thing. Merge them.

llvm-svn: 244482

8 years agoFix a bunch of trivial cases of 'CHECK[^:]*$' in the tests. NFCI
Jonathan Roelofs [Mon, 10 Aug 2015 19:01:27 +0000 (19:01 +0000)]
Fix a bunch of trivial cases of 'CHECK[^:]*$' in the tests. NFCI

I looked into adding a warning / error for this to FileCheck, but there doesn't
seem to be a good way to avoid it triggering on the instances of it in RUN lines.

llvm-svn: 244481

8 years agoUse continue to reduce indentation. NFC.
Rafael Espindola [Mon, 10 Aug 2015 18:57:42 +0000 (18:57 +0000)]
Use continue to reduce indentation. NFC.

llvm-svn: 244480

8 years ago[AArch64] Convert a conditional check that will always be true to an assert. NFC.
Chad Rosier [Mon, 10 Aug 2015 18:42:45 +0000 (18:42 +0000)]
[AArch64] Convert a conditional check that will always be true to an assert. NFC.

llvm-svn: 244479

8 years agoCorrect non-existing past participle of split in filename
Michael Kruse [Mon, 10 Aug 2015 18:37:34 +0000 (18:37 +0000)]
Correct non-existing past participle of split in filename

llvm-svn: 244478

8 years agoAdd a test for our handling of shndx.
Rafael Espindola [Mon, 10 Aug 2015 18:28:24 +0000 (18:28 +0000)]
Add a test for our handling of shndx.

It was already working, but missing a test.

llvm-svn: 244477

8 years agoRecommit r244470+ r244471 together, the bot failed between them.
Yaron Keren [Mon, 10 Aug 2015 18:27:51 +0000 (18:27 +0000)]
Recommit r244470+ r244471 together, the bot failed between them.

llvm-svn: 244476

8 years agoFix typo.
Filipe Cabecinhas [Mon, 10 Aug 2015 18:26:29 +0000 (18:26 +0000)]
Fix typo.

llvm-svn: 244475

8 years ago[IndVarSimplify] Make cost estimation in RewriteLoopExitValues smarter
Igor Laevsky [Mon, 10 Aug 2015 18:23:58 +0000 (18:23 +0000)]
[IndVarSimplify] Make cost estimation in RewriteLoopExitValues smarter

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

llvm-svn: 244474

8 years ago[clang-cl] Add support for CL and _CL_ environment variables
David Majnemer [Mon, 10 Aug 2015 18:16:32 +0000 (18:16 +0000)]
[clang-cl] Add support for CL and _CL_ environment variables

cl uses 'CL' and '_CL_' to prepend and append command line options to
the given argument vector.  There is an additional quirk whereby '#' is
transformed into '='.

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

llvm-svn: 244473

8 years agoRevert r244470 and 244471 while looking into it.
Yaron Keren [Mon, 10 Aug 2015 18:14:56 +0000 (18:14 +0000)]
Revert r244470 and 244471 while looking into it.

llvm-svn: 244472

8 years agoSecond part of r244470 (source file was unsaved in editor).
Yaron Keren [Mon, 10 Aug 2015 18:06:01 +0000 (18:06 +0000)]
Second part of r244470 (source file was unsaved in editor).

llvm-svn: 244471

8 years agoReally implement David Blaikie suggestion in full of seperating
Yaron Keren [Mon, 10 Aug 2015 18:03:35 +0000 (18:03 +0000)]
Really implement David Blaikie suggestion in full of seperating
variable initialization from its usage in the push_back making
collapse of the two statements unlikely even without a comment.

llvm-svn: 244470

8 years agoAllow dosep.py to print dotest.py output on success.
Zachary Turner [Mon, 10 Aug 2015 17:46:11 +0000 (17:46 +0000)]
Allow dosep.py to print dotest.py output on success.

Previously all test output was reported by each individual
instance of dotest.py.  After a recent patch, dosep gets dotest
outptu via a pipe, and selectively decides which output to
print.

This breaks certain scripts which rely on having full output
of each dotest instance to do various parsing and/or log-scraping.

While we make no promises about the format of dotest output, it's
easy to restore this to the old behavior for now, although it is
behind a flag.  To re-enable full output, run dosep.py with the -s
option.

Differential Revision: http://reviews.llvm.org/D11816
Reviewed By: Chaoren Lin

llvm-svn: 244469

8 years agoCorrect x86_64 fp128 calling convention
Chih-Hung Hsieh [Mon, 10 Aug 2015 17:33:31 +0000 (17:33 +0000)]
Correct x86_64 fp128 calling convention

These changes are for Android x86_64 targets to be compatible
with current Android g++ and conform to AMD64 ABI.

https://llvm.org/bugs/show_bug.cgi?id=23897
  * Return type of long double (fp128) should be fp128, not x86_fp80.
  * Vararg of long double (fp128) could be in register and overflowed to memory.

https://llvm.org/bugs/show_bug.cgi?id=24111
  * Return value of long double (fp128) _Complex should be in memory like a structure of {fp128,fp128}.

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

llvm-svn: 244468

8 years agoAdd new llvm.loop.unroll.enable metadata for use with "#pragma unroll".
Mark Heffernan [Mon, 10 Aug 2015 17:29:39 +0000 (17:29 +0000)]
Add new llvm.loop.unroll.enable metadata for use with "#pragma unroll".

This change adds the new unroll metadata "llvm.loop.unroll.enable" which directs
the optimizer to unroll a loop fully if the trip count is known at compile time, and
unroll partially if the trip count is not known at compile time. This differs from
"llvm.loop.unroll.full" which explicitly does not unroll a loop if the trip count is not
known at compile time

With this change "#pragma unroll" generates "llvm.loop.unroll.enable" rather than
"llvm.loop.unroll.full" metadata. This changes the semantics of "#pragma unroll" slightly
to mean "unroll aggressively (fully or partially)" rather than "unroll fully or not at all".

The motivating example for this change was some internal code with a loop marked
with "#pragma unroll" which only sometimes had a compile-time trip count depending
on template magic. When the trip count was a compile-time constant, everything works
as expected and the loop is fully unrolled. However, when the trip count was not a
compile-time constant the "#pragma unroll" explicitly disabled unrolling of the loop(!).
Removing "#pragma unroll" caused the loop to be unrolled partially which was desirable
from a performance perspective.

llvm-svn: 244467

8 years agoAdd new llvm.loop.unroll.enable metadata.
Mark Heffernan [Mon, 10 Aug 2015 17:28:08 +0000 (17:28 +0000)]
Add new llvm.loop.unroll.enable metadata.

This change adds the unroll metadata "llvm.loop.unroll.enable" which directs
the optimizer to unroll a loop fully if the trip count is known at compile time, and
unroll partially if the trip count is not known at compile time. This differs from
"llvm.loop.unroll.full" which explicitly does not unroll a loop if the trip count is not
known at compile time.

The "llvm.loop.unroll.enable" is intended to be added for loops annotated with
"#pragma unroll".

llvm-svn: 244466

8 years agoTypo. Move comment closer to relevant code. NFC.
Chad Rosier [Mon, 10 Aug 2015 17:17:19 +0000 (17:17 +0000)]
Typo. Move comment closer to relevant code. NFC.

llvm-svn: 244465

8 years agofix minsize detection: minsize attribute implies optimizing for size
Sanjay Patel [Mon, 10 Aug 2015 17:15:17 +0000 (17:15 +0000)]
fix minsize detection: minsize attribute implies optimizing for size

llvm-svn: 244464