summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [GlobalISel][AArch64] Use getConstantVRegValWithLookThrough for selectArithImmedJessica Paquette2019-07-031-6/+4
| | | | | | | | | | | Instead of just stopping to see if we have a G_CONSTANT, instead, look through G_TRUNCs, G_SEXTs, and G_ZEXTs. This gives an average ~1.3% code size improvement on CINT2000 at -O3. Differential Revision: https://reviews.llvm.org/D64108 llvm-svn: 365063
* [X86] Avoid SFB - Skip meta instructionsRobert Lougher2019-07-031-4/+4
| | | | | | | | | | | This patch generalizes the fix in D61680 to ignore all meta instructions, not just debug info. Patch by Chris Dawson. Differential Revision: https://reviews.llvm.org/D62605 llvm-svn: 365061
* [CodeGen] Make branch funnels pass the machine verifierFrancis Visoiu Mistrih2019-07-032-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We previously marked all the tests with branch funnels as `-verify-machineinstrs=0`. This is an attempt to fix it. 1) `ICALL_BRANCH_FUNNEL` has no defs. Mark it as `let OutOperandList = (outs)` 2) After that we hit an assert: ``` Assertion failed: (Op.getValueType() != MVT::Other && Op.getValueType() != MVT::Glue && "Chain and glue operands should occur at end of operand list!"), function AddOperand, file /Users/francisvm/llvm/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp, line 461. ``` The chain operand was added at the beginning of the operand list. Move that to the end. 3) After that we hit another verifier issue in the pseudo expansion where the registers used in the cmps and jmps are not added to the livein lists. Add the `EFLAGS` to all the new MBBs that we create. PR39436 Differential Review: https://reviews.llvm.org/D54155 llvm-svn: 365058
* [X86] ComputeNumSignBitsForTargetNode - add target shuffle support.Simon Pilgrim2019-07-031-1/+50
| | | | llvm-svn: 365057
* Use getAllOnesConstants instead of -1 in DAGCombiner. NFCAmaury Sechet2019-07-031-1/+1
| | | | llvm-svn: 365054
* [SCEV] Preserve flags on add/muls in getSCEVATScopePhilip Reames2019-07-031-2/+2
| | | | | | | | We haven't changed the set of users, just specialized an operand for those users. Given that, the previous wrap flags must still be correct. Sorry for the lack of test case. Noticed this while working on something else, and haven't figured out to exercise this standalone. llvm-svn: 365053
* [DAGCombine] More diamong carry pattern optimization.Amaury Sechet2019-07-031-27/+92
| | | | | | | | | | | | | | | Summary: This diff improve the capability of DAGCOmbine to generate linear carries propagation in presence of a diamond pattern. It is now able to match a large variety of different patterns rather than some hardcoded one. Arguably, the codegen in test cases is not better, but this is to be expected. The goal of this transformation is more about canonicalisation than actual optimisation. Reviewers: hfinkel, RKSimon, craig.topper Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D57302 llvm-svn: 365051
* [X86][AVX] combineX86ShufflesRecursively - peek through extract_subvectorSimon Pilgrim2019-07-031-20/+25
| | | | | | If we have more then 2 shuffle ops to combine, try to use combineX86ShuffleChainWithExtract to see if some are from the same super vector. llvm-svn: 365050
* [ARM] Fix for NDEBUG buildsSam Parker2019-07-031-4/+3
| | | | | | | | Fix unused variable warning as well as a nonsense assert. Differential Revision: https://reviews.llvm.org/D63816 llvm-svn: 365046
* [X86][AVX] Combine vpermi(bitcast(x)) -> bitcast(vpermi(x))Simon Pilgrim2019-07-031-0/+16
| | | | | | | | | | iff the number of elements doesn't change. This gets around an issue with combineX86ShuffleChain not being able to hint which domain is preferred for shuffles that can be done with either. Fixes regression introduced in rL365041 llvm-svn: 365044
* [SelectionDAG] Propagate alias metadata to target intrinsic nodesJames Molloy2019-07-032-6/+8
| | | | | | | | When a target intrinsic has been determined to touch memory, we construct a MachineMemOperand during SDAG construction. In this case, we should propagate AAMDNodes metadata to the MachineMemOperand where available. Differential revision: https://reviews.llvm.org/D64131 llvm-svn: 365043
* [X86][AVX] combineX86ShuffleChainWithExtract - add number of non-zero ↵Simon Pilgrim2019-07-031-0/+3
| | | | | | | | | | extract_subvectors to the combine depth This better accounts for the cost/benefit of removing extract_subvectors from the shuffle and will be more useful in future patches. The vpermq predicate regression will be fixed shortly. llvm-svn: 365041
* [ThinLTO] Optimize writeonly globals outEugene Leviant2019-07-039-143/+295
| | | | | | Differential revision: https://reviews.llvm.org/D63444 llvm-svn: 365040
* [mips] Mark general scheduling model as completeSimon Atanasyan2019-07-031-2/+2
| | | | llvm-svn: 365034
* [mips] Add missing atomic instructions to general scheduling definitionsSimon Atanasyan2019-07-031-0/+16
| | | | llvm-svn: 365033
* [mips] Add missing microMIPS instructions to general scheduling definitionsSimon Atanasyan2019-07-031-12/+25
| | | | llvm-svn: 365032
* [X86][SSE] lowerUINT_TO_FP_v2i32 - explicitly cast half word to doubleSimon Pilgrim2019-07-031-1/+1
| | | | | | Fixes MSVC analyzer extension->double warning. llvm-svn: 365027
* [X86][SSE] LowerINSERT_VECTOR_ELT - ensure insertion index correctness. NFCI.Simon Pilgrim2019-07-031-1/+2
| | | | | | Assert that the insertion index is in range and use uint64_t for the index to fix MSVC/cppcheck truncation warning. llvm-svn: 365025
* [X86][SSE] LowerScalarImmediateShift - ensure shift amount correctness. NFCI.Simon Pilgrim2019-07-031-2/+4
| | | | | | Assert that the shift amount is in range and create vXi8 shift masks in a way that doesn't cause MSVC/cppcheck shift result is truncated then extended warnings. llvm-svn: 365024
* [mips] Add SIGRIE,GINVI,GINVT to general scheduling definitionsSimon Atanasyan2019-07-031-2/+5
| | | | llvm-svn: 365023
* [mips] Add missing mips16 instructions to general scheduling definitionsSimon Atanasyan2019-07-032-5/+6
| | | | llvm-svn: 365022
* [mips] Add missing MSA and ASE instructions to general scheduling definitionsSimon Atanasyan2019-07-031-0/+33
| | | | llvm-svn: 365021
* [mips] Replace some itineraries by instructions in the general scheduling ↵Simon Atanasyan2019-07-031-187/+668
| | | | | | definitions llvm-svn: 365020
* Fix uninitialized variable warnings. NFCI.Simon Pilgrim2019-07-031-1/+1
| | | | | | Both MSVC and cppcheck don't like the fact that the variables are initialized via references. llvm-svn: 365018
* [X86] LowerFunnelShift - use modulo constant shift amount.Simon Pilgrim2019-07-031-1/+1
| | | | | | This avoids the use of getZExtValue and uses the modulo shift amount which is whats expected for funnel shifts anyhow. llvm-svn: 365016
* [ARM] Thumb2: favor R4-R7 over R12/LR in allocation order when opt for minsizeOliver Stannard2019-07-034-7/+58
| | | | | | | | | | | | | | | | | | | | For Thumb2, we prefer low regs (costPerUse = 0) to allow narrow encoding. However, current allocation order is like: R0-R3, R12, LR, R4-R11 As a result, a lot of instructs that use R12/LR will be wide instrs. This patch changes the allocation order to: R0-R7, R12, LR, R8-R11 for thumb2 and -Osize. In most cases, there is no extra push/pop instrs as they will be folded into existing ones. There might be slight performance impact due to more stack usage, so we only enable it when opt for min size. https://reviews.llvm.org/D30324 llvm-svn: 365014
* Remove some autoconf references from docs and commentsSven van Haastregt2019-07-033-3/+3
| | | | | | | | | The autoconf build system support has been removed a while ago, remove some outdated references. Differential Revision: https://reviews.llvm.org/D63608 llvm-svn: 365013
* [InstCombine] Y - ~X --> X + Y + 1 fold (PR42457)Roman Lebedev2019-07-031-0/+6
| | | | | | | | | | | | | | | | | | | | | | Summary: I *think* we'd want this new variant, because we obviously have better handling for `add` as compared to `sub`/`not`. https://rise4fun.com/Alive/WMn Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=42457 | PR42457 ]] Reviewers: spatel, nikic, huihuiz, efriedma Reviewed By: spatel Subscribers: RKSimon, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63992 llvm-svn: 365011
* [Codegen][X86][AArch64][ARM][PowerPC] Inc-of-add vs sub-of-not (PR42457)Roman Lebedev2019-07-037-0/+56
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is the backend part of [[ https://bugs.llvm.org/show_bug.cgi?id=42457 | PR42457 ]]. In middle-end, we'd want to prefer the form with two adds - D63992, but as this diff shows, not every target will prefer that pattern. Out of 4 targets for which i added tests all seem to be ok with inc-of-add for scalars, but only X86 prefer that same pattern for vectors. Here i'm adding a new TLI hook, always defaulting to the inc-of-add, but adding AArch64,ARM,PowerPC overrides to prefer inc-of-add only for scalars. Reviewers: spatel, RKSimon, efriedma, t.p.northover, hfinkel Reviewed By: efriedma Subscribers: nemanjai, javed.absar, kristof.beyls, kbarton, jsji, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64090 llvm-svn: 365010
* [SCEV][LSR] Prevent using undefined value in binopsEugene Leviant2019-07-031-3/+1
| | | | | | | | | | | On some occasions ReuseOrCreateCast may convert previously expanded value to undefined. That value may be passed by SCEVExpander as an argument to InsertBinop making IV chain undefined. Differential revision: https://reviews.llvm.org/D63928 llvm-svn: 365009
* MSan: handle callbr instructionsAlexander Potapenko2019-07-031-21/+21
| | | | | | | | | | | | | | | | | | | | Summary: Handling callbr is very similar to handling an inline assembly call: MSan must checks the instruction's inputs. callbr doesn't (yet) have outputs, so there's nothing to unpoison, and conservative assembly handling doesn't apply either. Fixes PR42479. Reviewers: eugenis Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64072 llvm-svn: 365008
* [LoopPeel] Re-factor llvm::peelLoop method. NFC.Serguei Katkov2019-07-031-25/+49
| | | | | | | | | | | Extract code dealing with branch weights in separate functions. Reviewers: reames, mkuper, iajbar, fhahn Reviewed By: reames, fhahn Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D63917 llvm-svn: 365002
* Revert [InlineCost] cleanup calculations of Cost and ThresholdJordan Rupprecht2019-07-031-15/+13
| | | | | | | | This reverts r364422 (git commit 1a3dc761860d620ac8ed7e32a4285952142f780b) The inlining cost calculation is incorrect, leading to stack overflow due to large stack frames from heavy inlining. llvm-svn: 365000
* [AMDGPU] Enable serializing of argument info.Michael Liao2019-07-033-1/+253
| | | | | | | | | | | | | | | | Summary: - Support serialization of all arguments in machine function info. This enables fabricating MIR tests depending on argument info. Reviewers: arsenm, rampitec Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64096 llvm-svn: 364995
* [AArch64][GlobalISel] Overhaul legalization & isel or shifts to select ↵Amara Emerson2019-07-036-20/+234
| | | | | | | | | | | | | | | | | | | | | | | | | immediate forms. There are two main issues preventing us from generating immediate form shifts: 1) We have partial SelectionDAG imported support for G_ASHR and G_LSHR shift immediate forms, but they currently don't work because the amount type is expected to be an s64 constant, but we only legalize them to have homogenous types. To deal with this, first we introduce a custom legalizer to *only* custom legalize s32 shifts which have a constant operand into a s64. There is also an additional artifact combiner to fold zexts(g_constant) to a larger G_CONSTANT if it's legal, a counterpart to the anyext version committed in an earlier patch. 2) For G_SHL the importer can't cope with the pattern. For this I introduced an early selection phase in the arm64 selector to select these forms manually before the tablegen selector pessimizes it to a register-register variant. Differential Revision: https://reviews.llvm.org/D63910 llvm-svn: 364994
* [PowerPC] exclude ICmpZero in LSR if icmp can be replaced in later hardware ↵Chen Zheng2019-07-034-7/+58
| | | | | | | | | loop. Differential Revision: https://reviews.llvm.org/D63477 llvm-svn: 364993
* [triple] Use 'macabi' environment name for the Mac Catalyst triplesAlex Lorenz2019-07-031-2/+2
| | | | | | The 'macabi' environment name is preferred instead of 'maccatalyst'. llvm-svn: 364988
* Revert Changing CodeView debug info type record representation in assembly ↵Nilanjana Basu2019-07-034-177/+32
| | | | | | | | files to make it more human-readable & editable This reverts r364982 (git commit 2082bf28ebea76cc187b508f801122866420d9ff) llvm-svn: 364987
* [WebAssembly] Prevent inline assembly from being mangled by SjLjGuanzhong Chen2019-07-031-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Before, inline assembly gets mangled by the SjLj transformation. For example, in a function with setjmp/longjmp, this LLVM IR code call void asm sideeffect "", ""() would be transformed into call void @__invoke_void(void ()* asm sideeffect "", "") This is invalid, and results in the error: Cannot take the address of an inline asm! In this diff, we skip the transformation for inline assembly. Reviewers: aheejin, tlively Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64115 llvm-svn: 364985
* AMDGPU: Look through bundles for existing waitcntsMatt Arsenault2019-07-031-1/+2
| | | | | | These aren't produced now, but will be in a future patch. llvm-svn: 364983
* Changing CodeView debug info type record representation in assembly files to ↵Nilanjana Basu2019-07-034-32/+177
| | | | | | make it more human-readable & editable llvm-svn: 364982
* Add support for the 'macCatalyst' MachO platformAlex Lorenz2019-07-023-0/+12
| | | | | | | | | Mac Catalyst is a new MachO platform in macOS Catalina. It always uses the build_version MachO load command. Differential Revision: https://reviews.llvm.org/D64107 llvm-svn: 364981
* [X86] Add a DAG combine for turning *_extend_vector_inreg+load into an ↵Craig Topper2019-07-023-31/+27
| | | | | | | | | | appropriate extload if the load isn't volatile. Remove the corresponding isel patterns that did the same thing without checking for volatile. This fixes another variation of PR42079 llvm-svn: 364977
* [triple] add 'macCatalyst' environment typeAlex Lorenz2019-07-021-0/+2
| | | | | | | | Mac Catalyst is a new deployment platform in macOS Catalina. Differential Revision: https://reviews.llvm.org/D64097 llvm-svn: 364971
* [ARM] Fix unwind info for Thumb1 functions that save high registers.Eli Friedman2019-07-023-8/+20
| | | | | | | | | | | | | | | | | | | | | There were two issues here: one, some of the relevant instructions were missing the expected "FrameSetup" flag, and two, ARMAsmPrinter::EmitUnwindingInstruction wasn't expecting "mov" instructions in the prologue. I'm sticking the additional state into ARMFunctionInfo so it's obvious it only applies to the current function. I considered a few alternative approaches where we would compute the correct unwind information as part of the prologue/epilogue lowering, but it seems like a lot of work to introduce pseudo-instructions, and the current code seems to be reliable enough. Fixes https://bugs.llvm.org/show_bug.cgi?id=42408. Differential Revision: https://reviews.llvm.org/D63964 llvm-svn: 364970
* [NFC] Strenghten isInteger condition for rL364940David Bolvansky2019-07-021-2/+3
| | | | llvm-svn: 364969
* [ThinLTO] Address post-review suggestions for index-based WPD summaryTeresa Johnson2019-07-021-14/+11
| | | | | | | Removes a couple of unnecessary and/or redundant checks introduced by r364960. llvm-svn: 364968
* [SLP] Recommit: Look-ahead operand reordering heuristic.Vasileios Porpodas2019-07-021-46/+248
| | | | | | | | | | | | | | | | Summary: This patch introduces a new heuristic for guiding operand reordering. The new "look-ahead" heuristic can look beyond the immediate predecessors. This helps break ties when the immediate predecessors have identical opcodes (see lit test for an example). Reviewers: RKSimon, ABataev, dtemirbulatov, Ayal, hfinkel, rnk Reviewed By: RKSimon, dtemirbulatov Subscribers: hiraditya, phosek, rnk, rcorcs, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60897 llvm-svn: 364964
* [AArch64][GlobalISel] Teach tryOptSelect to handle G_ICMPJessica Paquette2019-07-021-106/+139
| | | | | | | | | | | | | | | | | | | | This teaches `tryOptSelect` to handle folding G_ICMP, and removes the requirement that the G_SELECT we're dealing with is floating point. Some refactoring to make this work nicely as well: - Factor out the scalar case from the selection code for G_ICMP into `emitIntegerCompare`. - Make `tryOptCMN` return a MachineInstr* instead of a bool. - Make `tryOptCMN` not modify the instruction being selected. - Factor out the CMN emission into `emitCMN` for readability. By doing this this way, we can get all of the compare selection optimizations in select emission. Differential Revision: https://reviews.llvm.org/D64084 llvm-svn: 364961
* [ThinLTO] Add summary entries for index-based WPDTeresa Johnson2019-07-029-24/+477
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: If LTOUnit splitting is disabled, the module summary analysis computes the summary information necessary to perform single implementation devirtualization during the thin link with the index and no IR. The information collected from the regular LTO IR in the current hybrid WPD algorithm is summarized, including: 1) For vtable definitions, record the function pointers and their offset within the vtable initializer (subsumes the information collected from IR by tryFindVirtualCallTargets). 2) A record for each type metadata summarizing the vtable definitions decorated with that metadata (subsumes the TypeIdentiferMap collected from IR). Also added are the necessary bitcode records, and the corresponding assembly support. The follow-on index-based WPD patch is D55153. Depends on D53890. Reviewers: pcc Subscribers: mehdi_amini, Prazek, inglorion, eraman, steven_wu, dexonsmith, arphaman, llvm-commits Differential Revision: https://reviews.llvm.org/D54815 llvm-svn: 364960
OpenPOWER on IntegriCloud