platform/upstream/llvm.git
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

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

llvm-svn: 244463

8 years agoProtect template argument from user interference.
Joerg Sonnenberger [Mon, 10 Aug 2015 16:58:04 +0000 (16:58 +0000)]
Protect template argument from user interference.

llvm-svn: 244462

8 years agoFully apply David Blaikie suggestion and add comment explaining why.
Yaron Keren [Mon, 10 Aug 2015 16:53:30 +0000 (16:53 +0000)]
Fully apply David Blaikie suggestion and add comment explaining why.

llvm-svn: 244461

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

llvm-svn: 244460

8 years agoMake StmtSet a list.
Johannes Doerfert [Mon, 10 Aug 2015 16:47:20 +0000 (16:47 +0000)]
Make StmtSet a list.

  With a deque (or any other sequential container) it is not sound to
  take the address of the elements when the container is still under
  construction. With a pointer based container this is save.

llvm-svn: 244459

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

llvm-svn: 244458

8 years agoAdd missing include guard to FuzzerInternal.h, NFC.
Yaron Keren [Mon, 10 Aug 2015 16:37:40 +0000 (16:37 +0000)]
Add missing include guard to FuzzerInternal.h, NFC.

llvm-svn: 244457

8 years agoAdd test case with PHI node in exit block
Michael Kruse [Mon, 10 Aug 2015 16:17:59 +0000 (16:17 +0000)]
Add test case with PHI node in exit block

The PHI node with multiple incoming edges from inside the region.

Thanks Tobias for coming up with the example.

llvm-svn: 244456

8 years agoModify r244405 to clearer code, per David Blaikie suggestion.
Yaron Keren [Mon, 10 Aug 2015 16:15:51 +0000 (16:15 +0000)]
Modify r244405 to clearer code, per David Blaikie suggestion.

llvm-svn: 244455

8 years agomisc-unused-parameters: Don't touch K&R style functions.
Daniel Jasper [Mon, 10 Aug 2015 15:45:46 +0000 (15:45 +0000)]
misc-unused-parameters: Don't touch K&R style functions.

We couldn't calculate the removal ranges properly at this point.

llvm-svn: 244454

8 years ago-Wdeprecated: Use noexcept rather than throw() where supported
David Blaikie [Mon, 10 Aug 2015 15:24:22 +0000 (15:24 +0000)]
-Wdeprecated: Use noexcept rather than throw() where supported

Summary: I've copy/pasted the LLVM_NOEXCEPT definition macro goo from LLVM's Compiler.h. Is there somewhere I should put this in Compiler RT? Is there a useful header to define/share things like this?

Reviewers: samsonov

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

llvm-svn: 244453

8 years agoSilence a sign mismatch warning; NFC.
Aaron Ballman [Mon, 10 Aug 2015 15:22:39 +0000 (15:22 +0000)]
Silence a sign mismatch warning; NFC.

llvm-svn: 244452

8 years agoDon't depend on getDotSymtabSec. It is going away.
Rafael Espindola [Mon, 10 Aug 2015 15:12:17 +0000 (15:12 +0000)]
Don't depend on getDotSymtabSec. It is going away.

llvm-svn: 244451

8 years agoRemove leftover comment
Michael Kruse [Mon, 10 Aug 2015 15:07:16 +0000 (15:07 +0000)]
Remove leftover comment

The function to which this commit applies has been removed in a
previous commit.

llvm-svn: 244450

8 years ago[TTI] Add a hook for specifying per-target defaults for Interleaved Accesses
Silviu Baranga [Mon, 10 Aug 2015 14:50:54 +0000 (14:50 +0000)]
[TTI] Add a hook for specifying per-target defaults for Interleaved Accesses

Summary:
This adds a hook to TTI which enables us to selectively turn on by default
interleaved access vectorization for targets on which we have have performed
the required benchmarking.

Reviewers: rengolin

Subscribers: rengolin, llvm-commits

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

llvm-svn: 244449

8 years agoPrevent the scalarizer from caching incorrect entries
Fraser Cormack [Mon, 10 Aug 2015 14:48:47 +0000 (14:48 +0000)]
Prevent the scalarizer from caching incorrect entries

The scalarizer can cache incorrect entries when walking up a chain of
insertelement instructions. This occurs when it encounters more than one
instruction that it is not actively searching for, as it unconditionally caches
every element it finds. The fix is to only cache the first element that it
isn't searching for so we don't overwrite correct entries.

Reviewers: hfinkel

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

llvm-svn: 244448

8 years agoelf2yaml: Use existing section walk to find the symbol table. NFC.
Rafael Espindola [Mon, 10 Aug 2015 14:27:50 +0000 (14:27 +0000)]
elf2yaml: Use existing section walk to find the symbol table. NFC.

llvm-svn: 244447

8 years agoAdd WebKit brace style configuration option.
Roman Kashitsyn [Mon, 10 Aug 2015 13:43:19 +0000 (13:43 +0000)]
Add WebKit brace style configuration option.

Summary:
Add brace style `BS_WebKit` as described on https://www.webkit.org/coding/coding-style.html:

* Function definitions: place each brace on its own line.
* Other braces: place the open brace on the line preceding the code block; place the close brace on its own line.

Set brace style used in `getWebKitStyle()` to the newly added `BS_WebKit`.

Reviewers: djasper, klimek

Subscribers: klimek, cfe-commits

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

llvm-svn: 244446

8 years ago[RegionInfo] Fix typo
Michael Kruse [Mon, 10 Aug 2015 13:26:09 +0000 (13:26 +0000)]
[RegionInfo] Fix typo

llvm-svn: 244445

8 years ago[RegionInfo] Add debug-time region viewer functions
Michael Kruse [Mon, 10 Aug 2015 13:21:59 +0000 (13:21 +0000)]
[RegionInfo] Add debug-time region viewer functions

Summary:
Analogously to Function::viewCFG(), RegionInfo::view() and RegionInfo::viewOnly() are meant to be called in debugging sessions. They open a viewer to show how RegionInfo currently understands the region hierarchy.

The functions viewRegion(Function*) and viewRegionOnly(Function*) invoke a fresh region analysis of the function in contrast to viewRegion(RegionInfo*) and viewRegionOnly(RegionInfo*) which show the current analysis result.

Reviewers: grosser

Subscribers: llvm-commits

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

llvm-svn: 244444

8 years ago[Polly] Refactor buildScop
Michael Kruse [Mon, 10 Aug 2015 13:01:57 +0000 (13:01 +0000)]
[Polly] Refactor buildScop

Summary: The extracted function buildBBScopStmt will be needed later to be invoked individually on the region's exit block.

Reviewers: grosser, jdoerfert

Subscribers: jdoerfert, llvm-commits, pollydev

Projects: #polly

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

llvm-svn: 244443

8 years ago[RegionInfo] Use RegionInfo* instead of RegionInfoPass* as graph type
Michael Kruse [Mon, 10 Aug 2015 12:57:23 +0000 (12:57 +0000)]
[RegionInfo] Use RegionInfo* instead of RegionInfoPass* as graph type

This allows printing region graphs when only the RegionInfo (e.g. Region::getRegionInfo()), but no RegionInfoPass object is available.

Specifically, we will use this to print RegionInfo graphs in the debugger.

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

Reviewed-by: grosser
llvm-svn: 244442

8 years ago[RegionInfo] Update old-style comments
Michael Kruse [Mon, 10 Aug 2015 12:40:41 +0000 (12:40 +0000)]
[RegionInfo] Update old-style comments

Authorized-by: grosser
llvm-svn: 244441

8 years ago[RegionInfo] More descriptive error messages in verifier
Michael Kruse [Mon, 10 Aug 2015 12:28:52 +0000 (12:28 +0000)]
[RegionInfo] More descriptive error messages in verifier

llvm-svn: 244440

8 years agoTrace copies when checking for rematerializability in spill weight calculation
Robert Lougher [Mon, 10 Aug 2015 11:59:44 +0000 (11:59 +0000)]
Trace copies when checking for rematerializability in spill weight calculation

PR24139 contains an analysis of poor register allocation. One of the findings
was that when calculating the spill weight, a rematerializable interval once
split is no longer rematerializable. This is because the isRematerializable
check in CalcSpillWeights.cpp does not follow the copies introduced by live
range splitting (after splitting, the live interval register definition is a
copy which is not rematerializable).

Reviewers: qcolombet

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

llvm-svn: 244439

8 years agoTest commit to verify commit access
Marina Yatsina [Mon, 10 Aug 2015 11:33:10 +0000 (11:33 +0000)]
Test commit to verify commit access

llvm-svn: 244438

8 years ago[Driver] Fix handling of -fbuiltin/-fcommon when combined with -mkernel
John Brawn [Mon, 10 Aug 2015 11:11:28 +0000 (11:11 +0000)]
[Driver] Fix handling of -fbuiltin/-fcommon when combined with -mkernel

-mkernel enables -fno-builtin and -fno-common by default, but allows -fbuiltin
and -fcommon to override that. However "-fbuiltin -fno-builtin" is treated the
same as "-fbuiltin" which is wrong, so fix that. Also fixes similar behaviour
when -fno-common is default.

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

llvm-svn: 244437

8 years agoFeedback from Jim: Change the "optimized code" warning to be entirely
Jason Molenda [Mon, 10 Aug 2015 07:55:25 +0000 (07:55 +0000)]
Feedback from Jim: Change the "optimized code" warning to be entirely
contained within Process so that we won't be duplicating the warning
message if other parts of the code want to issue the message.  Change
Process::PrintWarning to be a protected method - the public method
will be the PrintWarningOptimization et al.  Also, Have
Thread::FunctionOptimizationWarning shortcut out if the warnings
have been disabled so that we don't (potentially) compute parts of
the SymbolContext unnecessarily.

llvm-svn: 244436

8 years ago[Static Analyzer] Warn when inner and outer conditions are identical. The inner condi...
Daniel Marjamaki [Mon, 10 Aug 2015 07:18:29 +0000 (07:18 +0000)]
[Static Analyzer] Warn when inner and outer conditions are identical. The inner condition is always true.

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

llvm-svn: 244435

8 years agoRangify for loop, NFC.
Yaron Keren [Mon, 10 Aug 2015 07:04:29 +0000 (07:04 +0000)]
Rangify for loop, NFC.

llvm-svn: 244434

8 years ago[tests] Remove calls to grep
Filipe Cabecinhas [Mon, 10 Aug 2015 07:01:11 +0000 (07:01 +0000)]
[tests] Remove calls to grep

llvm-svn: 244433

8 years agoReformat headers in ADT and Support partially.
NAKAMURA Takumi [Mon, 10 Aug 2015 04:22:36 +0000 (04:22 +0000)]
Reformat headers in ADT and Support partially.

Note, I didn't reformat entirely, but partially where I touched in previous commits.

llvm-svn: 244432

8 years agoWhitespace.
NAKAMURA Takumi [Mon, 10 Aug 2015 04:22:09 +0000 (04:22 +0000)]
Whitespace.

llvm-svn: 244431

8 years agoReformat linebreaks.
NAKAMURA Takumi [Mon, 10 Aug 2015 04:21:43 +0000 (04:21 +0000)]
Reformat linebreaks.

llvm-svn: 244430

8 years agollvm/include/llvm/Support/Memory.h: Fix comment header.
NAKAMURA Takumi [Mon, 10 Aug 2015 04:21:19 +0000 (04:21 +0000)]
llvm/include/llvm/Support/Memory.h: Fix comment header.

llvm-svn: 244429

8 years ago[MSVC] Crash fix: assigning of overloaded member function pointer caused assertion
Alexey Bataev [Mon, 10 Aug 2015 04:07:49 +0000 (04:07 +0000)]
[MSVC] Crash fix: assigning of overloaded member function pointer caused assertion

Original class was not marked with inheritance attribute and it causes a crash on codegen.
Differential Revision: http://reviews.llvm.org/D11828

llvm-svn: 244428

8 years agoclang/test/Modules: Satisfy win32 hosts due to dospath issue.
NAKAMURA Takumi [Sun, 9 Aug 2015 22:55:50 +0000 (22:55 +0000)]
clang/test/Modules: Satisfy win32 hosts due to dospath issue.

llvm-svn: 244427

8 years ago[TableGen] Make StringInit constructor take a StringRef instead of const std::string...
Craig Topper [Sun, 9 Aug 2015 22:03:04 +0000 (22:03 +0000)]
[TableGen] Make StringInit constructor take a StringRef instead of const std::string&. NFC.

llvm-svn: 244426

8 years agoCOFF: Define symbols for MSVC 2015 Control Flow Protection.
Rui Ueyama [Sun, 9 Aug 2015 21:01:06 +0000 (21:01 +0000)]
COFF: Define symbols for MSVC 2015 Control Flow Protection.

MSVC 2015's load configuration object (__load_config_used) contains
references to these symbols. I don't fully understand how it works,
but looks like these symbols are linker-defined ones. So I define them
here in the Driver. With this patch, LLD can self-host with MSVC 2015.

This patch is to link MSVC 2015-produced object files. It does not
implement Control Flow Protection. If I understand correctly, the
linker has to create a bitmap of function entry point addresses for
the CFG runtime. We don't do that yet. Produced executables will not
be protected by CFG.

llvm-svn: 244425

8 years agoCOFF: Do not fall through if /lib is processed.
Rui Ueyama [Sun, 9 Aug 2015 20:45:17 +0000 (20:45 +0000)]
COFF: Do not fall through if /lib is processed.

llvm-svn: 244424

8 years agoX86: remove a dead store (NFC)
Saleem Abdulrasool [Sun, 9 Aug 2015 20:39:09 +0000 (20:39 +0000)]
X86: remove a dead store (NFC)

The SP was always unconditionally assigned to later, but initialised early.
This delays the initialisation, and avoids the dead store.  Identified by
clang static analysis.  No functional change intended.

llvm-svn: 244423

8 years agoRemove unused `using`.
Rui Ueyama [Sun, 9 Aug 2015 20:38:58 +0000 (20:38 +0000)]
Remove unused `using`.

llvm-svn: 244422