summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2015-04-23Unbreak buildHEADmasterKrzysztof Parzyszek1-1/+1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235646 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-23[Hexagon] Minor cleanup in HexagonFrameLoweringKrzysztof Parzyszek1-6/+2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235645 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-23R600/SI: Fix indirect addressing with a negative constant offsetTom Stellard2-16/+127
When the base register index of the vector plus the constant offset was less than zero, we were passing the wrong base register to the indirect addressing instruction. In this case, we need to set the base register to v0 and then add the computed (negative) index to m0. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235641 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-23Thumb2: When applying branch optimizations, visit branches in reverse order.Peter Collingbourne2-2/+61
The order in which branches appear in ImmBranches is approximately their order within the function body. By visiting later branches first, we reduce the distance between earlier forward branches and their targets, making it more likely that the cbn?z optimization, which can only apply to forward branches, will succeed for those earlier branches. Differential Revision: http://reviews.llvm.org/D9185 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235640 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-23ARM: When re-creating a branch via InsertBranch, preserve CPSR flags.Peter Collingbourne3-5/+6
In particular, this preserves the kill flag, which allows the Thumb2 cbn?z optimization to be applied in cases where a branch has been re-created after the live variables analysis pass, e.g. by the machine block placement pass. This appears to be low risk; a number of other targets seem to already be doing something similar, e.g. AArch64, PowerPC. Differential Revision: http://reviews.llvm.org/D9184 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235639 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-23Thumb2: When optimizing for size, do not if-convert branches involving ↵Peter Collingbourne4-5/+79
comparisons with zero. This allows the constant island pass to lower these branches to cbn?z instructions, resulting in a shorter instruction sequence. Differential Revision: http://reviews.llvm.org/D9183 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235638 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-23ARM: When spilling extra registers for alignment, prefer low registers on ↵Peter Collingbourne11-42/+42
all Thumb targets. This makes it more likely that we can use the 16-bit push and pop instructions on Thumb-2, saving around 4 bytes per function. Differential Revision: http://reviews.llvm.org/D9165 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235637 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-23ARM: Only enforce 4-byte alignment on Thumb-2 functions with constant pools.Peter Collingbourne3-20/+18
This appears to have been introduced back in r76698 as part of an unrelated change. I can find no official ARM documentation stating that Thumb-2 functions require 4-byte alignment; in fact, ARM documentation appears to contradict this (see, e.g., ARM Architecture Reference Manual Thumb-2 Supplement, section 2.6.1: "Thumb-2 enforces 16-bit alignment on all instructions."). Also remove code that sets alignment for ARM functions, which is redundant with code in the MachineFunction constructor, and remove the hidden -arm-align-constant-islands flag, which has been enabled by default since r146739 (Dec 2011) and has probably received sufficient testing by now. Differential Revision: http://reviews.llvm.org/D9138 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235636 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-23[Hexagon] Fix compiler warnings in release buildKrzysztof Parzyszek2-1/+6
Patch by Aditya Nandakumar. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235635 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-23[getUnderlyingOjbects] Analyze loop PHIs further to remove false positivesAdam Nemet6-16/+230
Specifically, if a pointer accesses different underlying objects in each iteration, don't look through the phi node defining the pointer. The motivating case is the underlyling-objects-2.ll testcase. Consider the loop nest: int **A; for (i) for (j) A[i][j] = A[i-1][j] * B[j] This loop is transformed by Load-PRE to stash away A[i] for the next iteration of the outer loop: Curr = A[0]; // Prev_0 for (i: 1..N) { Prev = Curr; // Prev = PHI (Prev_0, Curr) Curr = A[i]; for (j: 0..N) Curr[j] = Prev[j] * B[j] } Since A[i] and A[i-1] are likely to be independent pointers, getUnderlyingObjects should not assume that Curr and Prev share the same underlying object in the inner loop. If it did we would try to dependence-analyze Curr and Prev and the analysis of the corresponding SCEVs would fail with non-constant distance. To fix this, the getUnderlyingObjects API is extended with an optional LoopInfo parameter. This is effectively what controls whether we want the above behavior or the original. Currently, I only changed to use this approach for LoopAccessAnalysis. The other testcase is to guard the opposite case where we do want to look through the loop PHI. If we step through an array by incrementing a pointer, the underlying object is the incoming value of the phi as the loop is entered. Fixes rdar://problem/19566729 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235634 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-23[NVPTX] run SeparateConstOffsetFromGEP before SLSRJingyue Wu3-4/+82
Summary: We pick this order because SeparateConstOffsetFromGEP may create more opportunities for SLSR. Test Plan: reassociate-geps-and-slsr.ll no performance regression on internal benchmarks Reviewers: meheff Subscribers: llvm-commits, jholewinski Differential Revision: http://reviews.llvm.org/D9230 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235632 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-23R600/SI: Add missing -mcpu=SI to assembler testTom Stellard1-1/+1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235630 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-23R600/SI: Add assembler support for all CI and VI VOP1 instructionsTom Stellard7-73/+308
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235629 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-23R600/SI: v_mov_fed_b32 does not exist on VITom Stellard1-1/+1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235628 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-23R600/SI: Use a better error message for unsupported instructions in the ↵Tom Stellard1-1/+1
assembler git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235627 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-23R600/SI: Improve AsmParser support for forced e64 encodingTom Stellard3-5/+61
We can now force e64 encoding even when the operands would be legal for e32 encoding. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235626 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-23[WinEH] Handle stubs for outlined functions that have only unreached ↵Andrew Kaylor1-9/+16
terminators. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235618 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-23Revert "[SEH] Remove the old __C_specific_handler code now that WinEHPrepare ↵Reid Kleckner16-11/+312
works" We still have some "uses remain after removal" issues in -O0 builds. This reverts commit r235557. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235617 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-23[PowerPC] Enable printing instructions using aliasesHal Finkel55-1280/+1273
TableGen had been nicely generating code to print a number of instructions using shorter aliases (and PowerPC has plenty of short mnemonics), but we were not calling it. For some of the aliases we support in the parser, TableGen can't infer the "inverse" alias relationship, so there is still more to do. Thus, after some hours of updating test cases... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235616 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-23Move DIContext.h to common DebugInfo location.Zachary Turner13-45/+30
This will enable us to create a PDBContext so as to expose some amount of debug info functionality through a common interace. Differential Revision: http://reviews.llvm.org/D9205 Reviewed by: Alexey Samsonov git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235612 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-23Move Value.isDereferenceablePointer to ValueTracking [NFC]Philip Reames9-147/+159
Move isDereferenceablePointer function to Analysis. This function recursively tracks dereferencability over a chain of values like other functions in ValueTracking. This refactoring is motivated by further changes to support dereferenceable_or_null attribute (http://reviews.llvm.org/D8650). isDereferenceablePointer will be extended to perform context-sensitive analysis and IR is not a good place to have such functionality. Patch by: Artur Pilipenko <apilipenko@azulsystems.com> Differential Revision: reviews.llvm.org/D9075 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235611 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-23[AArch64] Add nvcast patterns for v4f16 and v8f16Pirama Arumuga Nainar2-0/+97
Summary: Constant stores of f16 vectors can create NvCast nodes from various operand types to v4f16 or v8f16 depending on patterns in the stored constants. This patch adds nvcast rules with v4f16 and v8f16 values. AArchISelLowering::LowerBUILD_VECTOR has the details on which constant patterns generate the nvcast nodes. Reviewers: jmolloy, srhines, ab Subscribers: rengolin, aemerson, llvm-commits Differential Revision: http://reviews.llvm.org/D9201 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235610 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-23[AArch64] Handle vec4, vec8, vec16 *itofp for halfPirama Arumuga Nainar4-2/+313
Summary: Set operation action for SINT_TO_FP and UINT_TO_FP nodes with v4i32, v8i8, v8i16 inputs to allow promotion of v4f16 results. Add tests for sitofp and uitofp for vec4, vec8, vec16, and i8, i16, i32, and i64 vectors. Only missing tests are for v16i8 and v16i16 as the shift operations are too complicated to write a proper check sequence. The conversions from v4i64 to v4f16 do not depend on this patch - v4i64 is split and the conversion gets handled while lowering v2i64. I am adding a test here for completeness. Reviewers: aemerson, rengolin, ab, jmolloy, srhines Subscribers: rengolin, aemerson, llvm-commits Differential Revision: http://reviews.llvm.org/D9166 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235609 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-23Re-commit r235560: Switch lowering: extract jump tables and bit tests before ↵Hans Wennborg14-912/+1324
building binary tree (PR22262) Third time's the charm. The previous commit was reverted as a reverse for-loop in SelectionDAGBuilder::lowerWorkItem did 'I--' on an iterator at the beginning of a vector, causing asserts when using debugging iterators. This commit fixes that. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235608 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-23use update_llc_test_checks.py to tighten checking; remove unnecessary CPU paramSanjay Patel1-54/+43
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235604 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-23[Hexagon] Shrink-wrap stack frame (Hexagon-specific)Krzysztof Parzyszek4-386/+598
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235603 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-23[Hexagon] Add testcases for stack alignment and variable-sized objectsKrzysztof Parzyszek4-0/+89
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235602 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-23[mips] [IAS] Move NOP emission after pseudo-instruction expansion. NFC.Toma Tabacu1-11/+9
As suggested in the review for http://reviews.llvm.org/D8537. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235601 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-23Revert r235560; this commit was causing several failed assertions in Debug ↵Aaron Ballman14-1323/+912
builds using MSVC's STL. The iterator is being used outside of its valid range. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235597 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-23Be more strict about the operand for the array type in BitcodeReaderFilipe Cabecinhas3-0/+8
Summary: Bug found with AFL fuzz. Reviewers: rafael Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9016 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235596 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-23Verify sizes when trying to read a BitcodeAbbrevOpFilipe Cabecinhas5-1/+19
Summary: Make sure the abbrev operands are valid and that we can read/skip them afterwards. Bug found with AFL fuzz. Reviewers: rafael Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9030 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235595 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-23[DAGCombiner] Remove extra bitcasts surrounding vector shuffles Simon Pilgrim2-0/+109
Patch to remove extra bitcasts from shuffles, this is often a legacy of XformToShuffleWithZero being used to combine bitmaskings (of float vectors bitcast to integer vectors) into shuffles: bitcast(shuffle(bitcast(s0),bitcast(s1))) -> shuffle(s0,s1) Differential Revision: http://reviews.llvm.org/D9097 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235578 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-23Move common loop utility function isInductionPHI into LoopUtils.cppKarthik Bhat2-43/+46
This patch refactors the definition of common utility function "isInductionPHI" to LoopUtils.cpp. This fixes compilation error when configured with -DBUILD_SHARED_LIBS=ON git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235577 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-23Add support to interchange loops with reductions.Karthik Bhat3-80/+462
This patch enables interchanging of tightly nested loops with reductions. Differential Revision: http://reviews.llvm.org/D8314 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235571 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-23[WinEH] Removing seh-filter.ll until I can determine its validityAndrew Kaylor1-21/+0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235566 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-23[WinEH] Don't skip landing pads that end with an unreachable instruction.Andrew Kaylor3-6/+6
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235563 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-22Switch lowering: extract jump tables and bit tests before building binary ↵Hans Wennborg14-912/+1323
tree (PR22262) This is a re-commit of r235101, which also fixes the problems with the previous patch: - Switches with only a default case and non-fallthrough were handled incorrectly - The previous patch tickled a bug in PowerPC Early-Return Creation which is fixed here. > This is a major rewrite of the SelectionDAG switch lowering. The previous code > would lower switches as a binary tre, discovering clusters of cases > suitable for lowering by jump tables or bit tests as it went along. To increase > the likelihood of finding jump tables, the binary tree pivot was selected to > maximize case density on both sides of the pivot. > > By not selecting the pivot in the middle, the binary trees would not always > be balanced, leading to performance problems in the generated code. > > This patch rewrites the lowering to search for clusters of cases > suitable for jump tables or bit tests first, and then builds the binary > tree around those clusters. This way, the binary tree will always be balanced. > > This has the added benefit of decoupling the different aspects of the lowering: > tree building and jump table or bit tests finding are now easier to tweak > separately. > > For example, this will enable us to balance the tree based on profile info > in the future. > > The algorithm for finding jump tables is quadratic, whereas the previous algorithm > was O(n log n) for common cases, and quadratic only in the worst-case. This > doesn't seem to be major problem in practice, e.g. compiling a file consisting > of a 10k-case switch was only 30% slower, and such large switches should be rare > in practice. Compiling e.g. gcc.c showed no compile-time difference. If this > does turn out to be a problem, we could limit the search space of the algorithm. > > This commit also disables all optimizations during switch lowering in -O0. > > Differential Revision: http://reviews.llvm.org/D8649 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235560 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-22[InstCombine] Use a more targeted fix instead of r235544David Majnemer2-9/+20
Only clear out the NSW/NUW flags if we are optimizing 'add'/'sub' while taking advantage that the sign bit is not set. We do this optimization to further shrink the mask but shrinking the mask isn't NSW/NUW preserving in this case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235558 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-22[SEH] Remove the old __C_specific_handler code now that WinEHPrepare worksReid Kleckner16-312/+11
This removes the -sehprepare flag and makes __C_specific_handler functions always to use WinEHPrepare. This was tested by building all of chromium_builder_tests and running a few tests that use SEH, but if something breaks, we can revert this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235557 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-22Unxfail passing test on HexagonKrzysztof Parzyszek1-2/+0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235556 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-22[RuntimeDyld][COFF] Add external symbol resolution support to RuntimeDyldCOFF.Lang Hames1-14/+16
Patch by Andy Ayers. Thanks Andy! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235554 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-22[Hexagon] Some cleanup of instruction selection codeKrzysztof Parzyszek11-816/+726
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235552 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-22[WinEH] Demote values and phis live across exception handlers up frontReid Kleckner6-130/+467
In particular, this handles SSA values that are live *out* of a handler. The existing code only handles values that are live *in* to a handler. It also handles phi nodes in the block where normal control should resume after the end of a catch handler. When EH return points have phi nodes, we need to split the return edge. It is impossible for phi elimination to emit copies in the previous block if that block gets outlined. The indirectbr that we leave in the function is only notional, and is eliminated from the MachineFunction CFG early on. Reviewers: majnemer, andrew.w.kaylor Differential Revision: http://reviews.llvm.org/D9158 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235545 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-22[InstCombine] Clear out nsw/nuw if we modify computation in the chainDavid Majnemer2-3/+22
An nsw/nuw operation relies on the values feeding into it to not overflow if 'poison' is not to be produced. This means that optimizations which make modifications to the bottom of a chain (like SimplifyDemandedBits) must strip out nsw/nuw if they cannot ensure that they will be preserved. This fixes PR23309. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235544 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-22[Kaleidoscope] Fix incorrect use of reinterpret_cast.Lang Hames7-7/+7
Thanks to Dave Blaikie for catching this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235543 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-22[Allocator] Remove memory poisoning before deallocationReid Kleckner1-14/+0
I added the poisoning back in r76891 (2009) because of some bugs in Unladen Swallow, and then Evan Cheng added the setRangeWritable() call in r81308. Profiling a Release+Asserts build on Windows shows that this memory protection call is actually very expensive. 4 seconds of a 70 second Clang compilation are spent in VirtualQuery. These days we have more reliable tools like ASan to find these kinds of bugs, so we can go ahead and retire these checks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235542 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-22[Kaleidoscope] Remove RTTI use from chapters 7 and 8.Lang Hames6-12/+8
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235541 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-22Another test to exercise APInt divide step D6.Yaron Keren1-0/+13
This is divrem_big7 since divrem_big6 is used in Pawel upcoming patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235536 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-22[Hexagon] Use A2_tfrsi for constant pool and jump table addressesKrzysztof Parzyszek7-81/+155
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235535 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-22Revert "[opaque pointer type] Avoid using PointerType::getElementType for a ↵David Blaikie8-116/+46
few cases of CallInst" This reverts commit r235458. It looks like this might be breaking something LTO-ish. Looking into it & will recommit with a fix/test case/etc once I've got more to go on. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235533 91177308-0d34-0410-b5e6-96231b3b80d8