141187 Commits

Author SHA1 Message Date
Konstantin Zhuravlyov
8fd8772fcd [AMDGPU] Promote f16/i16 conversions to f32/i32
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287201 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-17 04:00:46 +00:00
Konstantin Zhuravlyov
54556b5c81 [AMDGPU] Expand br_cc for f16
Differential Revision: https://reviews.llvm.org/D26732


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287199 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-17 03:49:01 +00:00
Lang Hames
d47d405978 [Orc] Clang-format the recent RPC update (r286620 and related).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287195 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-17 02:33:47 +00:00
Dehao Chen
3ecb35bc13 Use profile info to adjust loop unroll threshold.
Summary:
For flat loop, even if it is hot, it is not a good idea to unroll in runtime, thus we set a lower partial unroll threshold.
For hot loop, we set a higher unroll threshold and allows expensive tripcount computation to allow more aggressive unrolling.

Reviewers: davidxl, mzolotukhin

Subscribers: sanjoy, mehdi_amini, llvm-commits

Differential Revision: https://reviews.llvm.org/D26527

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287186 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-17 01:17:02 +00:00
Justin Lebar
38b5ba060c [CUDA] Update docs to indicate that clang now supports std::complex in CUDA mode.
The last remaining necessary change was D25403, landed as r287012.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287184 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-17 01:03:42 +00:00
Lang Hames
a0c2c80d79 Remove a stale test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287183 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-17 01:02:52 +00:00
Peter Collingbourne
d17731360a llvm-dis: Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287182 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-17 00:42:08 +00:00
Dylan McKay
b8248feef5 [AVR] Remove some accidentally-commited code that broke the bots
This is a remnant of an on-chip unit testing tool that has since been
moved out-of-tree.

It was accidentally committed in r287162.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287180 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-17 00:09:38 +00:00
Peter Collingbourne
510c1b6ff7 Introduce GlobalSplit pass.
This pass splits globals into elements using inrange annotations on
getelementptr indices.

Differential Revision: https://reviews.llvm.org/D22295

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287178 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 23:40:26 +00:00
Dylan McKay
af4a912223 [AVR] Wrap all methods in the pseudo expansion pass in an anon namespace
The '-fpermissive' compiler flag complains if the template
specializations used in the class are used in a different namespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287176 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 23:06:14 +00:00
Dylan McKay
ca6e81b65f [AVR] Fix basic block naming in ctlz and cttz tests
The branch selector would change the names.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287174 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 22:48:38 +00:00
Dylan McKay
96bd7c7f64 [AVR] Remove unused method from AVRTargetMachine
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287173 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 22:48:30 +00:00
Dylan McKay
08c9ce1ff0 [AVR] Add tests for counting leading/trailing zeros
This adds two test files that verify the 'cttz' and 'ctlz' operations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287172 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 22:38:43 +00:00
Sanjay Patel
09b0be25dc [x86] allow FP-logic ops when one operand is FP and result is FP
We save an inter-register file move this way. If there's any CPU where
the FP logic is slower, we could transform this back to int-logic in 
MachineCombiner.

This helps, but doesn't solve, PR6137:
https://llvm.org/bugs/show_bug.cgi?id=6137

The 'andn' test shows that we're missing a pattern match to
recognize the xor with -1 constant as a 'not' op.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287171 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 22:34:05 +00:00
Ahmed Bougacha
10adab0d54 [AsmParser] Avoid recursing when lexing ';'. NFC.
This should prevent stack overflows in non-optimized builds on
.ll files with lots of consecutive commented-out lines.

Instead of recursing into LexToken(), continue into a 'while (true)'.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287170 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 22:25:05 +00:00
Ahmed Bougacha
03cebfbba9 [CodeGen] Pass references, not pointers, to MMI helpers. NFC.
While there, rename them to follow the coding style.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287169 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 22:25:03 +00:00
Ahmed Bougacha
75fc88218c Revert "Get GlobalISel to build on Linux after r286407"
This reverts commit r286962.

We want to avoid depending on SelectionDAG, and AddLandingPadInfo
lives in CodeGen now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287168 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 22:24:59 +00:00
Ahmed Bougacha
f522e20fe6 [CodeGen] Pull MMI helpers from FunctionLoweringInfo to MMI. NFC.
They're not SelectionDAG- or FunctionLoweringInfo-specific.  They
are, however, specific to building MMI from IR.
We could make them members, but it's nice having MMI be a "simple" data
structure and this logic kept separate.

This also lets us reuse them from GlobalISel.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287167 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 22:24:56 +00:00
Ahmed Bougacha
8d35b78d6a [CodeGen] Cleanup MachineModuleInfo doxygen comments. NFC.
Remove redundant names and only keep header comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287166 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 22:24:53 +00:00
Ahmed Bougacha
cfe7cb0c6b [CodeGen] Sort MMI forward declarations. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287165 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 22:24:46 +00:00
Kevin Enderby
fbd189d3df General clean up of error handling in llvm-objdump to remove its use of report_fatal_error().
No real functional change with this commit.

The problem with report_fatal_error() is it does not include the tool name
and the file name the for which the error message was generated.

Uses of report_fatal_error() were change to report_error() or error()
to get a better error and to make the code smaller and cleaner.

Also changed things like error(errorToErrorCode(SOrErr.takeError())) to
use report_error() with a file name and the llvm::Error (as well as the
ArchitectureName if available) so the error message is printed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287163 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 22:17:38 +00:00
Dylan McKay
d2c33c4ecb [AVR] Add the pseudo instruction expansion pass
Summary:
A lot of the pseudo instructions are required because LLVM assumes that
all integers of the same size as the pointer size are legal. This means
that it will not currently expand 16-bit instructions to their 8-bit
variants because it thinks 16-bit types are legal for the operations.

This also adds all of the CodeGen tests that required the pass to run.

Reviewers: arsenm, kparzysz

Subscribers: wdng, mgorny, modocache, llvm-commits

Differential Revision: https://reviews.llvm.org/D26577

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287162 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 21:58:04 +00:00
Vitaly Buka
9991c32f71 Fix "isn't a prototype" warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287161 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 21:51:39 +00:00
Peter Collingbourne
fb8255283b X86: Simplify X86ISD::Wrapper operand checks. NFCI.
We only ever create TargetConstantPool, TargetJumpTable, TargetExternalSymbol,
TargetGlobalAddress, TargetGlobalTLSAddress, MCSymbol and TargetBlockAddress
nodes as operands of X86ISD::Wrapper nodes, so we can remove one check and
invert the other.

Also update the documentation comment for X86ISD::Wrapper.

Differential Revision: https://reviews.llvm.org/D26731

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287160 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 21:48:59 +00:00
Sanjoy Das
99e15d01ed [ImplicitNullChecks] Do not not handle call MachineInstrs
We don't track callee clobbered registers correctly, so avoid hoisting
across calls.

Note: for this bug to trigger we need a `readonly` call target, since we
already have logic to not hoist across potentially storing instructions
either.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287159 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 21:45:22 +00:00
Peter Collingbourne
34c84f49d8 Bitcode: Introduce initial multi-module reader API.
Implement getLazyBitcodeModule() and parseBitcodeFile() in terms of it.

Differential Revision: https://reviews.llvm.org/D26719

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287156 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 21:44:45 +00:00
Tim Northover
9769d9a0aa ARM: fix CodeGen for 64-bit shifts.
One half of the shifts obviously needed conditional selection based on whether
the shift amount is more than 32-bits, but leaving the other half as the
natural shift isn't acceptable either: it's undefined behaviour to shift a
32-bit value by more than 31.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287149 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 20:54:28 +00:00
Rong Xu
4146fdbd6d Make block placement deterministic
We fail to produce bit-to-bit matching stage2 and stage3 compiler in PGO
bootstrap build. The reason is because LoopBlockSet is of SmallPtrSet type
whose iterating order depends on the pointer value.

This patch fixes this issue by changing to use SmallSetVector.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287148 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 20:50:06 +00:00
Sanjay Patel
2318eb95f5 [InstCombine] replace unreachable with assert and remove unreachable code; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287147 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 20:40:02 +00:00
Matt Arsenault
4fbd908949 AMDGPU: Enable ConstrainCopy DAG mutation
This fixes a probably unintended divergence from the default
scheduler behavior.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287146 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 20:35:23 +00:00
Sanjay Patel
1c3c35ef97 [InstCombine] fix formatting and add FIXMEs to foldOperationIntoSelectOperand(); NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287145 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 20:18:34 +00:00
Geoff Berry
42fcf0e528 [AArch64] Handle vector types in replaceZeroVectorStore.
Summary:
Extend replaceZeroVectorStore to handle more vector type stores,
floating point zero vectors and set alignment more accurately on split
stores.

This is a follow-up change to r286875.

This change fixes PR31038.

Reviewers: MatzeB

Subscribers: mcrosier, aemerson, llvm-commits, rengolin

Differential Revision: https://reviews.llvm.org/D26682

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287142 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 19:35:19 +00:00
Mandeep Singh Grang
23e86b5ddf [LoopVectorize] Fix for non-determinism in codegen
Summary: This patch fixes issues in codegen uncovered due to https://reviews.llvm.org/D26718

Reviewers: mssimpso

Subscribers: llvm-commits, mzolotukhin

Differential Revision: https://reviews.llvm.org/D26727

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287135 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 18:53:17 +00:00
Tom Stellard
ae5ecee3ec AMDGPU/SI: Avoid creating unnecessary copies in the SIFixSGPRCopies pass
Summary:
1. Don't try to copy values to and from the same register class.
2. Replace copies with of registers with immediate values with v_mov/s_mov
   instructions.

The main purpose of this change is to make MachineSink do a better job of
determining when it is beneficial to split a critical edge, since the pass
assumes that copies will become move instructions.

This prevents a regression in uniform-cfg.ll if we enable critical edge
splitting for AMDGPU.

Reviewers: arsenm

Subscribers: arsenm, kzhuravl, llvm-commits

Differential Revision: https://reviews.llvm.org/D23408

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287131 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 18:42:17 +00:00
Eugene Zelenko
76141b4157 [ExecutionEngine] Fix examples build broken in r287126 and other Include What You Use warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287130 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 18:32:58 +00:00
Sanjay Patel
b152eae659 fix comment formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287127 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 18:09:44 +00:00
Eugene Zelenko
337558b55a [ExecutionEngine] Fix some Clang-tidy modernize-use-default, modernize-use-equals-delete and Include What You Use warnings; other minor fixes.
Differential revision: https://reviews.llvm.org/D26729


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287126 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 18:07:33 +00:00
Sanjay Patel
2c72e2a32c [x86] add fake scalar FP logic instructions to ReplaceableInstrs to save some bytes
We can replace "scalar" FP-bitwise-logic with other forms of bitwise-logic instructions. 
Scalar SSE/AVX FP-logic instructions only exist in your imagination and/or the bowels of 
compilers, but logically equivalent int, float, and double variants of bitwise-logic 
instructions are reality in x86, and the float variant may be a shorter instruction 
depending on which flavor (SSE or AVX) of vector ISA you have...so just prefer float all 
the time.

This is a preliminary step towards solving PR6137:
https://llvm.org/bugs/show_bug.cgi?id=6137

Differential Revision:
https://reviews.llvm.org/D26712



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287122 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 17:42:40 +00:00
Lang Hames
2ca233e645 [Orc] Re-enable the RPC unit test disabled in r286917.
This unit test infinite-looped on s390x due to a thread_yield being optimized
out. I've updated the QueueChannel class (where thread_yield was called) to use
a condition variable instead. This should cause the unit test to behave
correctly.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287121 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 17:31:09 +00:00
Reid Kleckner
195a4bc96d [sancov] Name the global containing the main source file name
If the global name doesn't start with __sancov_gen, ASan will insert
unecessary red zones around it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287117 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 16:50:43 +00:00
Daniil Fukalov
9285a58238 test commit, changed tab to spaces, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287116 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 16:41:40 +00:00
Pekka Jaaskelainen
744fcd8986 Add a little endian variant of TCE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287111 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 15:22:23 +00:00
Simon Pilgrim
69cdceea8d [X86] Add integer division test for PR23590
Shows missed opportunity to recognise reduced integer division result size

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287110 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 14:54:34 +00:00
Simon Pilgrim
f1f243fd34 [X86][AVX512] Autoupgrade lossless i32/u32 to f64 conversion intrinsics with generic IR
Both the (V)CVTDQ2PD (i32 to f64) and (V)CVTUDQ2PD (u32 to f64) conversion instructions are lossless and can be safely represented as generic SINT_TO_FP/UINT_TO_FP calls instead of x86 intrinsics without affecting final codegen.

LLVM counterpart to D26686

Differential Revision: https://reviews.llvm.org/D26736

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287108 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 14:48:32 +00:00
Simon Pilgrim
dc01a45559 [X86][AVX512] Added some mask/maskz tests for sitofp/uitofp i32 to f64
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287106 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 14:24:04 +00:00
Simon Pilgrim
e068e255ae [X86] Regenerated integer divide tests to test on 32 and 64 bit targets
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287104 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 14:12:11 +00:00
Simon Pilgrim
44d2a03b0d [X86][SSE] Added PSUBUS from SELECT tests from D25987
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287103 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 13:59:03 +00:00
Simon Dardis
684785870d [mips] Fix unsigned/signed type error
MipsFastISel uses a a class to represent addresses with a signed member
to represent the offset. MipsFastISel::emitStore, emitLoad and computeAddress
all treated the offset as being positive. In cases where the offset was
actually negative and a frame pointer was used, this would cause the constant
synthesis routine to crash as it would generate an unexpected instruction
sequence when frame indexes are replaced.

Reviewers: vkalintiris

Differential Revision: https://reviews.llvm.org/D26192


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287099 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 11:29:07 +00:00
Simon Dardis
bc5962ad36 [mips] not instruction alias
This patch adds the single operand form of the not alias to microMIPS and
MIPS along with additional tests.

This partially resolves PR/30381.

Thanks to Sean Bruno for reporting the issue!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287097 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 11:04:49 +00:00
Pavel Labath
a33f3dffef Remove TimeValue class
Summary:
All uses have been replaced by appropriate std::chrono types, and the class is
now unused.

Reviewers: zturner, mehdi_amini

Subscribers: llvm-commits, mgorny

Differential Revision: https://reviews.llvm.org/D26447

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287094 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 10:46:48 +00:00