summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* GlobalISel: add callseq instructions to record stack usageTim Northover2017-01-171-1/+10
| | | | llvm-svn: 292284
* GlobalISel: correctly handle varargsTim Northover2017-01-173-30/+50
| | | | | | | | | | | | Some platforms (notably iOS) use a different calling convention for unnamed vs named parameters in varargs functions, so we need to keep track of this information when translating calls. Since not many platforms are involved, the guts of the special handling is in the ValueHandler class (with a generic implementation that should work for most targets). llvm-svn: 292283
* [LoopDeletion] (cleanup, NFC) Use the dedicated helper to get a singleChandler Carruth2017-01-171-6/+2
| | | | | | | | | | | | | | | | | | | | | unique exit block if available rather than rolling it ourselves. This is a little disappointing because that helper doesn't do anything clever to short-circuit the (surprisingly expensive) computation of all exit blocks. What's worse is that the way we compute this is hopelessly, hilariously inefficient. We're literally computing the same information two different ways and multiple times each way: - hasDedicatedExits computes the exit block set and then looks at the predecessors of each - getExitingBlocks computes the set of loop blocks which have exiting successors - getUniqueExitBlock(s) computes the set of non-loop blocks reached from loop blocks (sound familiar?) Anyways, at some point we should clean all of this up in the LoopInfo API, but for now just simplifying the user I'm about to touch. llvm-svn: 292282
* [LoopDeletion] (cleanup, NFC) Fix another variable name to match LLVMChandler Carruth2017-01-171-7/+7
| | | | | | conventions, missed this one in a previous cleanup patch (sorry). llvm-svn: 292279
* [GlobalISel] track predecessor mapping during switch lowering.Tim Northover2017-01-171-16/+39
| | | | | | | | | | | | | Correctly populating Machine PHIs relies on knowing exactly how the IR level CFG was lowered to MachineIR. This needs to be tracked by any translation phases that meddle (currently only SwitchInst handling). This reapplies r291973 which was reverted because of testing failures. Fixes: + Don't return an ArrayRef to a local temporary. + Incorporate Kristof's suggested comment improvements. llvm-svn: 292278
* [LoopDeletion] (cleanup, NFC) Remove a pointless comment.Chandler Carruth2017-01-171-2/+1
| | | | | | | | | | I hope that for any code, it is changed only with good reason and only when the author knows what they are doing... There is of course good reason to comment here about the subtlety of the process, and I've left that comment in tact. llvm-svn: 292275
* [LoopDeletion] (cleanup, NFC) Make simple helper functions staticChandler Carruth2017-01-171-18/+26
| | | | | | | | | | | | instead of members. No state was being provided by the object so this seems strictly simpler. I've also tried to improve the name and comments for the functions to more thoroughly document what they are doing. llvm-svn: 292274
* [LoopDeletion] (cleanup, NFC) Stop passing around reference to a vectorChandler Carruth2017-01-171-7/+6
| | | | | | | | | | | that we know has exactly one element when all we are going to do is get that one element out of it. Instead, pass around that one element. There are more simplifications to come in this code... llvm-svn: 292273
* [PM] Clean up variable and parameter names to match modern LLVM namingChandler Carruth2017-01-171-23/+23
| | | | | | | conventions more conistently before hacking on this code to integrate nicely with new PM's loop pass infrastructure. NFC. llvm-svn: 292272
* [InstCombine] refactor foldICmpShlConstant(); NFCISanjay Patel2017-01-171-32/+35
| | | | | | | This reduces the size of and increases the symmetry with the planned functional change in: https://reviews.llvm.org/D28406 llvm-svn: 292260
* [bpf] fix stack-use-after-scopeAlexei Starovoitov2017-01-171-7/+7
| | | | | Signed-off-by: Alexei Starovoitov <ast@kernel.org> llvm-svn: 292258
* [LV] Mark non-consecutive-like pointers non-uniformMatthew Simpson2017-01-171-0/+7
| | | | | | | | | | | If a memory instruction will be vectorized, but it's pointer operand is non-consecutive-like, the instruction is a gather or scatter operation. Its pointer operand will be non-uniform. This should fix PR31671. Reference: https://llvm.org/bugs/show_bug.cgi?id=31671 Differential Revision: https://reviews.llvm.org/D28819 llvm-svn: 292254
* [WebAssembly] Add triple support for the new wasm object formatDan Gohman2017-01-174-2/+8
| | | | | | Differential Revision: https://reviews.llvm.org/D26701 llvm-svn: 292252
* [EarlyCSE] Don't DSE across readnone functions that may throwSanjoy Das2017-01-171-6/+7
| | | | | | | | | | | | Summary: Depends on D28740 Reviewers: dberlin, chandlerc, hfinkel, majnemer Subscribers: mcrosier, llvm-commits Differential Revision: https://reviews.llvm.org/D28741 llvm-svn: 292249
* [TLI] Appease spurious MSVC warning using llvm_unreachable. NFC.Ahmed Bougacha2017-01-171-1/+2
| | | | | | | | | | | | | r292188 confused MSVC because of the combined lack of a default case and return statement. Move the unreachable outside of the NumLibFuncs case, to make it obvious that all cases should be handled. llvm_unreachable is __declspec(noreturn), so I'm assuming this does appease MSVC. llvm-svn: 292246
* Remove an overeager assert from r288844.Joerg Sonnenberger2017-01-171-3/+0
| | | | llvm-svn: 292244
* Revert r291640 change to fold X86 comparison with atomic_load_add.Bob Wilson2017-01-171-22/+10
| | | | | | | | Even with the fix from r291630, this still causes problems. I get widespread assertion failures in the Swift runtime's WeakRefCount::increment() function. I sent a reduced testcase in reply to the commit. llvm-svn: 292242
* [ValueTracking] recognize a 'not' of an assumed condition as falseSanjay Patel2017-01-172-3/+12
| | | | | | | | Also, add the corresponding match to the AssumptionCache's 'Affected Values' list. Differential Revision: https://reviews.llvm.org/D28485 llvm-svn: 292239
* [InstCombine] Fold ((C1 OP zext(X)) & C2) -> zext((C1 OP X) & C2)David Majnemer2017-01-171-15/+28
| | | | | | | This further extends r292179 to support additional binary operators beyond subtraction. llvm-svn: 292238
* [ValueTracking] Extend known bits to understand @llvm.bitreverse.Chad Rosier2017-01-171-0/+5
| | | | | | Differential Revision: https://reviews.llvm.org/D28780 llvm-svn: 292233
* [InstCombine] reduce indent; NFCISanjay Patel2017-01-171-133/+131
| | | | llvm-svn: 292230
* Recommit r292214 "[Support/Compression] - Change zlib API to return Error ↵George Rimar2017-01-174-51/+63
| | | | | | | | | | | | | | | | | | instead of custom status" No any changes, will follow up with D28807 commit containing APLi change for clang to fix build issues happened. Original commit message: [Support/Compression] - Change zlib API to return Error instead of custom status. Previously API returned custom enum values. Patch changes it to return Error with string description. That should help users to report errors in universal way. Differential revision: https://reviews.llvm.org/D28684 llvm-svn: 292226
* [AMDGPU] Assembler: fix v_mac_f16 immediatesSam Kolton2017-01-172-10/+18
| | | | | | | | | | Reviewers: vpykhtin, artem.tamazov, tstellarAMD Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, tony-tye Differential Revision: https://reviews.llvm.org/D28802 llvm-svn: 292224
* Revert r292214 "[Support/Compression] - Change zlib API to return Error ↵George Rimar2017-01-174-63/+51
| | | | | | | | | instead of custom status." It broked clang: http://lab.llvm.org:8080/green//job/clang-stage1-cmake-RA-incremental_build/34218/consoleFull#46141505449ba4694-19c4-4d7e-bec5-911270d8a58c llvm-svn: 292217
* [Support/Compression] - Change zlib API to return Error instead of custom ↵George Rimar2017-01-174-51/+63
| | | | | | | | | | | | status. Previously API returned custom enum values. Patch changes it to return Error with string description. That should help users to report errors in universal way. Differential revision: https://reviews.llvm.org/D28684 llvm-svn: 292214
* [XRay][Arm] Repair XRay table emission on Arm32 and add tests to identify ↵Serge Rogatch2017-01-171-0/+3
| | | | | | | | | | | | | | | | | | | such problem earlier Summary: Emission of XRay table was occasionally disabled for Arm32, but this bug was not then detected because earlier (also by mistake) testing of XRay was occasionally disabled on 32-bit Arm targets. This patch should fix that problem and detect such problems in the future. This patch is one of a series, see also - https://reviews.llvm.org/D28623 Reviewers: rengolin, dberris Reviewed By: dberris Subscribers: llvm-commits, aemerson, rengolin, dberris, iid_iunknown Differential Revision: https://reviews.llvm.org/D28624 llvm-svn: 292210
* [InstCombine][X86][AVX] Add DemandedElts support for VPERMILPD/VPERMILPS ↵Simon Pilgrim2017-01-172-2/+20
| | | | | | | | instructions Simplify a vpermilvar shuffle mask based on the elements of the mask that are actually demanded. llvm-svn: 292209
* AMDGPU: Add replacement export intrinsicsMatt Arsenault2017-01-174-20/+80
| | | | llvm-svn: 292205
* [bpf] error when unknown bpf helper is calledAlexei Starovoitov2017-01-174-3/+25
| | | | | | | | | | Emit error when BPF backend sees a call to a global function or to an external symbol. The kernel verifier only allows calls to predefined helpers from bpf.h which are defined in 'enum bpf_func_id'. Such calls in assembler must look like 'call [1-9]+' where number matches bpf_func_id. Signed-off-by: Alexei Starovoitov <ast@kernel.org> llvm-svn: 292204
* [AVX-512] Add support for taking a bitcast between a SUBV_BROADCAST and ↵Craig Topper2017-01-171-2/+18
| | | | | | VSELECT and moving it to the input of the SUBV_BROADCAST if it will help with using a masked operation. llvm-svn: 292201
* [InstCombine] Don't DSE across readnone functions that may throwSanjoy Das2017-01-171-5/+5
| | | | | | | | | | | | Summary: Depends on D28740 Reviewers: dberlin, chandlerc, hfinkel, majnemer Subscribers: mcrosier, llvm-commits Differential Revision: https://reviews.llvm.org/D28742 llvm-svn: 292197
* Revert "[TLI] Robustize SDAG proto checking by merging it into TLI."Ahmed Bougacha2017-01-171-8/+70
| | | | | | This reverts commit r292189, as it causes issues on SystemZ bots. llvm-svn: 292191
* [TLI] Robustize SDAG proto checking by merging it into TLI.Ahmed Bougacha2017-01-171-70/+8
| | | | | | | | | | | | | | | | | | | SelectionDAGBuilder recognizes libfuncs using some homegrown parameter type-checking. Use TLI instead, removing another heap of redundant code. This isn't strictly NFC, as the SDAG code was too lax. Concretely, this means changes are required to two tests: - calling a non-variadic function via a variadic prototype isn't OK; it just happens to work on x86_64 (but not on, e.g., aarch64). - mempcpy has a size_t parameter; the SDAG code accepts any integer type, which meant using i32 on x86_64 worked. I don't think it's worth supporting either of these (IMO) broken testcases. Instead, fix them to be more correct. llvm-svn: 292189
* [TLI] Add prototype checking for all remaining LibFuncs.Ahmed Bougacha2017-01-171-31/+186
| | | | | | | | | | | | | | This is another step towards unifying all LibFunc prototype checks. This work started in r267758 (D19469); add the remaining checks. Also add a unittest that checks each libfunc declared with a known-valid and known-invalid prototype. New libfuncs added in the future are required to have prototype checking in place; the known-valid test will fail otherwise. Differential Revision: https://reviews.llvm.org/D28030 llvm-svn: 292188
* [TLI] Alphabetize some of the prototype check switch. NFC.Ahmed Bougacha2017-01-171-27/+27
| | | | llvm-svn: 292187
* [bpf] error when BPF stack size exceeds 512 bytesAlexei Starovoitov2017-01-171-2/+26
| | | | | Signed-off-by: Alexei Starovoitov <ast@kernel.org> llvm-svn: 292180
* [InstCombine] Fold ((C1-zext(X)) & C2) -> zext((C1-X) & C2)David Majnemer2017-01-171-0/+15
| | | | | | | This is valid if C2 fits within the bitwidth of X thanks to two's complement modulo arithmetic. llvm-svn: 292179
* SimplifyLibCalls: Remove checks for fabsMatt Arsenault2017-01-171-5/+7
| | | | | | | Use the intrinsic instead of emitting the libcall which will be replaced by the intrinsic. llvm-svn: 292176
* AMDGPU: Remove dead patternMatt Arsenault2017-01-171-5/+0
| | | | | | | This is the unsafe conversion pattern, but not guarded by an unsafe math check. It is also already done in LegalizeDAG. llvm-svn: 292173
* SimplifyLibCalls: Replace fabs libcalls with intrinsicsMatt Arsenault2017-01-173-21/+38
| | | | | | | | Add missing fabs(fpext) optimzation that worked with the call, and also fixes it creating a second fpext when there were multiple uses. llvm-svn: 292172
* [InstCombine] use m_APInt instead of faking itSanjay Patel2017-01-161-20/+14
| | | | llvm-svn: 292164
* ADMGPU/EG,CM: Implement _noret global atomicsJan Vesely2017-01-162-7/+113
| | | | | | | | _RTN versions will be a lot more complicated Differential Revision: https://reviews.llvm.org/D28067 llvm-svn: 292162
* [PowerPC] Expand ISEL instruction into if-then-else sequence.Tony Jiang2017-01-168-14/+467
| | | | | | | | | Generally, the ISEL is expanded into if-then-else sequence, in some cases (like when the destination register is the same with the true or false value register), it may just be expanded into just the if or else sequence. llvm-svn: 292154
* [InstCombine] fix names in canEvaluateShiftedShift(); NFCSanjay Patel2017-01-161-27/+26
| | | | | | | | It's not clear what 'First' and 'Second' mean, so use 'Inner' and 'Outer' to match foldShiftedShift() and add comments with formulas, so it's easier to see what's going on. llvm-svn: 292153
* [InstCombine] use m_APInt to allow shift-shift folds for vectors with splat ↵Sanjay Patel2017-01-161-4/+5
| | | | | | | | constants Some existing 'FIXME' tests are still not folded because of splat holes in value tracking. llvm-svn: 292151
* [InstCombine] refactor shift-of-shift folds; NFCISanjay Patel2017-01-161-83/+66
| | | | | | Reduces code duplication and makes it easier to extend these folds for vectors. llvm-svn: 292145
* [AArch64] Falkor supports Rounding Double Multiply Add/Subtract instructions.Chad Rosier2017-01-164-4/+12
| | | | | | | | | | Falkor only partially implements the ARMv8.1a extensions, so this patch refactors the support for the SQRDML[A|S]H instruction into a separate feature. Differential Revision: https://reviews.llvm.org/D28681 llvm-svn: 292142
* Revert r292132: [globalisel] Tablegen-erate current Register Bank ↵Daniel Sanders2017-01-168-86/+191
| | | | | | | | | Information'... Several buildbots encountered a crash in tablegen when building this commit. Reverting while I investigate the cause. llvm-svn: 292136
* Fix use-after-free bug in AffectedValueCallbackVH::allUsesReplacedWithHal Finkel2017-01-161-10/+17
| | | | | | | | | | | | | When transferring affected values in the cache from an old value, identified by the value of the current callback, to the specified new value we might need to insert a new entry into the DenseMap which constitutes the cache. Doing so might delete the current callback object. Move the copying logic into a new function, a member of the assumption cache itself, so that we don't run into UB should the callback handle itself be removed mid-copy. Differential Revision: https://reviews.llvm.org/D28749 llvm-svn: 292133
* [globalisel] Tablegen-erate current Register Bank InformationDaniel Sanders2017-01-168-191/+86
| | | | | | | | | | | | | | Summary: Adds a RegisterBank tablegen class that can be used to declare the register banks and an associated tablegen pass to generate the necessary code. Reviewers: t.p.northover, ab, rovka, qcolombet Subscribers: aditya_nandakumar, rengolin, kristof.beyls, vkalintiris, mgorny, dberris, llvm-commits, rovka Differential Revision: https://reviews.llvm.org/D27338 llvm-svn: 292132
OpenPOWER on IntegriCloud