OSDN Git Service
Matt Arsenault [Tue, 12 Jul 2016 00:08:14 +0000 (00:08 +0000)]
AMDGPU: Fix missing scc def on control flow pseudos
These are all expanded to instructions that include an scc def.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275132
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Mon, 11 Jul 2016 23:56:30 +0000 (23:56 +0000)]
AMDGPU: Enable trackLivenessAfterRegAlloc
This has caught a number of bugs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275131
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Mon, 11 Jul 2016 23:55:01 +0000 (23:55 +0000)]
Do not use bool in C header lto.h, use lto_bool_t instead
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275130
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Mon, 11 Jul 2016 23:35:48 +0000 (23:35 +0000)]
AMDGPU: Remove superfluous string attributes from tests
Also fix v_mac.ll not testing right thing for fneg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275129
91177308-0d34-0410-b5e6-
96231b3b80d8
George Burgess IV [Mon, 11 Jul 2016 23:18:32 +0000 (23:18 +0000)]
Attempt to make buildbots happy.
Woohoo, unused variable warnings in builds without asserts (as a result
of r275122).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275126
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Mon, 11 Jul 2016 23:10:18 +0000 (23:10 +0000)]
Add a libLTO API to query a memory buffer and check if it contains ObjC categories
The linker supports a feature to force load an object from a static
archive if it defines an Objective-C category.
This API supports this feature by looking at every section in the
module to find if a category is defined in the module.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275125
91177308-0d34-0410-b5e6-
96231b3b80d8
George Burgess IV [Mon, 11 Jul 2016 22:59:09 +0000 (22:59 +0000)]
[CFLAA] Simplify CFLGraphBuilder. NFC.
This patch simplifies the graph builder by encoding nodes as {Value,
Dereference Level} pairs. This lets us kill edge types, and allows us to
get rid of hacks in StratifiedSets (like addAttrsBelow/...). This
simplification also allows us to remove InstantiatedRelations and
InstantiatedAttrs.
Patch by Jia Chen.
Differential Revision: http://reviews.llvm.org/D22080
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275122
91177308-0d34-0410-b5e6-
96231b3b80d8
Dehao Chen [Mon, 11 Jul 2016 22:45:24 +0000 (22:45 +0000)]
New pass manager for LICM.
Summary: Port LICM to the new pass manager.
Reviewers: davidxl, silvas
Subscribers: silvas, davide, sanjoy, llvm-commits, mehdi_amini
Differential Revision: http://reviews.llvm.org/D21772
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275118
91177308-0d34-0410-b5e6-
96231b3b80d8
Alina Sbirlea [Mon, 11 Jul 2016 22:34:29 +0000 (22:34 +0000)]
Correct ordering of loads/stores.
Summary:
Aiming to correct the ordering of loads/stores. This patch changes the
insert point for loads to the position of the first load.
It updates the ordering method for loads to insert before, rather than after.
Before this patch the following sequence:
"load a[1], store a[1], store a[0], load a[2]"
Would incorrectly vectorize to "store a[0,1], load a[1,2]".
The correctness check was assuming the insertion point for loads is at
the position of the first load, when in practice it was at the last
load. An alternative fix would have been to invert the correctness check.
The current fix changes insert position but also requires reordering of
instructions before the vectorized load.
Updated testcases to reflect the changes.
Reviewers: tstellarAMD, llvm-commits, jlebar, arsenm
Subscribers: mzolotukhin
Differential Revision: http://reviews.llvm.org/D22071
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275117
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Mon, 11 Jul 2016 22:29:37 +0000 (22:29 +0000)]
ARM: validate immediate branch targets in AsmParser.
Immediate branch targets aren't commonly used, but if they are we should make
sure they can actually be encoded. This means they must be divisible by 2 when
targeting Thumb mode, and by 4 when targeting ARM mode.
Also do a little naming cleanup while I was changing everything around anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275116
91177308-0d34-0410-b5e6-
96231b3b80d8
Nicolai Haehnle [Mon, 11 Jul 2016 21:59:43 +0000 (21:59 +0000)]
AMDGPU: Treat texture gather instructions more like other MIMG instructions
Summary:
Setting MIMG to 0 has a bunch of unexpected side effects, including that
isVMEM returns false which leads to incorrect treatment in the hazard
recognizer. The reason I noticed it is that it also leads to incorrect
treatment in VGPR-to-SGPR copies, which is one cause of the referenced bug.
The only reason why MIMG was set to 0 is to signal the special handling of
dmasks, but that can be checked differently.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96877
Reviewers: arsenm, tstellarAMD
Subscribers: arsenm, kzhuravl, llvm-commits
Differential Revision: http://reviews.llvm.org/D22210
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275113
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Mon, 11 Jul 2016 21:45:26 +0000 (21:45 +0000)]
Refactor the PDB writing to use a builder approach
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275110
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Mon, 11 Jul 2016 21:45:09 +0000 (21:45 +0000)]
[pdb] Add a pdb2yaml option to not dump file headers.
This will be useful once we start adding the ability to dump type
records and symbol records, since it will allow us to generate
mergeable information instead of information that specifies an
entire file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275109
91177308-0d34-0410-b5e6-
96231b3b80d8
Nicolai Haehnle [Mon, 11 Jul 2016 21:44:40 +0000 (21:44 +0000)]
AMDGPU: fix local stack slot allocation bugs
Summary:
The main bug fix here is using the 32-bit encoding of V_ADD_I32 in
materializeFrameBaseRegister and resolveFrameIndex, so that arbitrary
immediates work.
The second part is that we may now require the SegmentWaveByteOffset
even when there are initially no stack objects and VGPR spilling isn't
enabled, for stack slots that are allocated later. This means that some
bits become effectively dead and can be cleaned up.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96602
Tested-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewers: arsenm, tstellarAMD
Subscribers: arsenm, llvm-commits, kzhuravl
Differential Revision: http://reviews.llvm.org/D21551
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275108
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Mon, 11 Jul 2016 21:39:44 +0000 (21:39 +0000)]
[X86] Make some cast costs more precise
Make some AVX and AVX512 cast costs more precise.
Based on part of a patch by Elena Demikhovsky (D15604).
Differential Revision: http://reviews.llvm.org/D22064
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275106
91177308-0d34-0410-b5e6-
96231b3b80d8
Kyle Butt [Mon, 11 Jul 2016 21:37:03 +0000 (21:37 +0000)]
Codegen: Fix comment in BranchFolding.cpp
Blocks to be tail-merged may share more than one successor. Correct the
comment to state that they share a specific successor, SuccBB, rather
than a single successor, which is not true.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275104
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Mon, 11 Jul 2016 21:03:03 +0000 (21:03 +0000)]
[X86] Fix tailcall return address clobber bug.
This bug (llvm.org/PR28124) was introduced by r237977, which refactored
the tail call sequence to be generated in two passes instead of one.
Unfortunately, the stack adjustment produced by the first pass was not
recognized by X86FrameLowering::mergeSPUpdates() in all cases, causing
code such as the following, which clobbers the return address, to be
generated:
popl %edi
popl %edi
pushl %eax
jmp tailcallee # TAILCALL
To fix the problem, the entire stack adjustment is performed in
X86ExpandPseudo::ExpandMI() for tail calls.
Patch by Magnus Lång <margnus1@gmail.com>
Differential Revision: http://reviews.llvm.org/D21325
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275103
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 11 Jul 2016 20:50:39 +0000 (20:50 +0000)]
fix documentation comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275101
91177308-0d34-0410-b5e6-
96231b3b80d8
Alina Sbirlea [Mon, 11 Jul 2016 20:46:17 +0000 (20:46 +0000)]
Add TLI.allowsMisalignedMemoryAccesses to LoadStoreVectorizer
Summary: Extend TTI to access TLI.allowsMisalignedMemoryAccesses(). Check condition when vectorizing load and store chains.
Add additional parameters: AddressSpace, Alignment, Fast.
Reviewers: llvm-commits, jlebar
Subscribers: arsenm, mzolotukhin
Differential Revision: http://reviews.llvm.org/D21935
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275100
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Mon, 11 Jul 2016 20:40:44 +0000 (20:40 +0000)]
[X86] Disable FixupSetCC for CodeGenOpt::None
It is an optimization pass, and should not run at -O0. Especially since Fast RA
will not do the required register coalescing anyway, so it's a loss even from
the optimization standpoint.
This also works around (but doesn't quite fix) PR28489.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275099
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Mon, 11 Jul 2016 18:45:49 +0000 (18:45 +0000)]
[IPRA] Properly compute register usage at call sites.
Differential Revision: http://reviews.llvm.org/D21395
Patch by Vivek Pandya.
PR28144
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275087
91177308-0d34-0410-b5e6-
96231b3b80d8
Zhan Jun Liau [Mon, 11 Jul 2016 18:45:03 +0000 (18:45 +0000)]
[SystemZ] Recognize Load On Condition Immediate (LOCHI/LOGHI) opportunities
Summary: Add support for the z13 instructions LOCHI and LOCGHI which
conditionally load immediate values. Add target instruction info hooks so
that if conversion will allow predication of LHI/LGHI.
Author: RolandF
Reviewers: uweigand
Subscribers: zhanjunl
Commiting on behalf of Roland.
Differential Revision: http://reviews.llvm.org/D22117
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275086
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Mon, 11 Jul 2016 18:21:29 +0000 (18:21 +0000)]
[SCCP] Try to follow the DRY principle, use `OpSt`.
Thanks to Eli Friedman for pointing out in his post-commit review!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275084
91177308-0d34-0410-b5e6-
96231b3b80d8
Jingyue Wu [Mon, 11 Jul 2016 18:13:28 +0000 (18:13 +0000)]
[SLSR] Call getPointerSizeInBits with the correct address space.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275083
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Mon, 11 Jul 2016 18:10:06 +0000 (18:10 +0000)]
[PM/IPO] Port LowerTypeTests to the new PassManager.
There's a little bit of churn in this patch because the initialization
mechanism is now shared between the old and the new PM. Other than
that, it's just a pretty mechanical translation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275082
91177308-0d34-0410-b5e6-
96231b3b80d8
Jacques Pienaar [Mon, 11 Jul 2016 17:58:16 +0000 (17:58 +0000)]
[lanai] Add more tests for assembly of conditional ALU ops
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275081
91177308-0d34-0410-b5e6-
96231b3b80d8
Dehao Chen [Mon, 11 Jul 2016 17:36:02 +0000 (17:36 +0000)]
Fix the assertion failure caused by reviews.llvm.org/D22118
Summary: http://reviews.llvm.org/D22118 uses metadata to store the call count, which makes it possible to have branch weight to have only one elements. Also fix the assertion failure in inliner when checking the instruction type to include "invoke" instruction.
Reviewers: mkuper, dnovillo
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D22228
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275079
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Mon, 11 Jul 2016 17:09:06 +0000 (17:09 +0000)]
[IR] Stop a -Wsign-compare warning from firing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275077
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Mon, 11 Jul 2016 17:00:31 +0000 (17:00 +0000)]
[LowerTypeTests] Don't rely on doInitialization().
In preparation for porting this pass to the new PM (which has no
doInitialization()).
Differential Revision: http://reviews.llvm.org/D22223
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275074
91177308-0d34-0410-b5e6-
96231b3b80d8
Dehao Chen [Mon, 11 Jul 2016 16:48:54 +0000 (16:48 +0000)]
Implement callsite-hotness based inline cost for Sample-based PGO
Summary:
For sample-based PGO, using BFI to calculate callsite count is sometime not accurate. This is because with sampling based approach, if a callsite resides in a hot loop deeply nested in a bunch of cold branches, the callsite's BFI frequency would be inaccurately calculated due to lack of samples in the cold branch.
E.g.
if (A1 && A2 && A3 && ..... && A10) {
for (i=0; i <
100000000; i++) {
callsite();
}
}
Assume that A1 to A100 are all 100% taken, and callsite has 1000 samples and thus is considerred hot. Because the loop's trip count is huge, it's normal that all branches outside the loop has no sample at all. As a result, we can only use static branch probability to derive the the frequency of the loop header. Assuming that static heuristic thinks each branch is 50% taken, then the count calculated from BFI will be 1/(2^10) of the actual value.
In order to get more accurate callsite count, we directly annotate the weight on the call instruction, and directly use it when checking callsite hotness.
Note that this mechanism can also be shared by instrumentation based callsite hotness analysis. The side benefit is that it breaks the dependency from Inliner to BFI as call count is embedded in the IR.
Reviewers: davidxl, eraman, dnovillo
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D22118
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275073
91177308-0d34-0410-b5e6-
96231b3b80d8
Dehao Chen [Mon, 11 Jul 2016 16:40:17 +0000 (16:40 +0000)]
Tune the weight propagation algorithm for sample profile.
Summary: Handle the case when there is only one incoming/outgoing edge for a visited basic block: use the block weight to adjust edge weight even when the edge has been visited before. This can help reduce inaccuracies introduced by incorrect basic block profile, as shown in the updated unittest.
Reviewers: davidxl, dnovillo
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D22180
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275072
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 11 Jul 2016 15:08:37 +0000 (15:08 +0000)]
[x86] make some of the tests 256-bit for testing diversity
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275070
91177308-0d34-0410-b5e6-
96231b3b80d8
Nirav Dave [Mon, 11 Jul 2016 14:32:57 +0000 (14:32 +0000)]
Add missing include from previous commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275069
91177308-0d34-0410-b5e6-
96231b3b80d8
Nirav Dave [Mon, 11 Jul 2016 14:23:53 +0000 (14:23 +0000)]
Fix branch relaxation in 16-bit mode.
Thread through MCSubtargetInfo to relaxInstruction function allowing relaxation
to generate jumps with 16-bit sized immediates in 16-bit mode.
This fixes PR22097.
Reviewers: dwmw2, tstellarAMD, craig.topper, jyknight
Subscribers: jfb, arsenm, jyknight, llvm-commits, dsanders
Differential Revision: http://reviews.llvm.org/D20830
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275068
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 11 Jul 2016 14:17:54 +0000 (14:17 +0000)]
[x86] specify triple to avoid bot failures
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275067
91177308-0d34-0410-b5e6-
96231b3b80d8
Nicolai Haehnle [Mon, 11 Jul 2016 14:11:51 +0000 (14:11 +0000)]
[Sink] Don't move calls to readonly functions across stores
Summary:
Reviewers: hfinkel, majnemer, tstellarAMD, sunfish
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D17279
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275066
91177308-0d34-0410-b5e6-
96231b3b80d8
Nicolai Haehnle [Mon, 11 Jul 2016 14:11:45 +0000 (14:11 +0000)]
AliasAnalysis: unify getModRefInfo(I, CS) semantics with other overloads
This subtle change to getModRefInfo(Instruction, ImmutableCallSite) is to
ensure that the semantics are equal to that of getModRefInfo(CS1, CS2) when
the Instruction is a call-site.
This is now more in line with getModRefInfo generally: it returns Mod when
I modifies a memory location that is accessed (read or written) by CS and
Ref when I reads a memory location that is written by CS.
From a grep of the code, the only uses of this particular getModRefInfo
overload are in MemorySSA and MemCpyOptimizer, and they only care about
where the result is MR_NoModRef or not. Therefore, this change should have
no visible effect.
Separated out from D17279 upon request.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275065
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 11 Jul 2016 14:07:31 +0000 (14:07 +0000)]
[x86] update checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275064
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Mon, 11 Jul 2016 12:49:35 +0000 (12:49 +0000)]
[X86][SSE] Generalise target shuffle combine of shuffles using variable masks
At present the only shuffle with a variable mask we recognise is PSHUFB, which influences if its worth the cost of mask creation/loading of a combined target shuffle with a variable mask. This change sets up the infrastructure to support other shuffles in the future but has no effect yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275059
91177308-0d34-0410-b5e6-
96231b3b80d8
Nirav Dave [Mon, 11 Jul 2016 12:42:14 +0000 (12:42 +0000)]
Provide support for preserving assembly comments
Preserve assembly comments from input in output assembly and flags to
toggle property. This is on by default for inline assembly and off in
llvm-mc.
Parsed comments are emitted immediately before an EOL which generally
places them on the expected line.
Reviewers: rtrieu, dwmw2, rnk, majnemer
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D20020
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275058
91177308-0d34-0410-b5e6-
96231b3b80d8
Artem Tamazov [Mon, 11 Jul 2016 12:07:18 +0000 (12:07 +0000)]
[AMDGPU][llvm-mc] Quickfix for r272748 to enable labels in branch instructions.
Fixes issue mentioned at:
https://github.com/RadeonOpenCompute/LLVM-AMDGPU-Assembler-Extra/issues/13.
Lit tests added.
Differential Revision: http://reviews.llvm.org/D22133
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275054
91177308-0d34-0410-b5e6-
96231b3b80d8
Zlatko Buljan [Mon, 11 Jul 2016 07:41:56 +0000 (07:41 +0000)]
[mips][microMIPS] Implement LDC1, SDC1, LDC2, SDC2, LWC1, SWC1, LWC2 and SWC2 instructions and add CodeGen support
Differential Revision: http://reviews.llvm.org/D18824
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275050
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Mon, 11 Jul 2016 06:08:06 +0000 (06:08 +0000)]
AVX-512: DAG lowering for scalar MIN/MAX commutable ops
DAG lowering was missing for the scalar FMINC, FMAXC nodes.
The nodes are generated only in the "unsafe-fp-math" mode.
Added tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275048
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 11 Jul 2016 05:36:53 +0000 (05:36 +0000)]
[AVX512] Add support for 512-bit ANDN now that all ones build vectors survive long enough to allow the matching.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275046
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 11 Jul 2016 05:36:48 +0000 (05:36 +0000)]
[AVX512] Use vpternlog with an immediate of 0xff to create 512-bit all one vectors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275045
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 11 Jul 2016 05:36:41 +0000 (05:36 +0000)]
[X86] Add the AVX512 SET0 pseudos to foldMemoryOperandImpl since they are marked for CanFoldAsLoad.
I don't really know how to test this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275044
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Mon, 11 Jul 2016 04:51:23 +0000 (04:51 +0000)]
Revert r275027 - Let FuncAttrs infer the 'returned' argument attribute
Reverting r275027 and r275033. These seem to cause miscompiles on the AArch64 buildbot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275042
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Mon, 11 Jul 2016 04:37:53 +0000 (04:37 +0000)]
Allow BasicBlockEdge to be used in DenseMap
Summary: Add a DenseMapInfo specialization for BasicBlockEdge
Reviewers: hfinkel, chandlerc, majnemer
Differential Revision: http://reviews.llvm.org/D22207
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275041
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Mon, 11 Jul 2016 03:37:59 +0000 (03:37 +0000)]
Pointer-comparison folding should look through returned-argument functions
For functions which are known to return a specific argument, pointer-comparison
folding can look through the function calls as part of its analysis.
Differential Revision: http://reviews.llvm.org/D9387
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275039
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Mon, 11 Jul 2016 03:08:49 +0000 (03:08 +0000)]
Teach isDereferenceablePointer to look through returned-argument functions
For functions which are known to return their argument,
isDereferenceableAndAlignedPointer can examine the argument value.
Differential Revision: http://reviews.llvm.org/D9384
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275038
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Mon, 11 Jul 2016 02:48:23 +0000 (02:48 +0000)]
Teach SCEV to look through returned-argument functions
When building SCEVs, if a function is known to return its argument, then we can
build the SCEV using the corresponding argument value.
Differential Revision: http://reviews.llvm.org/D9381
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275037
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Mon, 11 Jul 2016 02:25:14 +0000 (02:25 +0000)]
Teach computeKnownBits to look through returned-argument functions
If a function is known to return one of its arguments, we can use that in order
to compute known bits of the return value.
Differential Revision: http://reviews.llvm.org/D9397
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275036
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Mon, 11 Jul 2016 01:32:20 +0000 (01:32 +0000)]
BasicAA should look through functions with returned arguments
Motivated by the work on the llvm.noalias intrinsic, teach BasicAA to look
through returned-argument functions when answering queries. This is essential
so that we don't loose all other AA information when supplementing with
llvm.noalias.
Differential Revision: http://reviews.llvm.org/D9383
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275035
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Mon, 11 Jul 2016 01:28:42 +0000 (01:28 +0000)]
Add a 'Returned' intrinsic property corresponding to the 'returned' argument attribute
This will be used by the upcoming llvm.noalias intrinsic.
Differential Revision: http://reviews.llvm.org/D22201
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275034
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Mon, 11 Jul 2016 01:14:21 +0000 (01:14 +0000)]
Don't use a SmallSet for returned attribute inference
Suggested post-commit by David Majnemer on IRC (following-up on a pre-commit
review comment).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275033
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Sun, 10 Jul 2016 23:01:32 +0000 (23:01 +0000)]
Add getReturnedArgOperand to Call/InvokeInst, CallSite
In order to make the optimizer smarter about using the 'returned' argument
attribute (generally, but motivated by my llvm.noalias intrinsic work), add a
utility function to Call/InvokeInst, and CallSite, to make it easy to get the
returned call argument (when one exists).
P.S. There is already an unfortunate amount of code duplication between
CallInst and InvokeInst, and this adds to it. We should probably clean that up
separately.
Differential Revision: http://reviews.llvm.org/D22204
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275031
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 10 Jul 2016 22:26:05 +0000 (22:26 +0000)]
[X86][SSE] Relax type assertions for matchVectorShuffleAsInsertPS
Calls to matchVectorShuffleAsInsertPS only need to ensure the inputs are 128-bit vectors. Only lowerVectorShuffleAsInsertPS needs to ensure that they are v4f32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275028
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Sun, 10 Jul 2016 22:02:55 +0000 (22:02 +0000)]
Let FuncAttrs infer the 'returned' argument attribute
A function can have one argument with the 'returned' attribute, indicating that
the associated argument is always the return value of the function. Add
FuncAttrs inference logic.
Differential Revision: http://reviews.llvm.org/D22202
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275027
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Sun, 10 Jul 2016 21:52:39 +0000 (21:52 +0000)]
Update the LangRef description of the 'returned' attribute
The description of the 'returned' attribute says that it is only used when
code-generating the caller. I'd like to make the optimizer smarter about
looking through functions with returned arguments (generally, but motivated by
my llvm.noalias work). As David pointed out in the review of D22202, the
LangRef should be updated to make its expanded uses clearer.
Differential Revision: http://reviews.llvm.org/D22205
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275026
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sun, 10 Jul 2016 21:27:06 +0000 (21:27 +0000)]
[DAG] make isConstantSplatVector() available to the rest of lowering
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275025
91177308-0d34-0410-b5e6-
96231b3b80d8
Jan Vesely [Sun, 10 Jul 2016 21:20:29 +0000 (21:20 +0000)]
AMDGPU/R600: Add implicitarg.ptr intrinsic
Differential Revision: http://reviews.llvm.org/D21622
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275024
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 10 Jul 2016 21:02:47 +0000 (21:02 +0000)]
[X86][SSE] Add support for target shuffle combining to PSHUFLW/PSHUFHW
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275022
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sun, 10 Jul 2016 21:02:16 +0000 (21:02 +0000)]
fix documentation comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275021
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sun, 10 Jul 2016 20:45:14 +0000 (20:45 +0000)]
[x86, SSE, AVX] add tests for icmp+zext (PR28484)
Note the inconsistent vpbroadcast generation for AVX2; another bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275020
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 10 Jul 2016 20:19:56 +0000 (20:19 +0000)]
[X86][SSE] Added tests for combining shuffles to PSHUFLW/PSHUFHW
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275019
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 10 Jul 2016 16:11:53 +0000 (16:11 +0000)]
[Support] Make helper function static. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275017
91177308-0d34-0410-b5e6-
96231b3b80d8
Marcin Koscielnicki [Sun, 10 Jul 2016 14:41:22 +0000 (14:41 +0000)]
[SystemZ] Utilize Test Data Class instructions.
This adds a new SystemZ-specific intrinsic, llvm.s390.tdc.f(32|64|128),
which maps straight to the test data class instructions. A new IR pass
is added to recognize instructions that can be converted to TDC and
perform the necessary replacements.
Differential Revision: http://reviews.llvm.org/D21949
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275016
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sun, 10 Jul 2016 13:05:57 +0000 (13:05 +0000)]
reformat, fix comments/names; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275015
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 10 Jul 2016 11:28:51 +0000 (11:28 +0000)]
Give helper classes/functions internal linkage. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275014
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 10 Jul 2016 10:17:36 +0000 (10:17 +0000)]
[codeview] Drop unused private inheritance.
There is no polymorphism here, and StreamRef already contains a
StreamInterface pointer. Dropping the base class makes StreamRef more
transparent to the compiler, for example it can find unused variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275013
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 10 Jul 2016 05:55:53 +0000 (05:55 +0000)]
[AVX512] Add support for lowering to 512-bit SHUFPS.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275011
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Sun, 10 Jul 2016 05:32:05 +0000 (05:32 +0000)]
[pdb] Sanity check the stream map
Some abstractions in LLVM "know" that they are reading in-bounds,
FixedStreamArray, and provide a simple result. This breaks down if the
stream map is bogus.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275010
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Sun, 10 Jul 2016 03:34:47 +0000 (03:34 +0000)]
[llvm-pdbdump] Propagate errors a little more consistently
PDBFile::getBlockData didn't really return any indication that it
failed. It merely returned an empty buffer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275009
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Sun, 10 Jul 2016 02:43:50 +0000 (02:43 +0000)]
[cmake] Change lli-child-target to use add_llvm_utility instead of add_llvm_executable.
We are currently using add_llvm_utility for executable targets that:
1. Are built by default.
2. Used for testing.
3. Are not installed by default.
Originally, lli-child-target used add_llvm_tool instead of add_llvm_executable
directly. This was changed so that lli-child-target would not be installed. This
was good since this is only used for testing and should never be installed for
users. This also had the unfortunate side effect that one can never turn off the
building of lli-child-target by default, a regression for projects that by
default do not want to compile any LLVM tools beyond tablegen/llvm-config.
This patch changes lli-child-target to use add_llvm_utility. This makes sense
since:
1. lli-child-target matches the semantics of executables created with
add_llvm_utility.
2. We fix the regression since now one can use the flag LLVM_BUILD_UTILS to
eliminate default compilation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275008
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Sun, 10 Jul 2016 02:43:47 +0000 (02:43 +0000)]
[cmake] Create the LLVM_BUILD_UTILS option.
This option is the equivalent option to LLVM_BUILD_TOOLS but for executables
created via add_llvm_utility.
This is a useful tool for improving compile time in situations where LLVM is
used as a library and no testing tools are needed.
It follows the exact same implemention model as LLVM_BUILD_TOOLS.
Since the option is by default set to on, no behavior is changed unless one sets
it from the command line to be false.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275007
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Sun, 10 Jul 2016 00:35:15 +0000 (00:35 +0000)]
[SCCP] Rename undefined -> unknown.
In the solver, isUndefined() does really mean "we don't know the
value yet" rather than "this is an UndefinedValue". Discussed with
Eli Friedman.
Differential Revision: http://reviews.llvm.org/D22192
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275004
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Silva [Sat, 9 Jul 2016 23:08:14 +0000 (23:08 +0000)]
[docs] Fix up a broken link.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275002
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Silva [Sat, 9 Jul 2016 22:56:50 +0000 (22:56 +0000)]
[PM] Port LoopVectorize to the new PM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275000
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Silva [Sat, 9 Jul 2016 22:56:39 +0000 (22:56 +0000)]
Fix up an include guard.
This should have been done as part of the move in r274960.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274999
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Sat, 9 Jul 2016 22:49:35 +0000 (22:49 +0000)]
[SCCP] Remove wrong and misleading vector handling code.
This code was already commented out and it made some weird assumptions,
e.g. using isUndefined() as "this value is UndefValue" instead of
"we haven't computed this value is yet". Thanks to Eli Friedman for
pointing out where I was wrong (and where this code was wrong).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274995
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sat, 9 Jul 2016 21:47:55 +0000 (21:47 +0000)]
[X86][SSE] Add support for target shuffle combining to INSERTPS
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274990
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sat, 9 Jul 2016 21:12:03 +0000 (21:12 +0000)]
[X86][SSE] Use scaleShuffleMask helper. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274988
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sat, 9 Jul 2016 20:55:20 +0000 (20:55 +0000)]
[X86][SSE] Regenerate vector shift tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274987
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Sat, 9 Jul 2016 20:47:48 +0000 (20:47 +0000)]
[COFF, Dwarf] Don't emit DW_AT_location for dllimported entities
There exists no relocation which can describe the address of a
dllimported variable: do not try to describe their location.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274986
91177308-0d34-0410-b5e6-
96231b3b80d8
Jingyue Wu [Sat, 9 Jul 2016 19:13:18 +0000 (19:13 +0000)]
[SLSR] Fix crash on handling 128-bit integers.
ConstantInt::getSExtValue may fail on >64-bit integers. Add checks to call
getSExtValue only on narrow integers.
As a minor aside, simplify slsr-gep.ll to remove unnecessary load instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274982
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sat, 9 Jul 2016 18:52:07 +0000 (18:52 +0000)]
fix documentation comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274981
91177308-0d34-0410-b5e6-
96231b3b80d8
Jacques Pienaar [Sat, 9 Jul 2016 18:26:04 +0000 (18:26 +0000)]
[lanai] Treat .t as optional in assembly parser for RR operands and add predicate operand to ShiftRR
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274980
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Sat, 9 Jul 2016 18:11:15 +0000 (18:11 +0000)]
AMDGPU: Move R600 only pieces into R600 classes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274979
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Sat, 9 Jul 2016 17:18:39 +0000 (17:18 +0000)]
Revert "AMDGPU: Remove unused control flow intrinsic"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274978
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 9 Jul 2016 10:36:36 +0000 (10:36 +0000)]
[ArgPromote] Use function_ref and for-range loops.
No functionality change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274973
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Sat, 9 Jul 2016 08:02:28 +0000 (08:02 +0000)]
AMDGPU: Merge / reorganize tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274972
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Sat, 9 Jul 2016 07:55:03 +0000 (07:55 +0000)]
AMDGPU: Simplify tests with per function subtargets
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274971
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Sat, 9 Jul 2016 07:54:27 +0000 (07:54 +0000)]
AMDGPU: Prune AMDGPUAsmParser in libdeps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274970
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Sat, 9 Jul 2016 07:48:11 +0000 (07:48 +0000)]
AMDGPU: Fix fdiv lowering when f32 denormals supported
Also fix test not actually using function labels.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274969
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 9 Jul 2016 04:38:30 +0000 (04:38 +0000)]
[X86] Remove sse41 extract intrinsics. They are not used by clang and are not implemented by the x86 backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274967
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 9 Jul 2016 04:38:27 +0000 (04:38 +0000)]
[X86] Remove and autoupgrade 512-bit non-temporal store intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274966
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Sat, 9 Jul 2016 03:27:24 +0000 (03:27 +0000)]
[LoopSimplify] Remove a comment which is unlikely to age well.
Chandler pointed out in his review but I forgot to remove before
committing, my bad.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274963
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Sat, 9 Jul 2016 03:25:35 +0000 (03:25 +0000)]
[PM] Port CrossDSOCFI to the new pass manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274962
91177308-0d34-0410-b5e6-
96231b3b80d8
George Burgess IV [Sat, 9 Jul 2016 03:21:25 +0000 (03:21 +0000)]
[CFLAA] Make a constant variable `const`. NFC.
`const` was dropped by r274958, and the lack of `const` makes GCC6
(correctly) complain.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274961
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Silva [Sat, 9 Jul 2016 03:11:29 +0000 (03:11 +0000)]
[PM] Fix a think-o. mv {Scalar,Vectorize}/SLPVectorize.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274960
91177308-0d34-0410-b5e6-
96231b3b80d8