summaryrefslogtreecommitdiffstats
path: root/llvm/test
Commit message (Collapse)AuthorAgeFilesLines
* [bpf] Do not expand UNDEF SDNode during insn selection loweringAlexei Starovoitov2015-10-082-1/+69
| | | | | | | | | | | | | | | | | | o Before this patch, BPF backend will expand UNDEF node to i64 constant 0. o For second pass of dag combiner, legalizer will run through each to-be-processed dag node. o If any new SDNode is generated and has an undef operand, dag combiner will put undef node, newly-generated constant-0 node, and any node which uses these nodes in the working list. o During this process, it is possible undef operand is generated again, and this will form an infinite loop for dag combiner pass2. o This patch allows UNDEF to be a legal type. Signed-off-by: Yonghong Song <yhs@plumgrid.com> Signed-off-by: Alexei Starovoitov <ast@plumgrid.com> llvm-svn: 249718
* [WinEH] Relax assertion in the presence of stack realignmentReid Kleckner2015-10-081-0/+80
| | | | | | The code is correct as is, but we should test it. llvm-svn: 249715
* [SCEV] Pick backedge values for phi nodes correctlySanjoy Das2015-10-081-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: `getConstantEvolutionLoopExitValue` and `ComputeExitCountExhaustively` assumed all phi nodes in the loop header have the same order of incoming values. This is not correct, and this commit changes `getConstantEvolutionLoopExitValue` and `ComputeExitCountExhaustively` to lookup the backedge value of a phi node using the loop's latch block. Unfortunately, there is still some code duplication `getConstantEvolutionLoopExitValue` and `ComputeExitCountExhaustively`. At some point in the future we should extract out a helper class / method that can evolve constant evolution phi nodes across iterations. Fixes 25060. Thanks to Mattias Eriksson for the spot-on analysis! Depends on D13457. Reviewers: atrick, hfinkel Subscribers: materi, llvm-commits Differential Revision: http://reviews.llvm.org/D13458 llvm-svn: 249712
* [SystemZ] Fix another assertion failure in tryBuildVectorShuffleUlrich Weigand2015-10-081-0/+38
| | | | | | | | | | | | | | | | This fixes yet another scenario where tryBuildVectorShuffle would attempt to create a BUILD_VECTOR node with an invalid combination of types. This can happen if the incoming BUILD_VECTOR has elements of a type different from the vector element type, which is allowed in certain cases as long as they are all the same type. When one of these elements is used in the residual vector, and UNDEF elements are added to fill up the residual vector, those UNDEFs then have to use the type of the original element, not the vector element type, or else the resulting BUILD_VECTOR will have an invalid type combination. llvm-svn: 249706
* [InstCombine] transform masking off of an FP sign bit into a fabs() ↵Sanjay Patel2015-10-081-0/+43
| | | | | | | | | | | | | | | | | | intrinsic call (PR24886) This is a partial fix for PR24886: https://llvm.org/bugs/show_bug.cgi?id=24886 Without this IR transform, the backend (x86 at least) was producing inefficient code. This patch is making 2 assumptions: 1. The canonical form of a fabs() operation is, in fact, the LLVM fabs() intrinsic. 2. The high bit of an FP value is always the sign bit; as noted in the bug report, this isn't specified by the LangRef. Differential Revision: http://reviews.llvm.org/D13076 llvm-svn: 249702
* [ValueTracking] teach computeKnownBits that a fabs() clears sign bitsSanjay Patel2015-10-081-0/+25
| | | | | | | | | | | | | This was requested in D13076: if we're going to canonicalize to fabs(), ValueTracking should know that fabs() clears sign bits. In this patch (as in D13076), we're not handling vectors yet even though computeKnownBits' fabs() case itself should be vector-ready via the splat in this patch. Fixing this will require follow-on patches to correct other logic that uses 'getScalarType'. Differential Revision: http://reviews.llvm.org/D13222 llvm-svn: 249701
* Fix a bug in llvm-objdump’s printing of Objective-C meta dataKevin Enderby2015-10-082-0/+6
| | | | | | | from malformed Mach-O files that caused a crash because of loops in the class meta data. llvm-svn: 249700
* Support for llvm-bcanalyzer dumping of record array strings.Teresa Johnson2015-10-081-2/+6
| | | | | | | | | | | | | | | | | | Summary: Adds support for automatically detecting and printing strings represented by Array abbrev operands, analogous to the string dumping performed for Blob abbrev operands. Enhanced the ThinLTO combined index test to check for the appropriate module and function strings. Reviewers: dexonsmith, joker.eph, davidxl Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D13553 llvm-svn: 249695
* [X86] Disable X86CallFrameOptimization on Darwin in presence of EHFrederic Riss2015-10-081-0/+5
| | | | | | | | | | | | | | We emit 1 compact unwind encoding per function, and this can’t represent the varying stack pointer that will be generated by X86CallFrameOptimization. Disable the optimization on Darwin. (It might be possible to split the function into multiple ranges and emit 1 compact unwind info per range. The compact unwind emission code isn’t ready for that and this kind of info certainly isn’t tested/used anywhere. It might be worth exploring this path if we want to get the space savings at some point though) llvm-svn: 249694
* AVX512: vpextrb/w/d/q and vpinsrb/w/d/q implementation.Igor Breger2015-10-085-0/+988
| | | | | | | | | This instructions doesn't have intrincis. Added tests for lowering and encoding. Differential Revision: http://reviews.llvm.org/D12317 llvm-svn: 249688
* Compute demanded bits for icmp instructionsJames Molloy2015-10-081-0/+22
| | | | | | | | | Instead of bailing out when we see an icmp, we can instead at least say that if the upper bits of both operands are known zero, they are not demanded. This doesn't help with signed comparisons, but it's at least better than bailing out. llvm-svn: 249687
* Treat Mul just like Add and SubtractJames Molloy2015-10-081-0/+12
| | | | | | | | | | Like adds and subtracts, muls ripple only to the left so we can use the same logic. While we're here, add a print method to DemandedBits so it can be used with -analyze, which we'll use in the testcase. llvm-svn: 249686
* [X86] Fix wrong treatment of multi-lane blends in BUILD_VECTORtoBlendMask()Michael Kuperstein2015-10-081-34/+38
| | | | | | | | | | | This fixes two separate bugs: 1) The mask for the high lane was not set correctly. That fixes PR24532. 2) The transformation should bail out if it believes it involves more than 2 lanes, as it does not currently do anything sensible in this case. Differential Revision: http://reviews.llvm.org/D13505 llvm-svn: 249669
* Do not assert on first non-prologue instruction being a CFI directive.Michael Kuperstein2015-10-081-0/+58
| | | | llvm-svn: 249668
* [SystemZ] SystemZElimCompare pass improved.Jonas Paulsson2015-10-081-13/+14
| | | | | | | | | | | | | | Compare elimination extended to recognize load-and-test instructions used for comparison and eliminate them the same way as with compare instructions. Test case fp-cmp-05.ll updated to expect optimized results now also for z13. The order of instruction shortening and compare elimination passes have been changed so that opcodes do not have to be handled in both passes. Reviewed by Ulrich Weigand. llvm-svn: 249666
* [SystemZ] Use load-and-test for fp compare with 0 if vector support is present.Jonas Paulsson2015-10-081-2/+1
| | | | | | | | | Since the LTxBRCompare instructions can't be used with vector registers, a normal load-and-test instruction (with a modelled def operand) is used instead. Reviewed by Ulrich Weigand. llvm-svn: 249664
* Revert "Handle inline stacks in gcov-encoded sample profiles."Diego Novillo2015-10-082-24/+0
| | | | | | | | This reverts commit r249644. The buildbots are failing the new test I added. Investigating. llvm-svn: 249648
* Handle inline stacks in gcov-encoded sample profiles.Diego Novillo2015-10-082-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for reading sample profiles with inline stacks. Inline stacks in a profile are generated when the sampled binary has samples in inlined functions. For instance, if main() calls foo() and foo() calls bar(), and bar() is inlined into foo() and foo() inlined into main(), the profile may look something like: main total:364084 head:0 [ ... ] 2.3: _Z3fool total:243786 1: 60149 1.2: 38568 1.4: 46511 1.7: _Z3bari total:98558 1.1: 52672 1.2: 45886 At line 2, discriminator 3, main() calls foo(). In turn, foo() calls bar() at line 1, discriminator 7. In the textual format, this stacking of inline calls is represented with indentation. With this change, LLVM can now read sample profile files generated by the create_gcov tool from https://github.com/google/autofdo. llvm-svn: 249644
* [WinEH] Add missing test case for llvm.eh.exceptioncodeReid Kleckner2015-10-071-0/+41
| | | | llvm-svn: 249638
* [WinEH] Fix 32-bit funclet epilogues in the presence of dynamic allocasReid Kleckner2015-10-071-0/+68
| | | | | | | | In particular, passing non-trivially copyable objects by value on win32 uses a dynamic alloca (inalloca). We would clobber ESP in the epilogue and end up returning to outer space. llvm-svn: 249637
* [WinEH] Refer to filter funclets using their symbol-table symbolDavid Majnemer2015-10-071-1/+1
| | | | | | | | The relocation for the filter funclet will be against a symbol table entry for a function instead of the section, making it easier to understand what is going on. llvm-svn: 249621
* [WinEH] Undo the effect of r249578 for 32-bitReid Kleckner2015-10-071-1/+1
| | | | | | | | | | | | The __CxxFrameHandler3 tables for 32-bit are supposed to hold stack offsets relative to EBP, not ESP. I blindly updated the win-catchpad.ll test case, and immediately noticed that 32-bit catching stopped working. While I'm at it, move the frame index to frame offset WinEH table logic out of PEI. PEI shouldn't have to know about WinEHFuncInfo. I realized we can calculate frame index offsets just fine from the table printer. llvm-svn: 249618
* [WinEH] Remove unreachable blocks before preparationDavid Majnemer2015-10-073-132/+11
| | | | | | | | | | | | | We remove unreachable blocks because it is pointless to consider them for coloring. However, we still had stale pointers to these blocks in some data structures after we removed them from the function. Instead, remove the unreachable blocks before attempting to do anything with the function. This fixes PR25099. llvm-svn: 249617
* [WinEH] Set NoModuleLevelChanges in clone flagsJoseph Tremoulet2015-10-071-0/+41
| | | | | | | | | | | | | | | | Summary: This is necessary to keep the cloner from making bogus copies of debug metadata attached to the IR it is cloning. Also, avoid running RemapInstruction over all instructions in the common case that no cloning was performed. Reviewers: rnk, andrew.w.kaylor, majnemer Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D13514 llvm-svn: 249591
* [X86]Update test to use FileCheck.Kevin B. Smith2015-10-071-3/+5
| | | | | | | Updates this test to use FileCheck and a single llc invocation rather than 3 llc invocations and grep. llvm-svn: 249583
* Revert "Revert "This patch builds on top of D13378 to handle constant ↵Mehdi Amini2015-10-071-0/+51
| | | | | | | | | | condition."" This reverts commit r249528 and reapply r249431. The fix for the fallout has been commited in r249575. From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 249581
* [AArch64] Fold a floating-point divide by power of two into fp conversion.Chad Rosier2015-10-071-0/+115
| | | | | | Part of http://reviews.llvm.org/D13442 llvm-svn: 249579
* [WinEH] Fix two minor issues in __CxxFrameHandler3 tablesReid Kleckner2015-10-071-6/+6
| | | | | | | | | | | | There was an off-by-one bug in ip2state tables which manifested when one call immediately preceded the try-range of the next. The return address of the previous call would appear to be within the try range of the next scope, resulting in extra destructors or catches running. We also computed the wrong offset for catch parameter stack objects. The offset should be from RSP, not from RBP. llvm-svn: 249578
* [AArch64] Fold a floating-point multiply by power of two into fp conversion.Chad Rosier2015-10-071-0/+154
| | | | | | Part of http://reviews.llvm.org/D13442 llvm-svn: 249576
* [IndVars] Preserve LCSSA in `eliminateIdentitySCEV`Sanjoy Das2015-10-071-0/+49
| | | | | | | | | | | | | | | | | | | | Summary: After r249211, SCEV can see through some LCSSA phis. Add a `replacementPreservesLCSSAForm` check before replacing uses of these phi nodes with a simplified use of the induction variable to avoid breaking LCSSA. Fixes 25047. Depends on D13460. Reviewers: atrick, hfinkel Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D13461 llvm-svn: 249575
* [ARM] Promote helper function to SelectionDAG.Chad Rosier2015-10-071-0/+9
| | | | | | | | | I'll be using the function in a similar combine for AArch64. The helper was also improved to handle undef values. Part of http://reviews.llvm.org/D13442 llvm-svn: 249572
* [ARM] Use correct half-precision functions in EABI modeOliver Stannard2015-10-073-29/+39
| | | | | | | | | The ARM RTABI defines the half- to single-precision float conversion functions with an __aeabi prefix, but libgcc only has them with a __gnu prefix. Therefore we need to emit the __aeabi version when compiling with an eabi or eabihf triple, and the __gnu version with a gnueabi or gnueabihf triple. llvm-svn: 249565
* Move test back to Generic now it's fixed the right way (thanks Eric!)David Blaikie2015-10-071-0/+0
| | | | | | | | I knee-jerk tried to fix this in completely the wrong way - it's not an CPU limitation, but an OS/object file type one, so moving it into a CPU-specific classification didn't help at all. llvm-svn: 249562
* [ARM] Prevent PerformVDIVCombine from combining a vcvt/vdiv with 8 lanes.Chad Rosier2015-10-071-0/+8
| | | | | | This would result in a crash since the vcvt used does not support v8i32 types. llvm-svn: 249560
* Teach computeKnownBits to use new align attribute/metadataArtur Pilipenko2015-10-071-0/+26
| | | | | | | | Reviewed By: reames Differential Revision: http://reviews.llvm.org/D13470 llvm-svn: 249557
* [ARM][AArch64] Only lower to interleaved load/store if the target has NEONJeroen Ketema2015-10-072-85/+163
| | | | | | | | | Without an additional check for NEON, the compiler crashes during legalization of NEON ldN/stN. Differential Revision: http://reviews.llvm.org/D13508 llvm-svn: 249550
* Revert "This patch builds on top of D13378 to handle constant condition."James Molloy2015-10-071-51/+0
| | | | | | This reverts commit r249431. This caused failures in sqlite3: http://lab.llvm.org:8011/builders/clang-native-arm-lnt/builds/14453 llvm-svn: 249528
* [EarlyCSE] Fix handling of target memory intrinsics for CSE'ing loads.Arnaud A. de Grandmaison2015-10-071-0/+18
| | | | | | | | | | | | | | | | | Summary: Some target intrinsics can access multiple elements, using the pointer as a base address (e.g. AArch64 ld4). When trying to CSE such instructions, it must be checked the available value comes from a compatible instruction because the pointer is not enough to discriminate whether the value is correct. Reviewers: ssijaric Subscribers: mcrosier, llvm-commits, aemerson Differential Revision: http://reviews.llvm.org/D13475 llvm-svn: 249523
* [X86] Emit .cfi_escape GNU_ARGS_SIZE when adjusting the stack before callsMichael Kuperstein2015-10-072-0/+181
| | | | | | | | | | | | When outgoing function arguments are passed using push instructions, and EH is enabled, we may need to indicate to the stack unwinder that the stack pointer was adjusted before the call. This should fix the exception handling issues in PR24792. Differential Revision: http://reviews.llvm.org/D13132 llvm-svn: 249522
* AVX512: Change encoding of vpshuflw and vpshufhw instructions. Implement WIG ↵Igor Breger2015-10-072-120/+361
| | | | | | | | | | as W0 and not W1, like all other instruction have been implemented. Add encoding tests. Differential Revision: http://reviews.llvm.org/D13471 llvm-svn: 249521
* Remove the comdat-ness from the testcase as it won't lower properlyEric Christopher2015-10-071-3/+1
| | | | | | | on darwin with it since darwin doesn't have comdat and it isn't necessary for the testcase. llvm-svn: 249504
* Update test to use FileCheck and clean up run lines to match theEric Christopher2015-10-071-4/+11
| | | | | | expected behavior. llvm-svn: 249498
* AMDGPU: Use explicit register size indirect pseudosMatt Arsenault2015-10-071-5/+62
| | | | | | | | | | | | | | | | | This stops using an unknown reg class operand. Currently build_vector selection has a broken looking check where it tries to use a VGPR reg class and an SGPR one if it sees an SGPR use. With the source operand has an explicit VGPR class, illegal copies will be inserted that SIFixSGPRCopies will take care of normally later, which will allow removing the weird check of build_vector users. Without this, when removed v_movrels_b32 would still be emitted even though all of the values were only stored in SGPRs. llvm-svn: 249494
* [SEH] Add llvm.eh.exceptioncode intrinsicReid Kleckner2015-10-073-4/+4
| | | | | | This will support the Clang __exception_code intrinsic. llvm-svn: 249492
* InstCombine: Fold comparisons between unguessable allocas and other pointersHans Wennborg2015-10-071-0/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will allow us to optimize code such as: int f(int *p) { int x; return p == &x; } as well as: int *allocate(void); int f() { int x; int *p = allocate(); return p == &x; } The folding can only be done under certain circumstances. Even though p and &x cannot alias, the comparison must still return true if the pointer representations are equal. If a user successfully generates a p that's a correct guess for &x, comparison should return true even though p is an invalid pointer. This patch argues that if the address of the alloca isn't observable outside the function, the function can act as-if the address is impossible to guess from the outside. The tricky part is keeping the act consistent: if we fold p == &x to false in one place, we must make sure to fold any other comparisons based on those pointers similarly. To ensure that, we only fold when &x is involved exactly once in comparison instructions. Differential Revision: http://reviews.llvm.org/D13358 llvm-svn: 249490
* Move test to X86-specific due to some IR invalid on other targetsDavid Blaikie2015-10-071-0/+0
| | | | llvm-svn: 249489
* DebugInfo: Include the decl_line/decl_file in subprogram definitions if they ↵David Blaikie2015-10-073-1/+98
| | | | | | | | | | | | | | | differ from those in the declaration This is handy for some AutoFDO stuff, and seems like a minor improvement to correctness (otherwise a debug info consumer might think the decl line/file of the def was the same as that of the declaration - though what a consumer might use that for, I'm not sure - maybe "list <func>" would've misbehaved with the old behavior?) and at a minor cost (in my experiment, with fission, without type units, without compression, 0.01% growth in debug info in the executable/objects, 0.02% growth in the .dwo files). llvm-svn: 249487
* [WinEH] Create a separate MBB for funclet prologuesDavid Majnemer2015-10-066-23/+191
| | | | | | | | | | | | | | | | Our current emission strategy is to emit the funclet prologue in the CatchPad's normal destination. This is problematic because intra-funclet control flow to the normal destination is not erroneous and results in us reevaluating the prologue if said control flow is taken. Instead, use the CatchPad's location for the funclet prologue. This correctly models our desire to have unwind edges evaluate the prologue but edges to the normal destination result in typical control flow. Differential Revision: http://reviews.llvm.org/D13424 llvm-svn: 249483
* [Orc] Teach the CompileOnDemand layer to clone aliases.Lang Hames2015-10-061-0/+21
| | | | | | | | This allows modules containing aliases to be lazily jit'd. Previously these failed with missing symbol errors because the aliases weren't cloned from the original module. llvm-svn: 249481
* Fix two bugs in llvm-objdump’s printing of Objective-C meta dataKevin Enderby2015-10-063-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | from malformed Mach-O files that caused crashes. We recently got about 700 malformed Mach-O files which we have been using the improve the robustness of tools that deal with reading data from object files. These resulted in about 20 small bug fixes to the darwin based tools. The goal here is to also improve the robustness of llvm-objdump and this is the first two fixes. In talking with Tim Northover the approach we thought might be best is to: 1) Only include tests for the malformed Mach-O files that cause crashes (not all 700+ tests). 2) The test should only contain the command line option that caused the crash and not all the others that don’t matter. 3) There should be only one line for the FileCheck that is past the point of the crash if possible and if possible indicates the malformation. Again the goal is to fix crashes and not so much care about how the printing of malformed data comes out. Tim also suggested if we really wanted to add test cases for all 700+ malformed Mach-O files putting them in the regression tests might be an option. But many of these do not cause crashes. llvm-svn: 249479
OpenPOWER on IntegriCloud