summaryrefslogtreecommitdiffstats
path: root/llvm
Commit message (Collapse)AuthorAgeFilesLines
* AMDGPU/SI: Don't crash on anonymous GlobalValuesTom Stellard2016-09-264-7/+32
| | | | | | | | | | | | | | Summary: We need to call AsmPrinter::getNameWithPrefix() in order to handle anonymous GlobalValues (e.g. @0, @1). Reviewers: arsenm, b-sumner Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, tony-tye, llvm-commits Differential Revision: https://reviews.llvm.org/D24865 llvm-svn: 282420
* Remove pruning of phi nodes in MemorySSA - it makes updating harderDaniel Berlin2016-09-263-95/+6
| | | | | | | | | | Reviewers: george.burgess.iv Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D24923 llvm-svn: 282419
* [LV] Scalarize instructions marked scalar after vectorizationMatthew Simpson2016-09-266-7/+92
| | | | | | | | | This patch ensures that we actually scalarize instructions marked scalar after vectorization. Previously, such instructions may have been vectorized instead. Differential Revision: https://reviews.llvm.org/D23889 llvm-svn: 282418
* [Coroutines] Part14: Handle coroutines with no suspend points.Gor Nishanov2016-09-263-0/+309
| | | | | | | | | | | | | | | Summary: If coroutine has no suspend points, remove heap allocation and turn a coroutine into a normal function. Also, if a pattern is detected that coroutine resumes or destroys itself prior to coro.suspend call, turn the suspend point into a simple jump to resume or cleanup label. This pattern occurs when coroutines are used to propagate errors in functions that return expected<T>. Reviewers: majnemer Subscribers: mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D24408 llvm-svn: 282414
* [AArch64] Improve add/sub/cmp isel of uxtw forms.Geoff Berry2016-09-264-14/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't match the UXTW extended reg forms of ADD/ADDS/SUB/SUBS if the 32-bit to 64-bit zero-extend can be done for free by taking advantage of the 32-bit defining instruction zeroing the upper 32-bits of the X register destination. This enables better instruction selection in a few cases, such as: sub x0, xzr, x8 instead of: mov x8, xzr sub x0, x8, w9, uxtw madd x0, x1, x1, x8 instead of: mul x9, x1, x1 add x0, x9, w8, uxtw cmp x2, x8 instead of: sub x8, x2, w8, uxtw cmp x8, #0 add x0, x8, x1, lsl #3 instead of: lsl x9, x1, #3 add x0, x9, w8, uxtw Reviewers: t.p.northover, jmolloy Subscribers: mcrosier, aemerson, llvm-commits, rengolin Differential Revision: https://reviews.llvm.org/D24747 llvm-svn: 282413
* Add support to optionally limit the size of jump tables.Evandro Menezes2016-09-267-18/+154
| | | | | | | | | | | | | | | | | | | Many high-performance processors have a dedicated branch predictor for indirect branches, commonly used with jump tables. As sophisticated as such branch predictors are, they tend to have well defined limits beyond which their effectiveness is hampered or even nullified. One such limit is the number of possible destinations for a given indirect branches that such branch predictors can handle. This patch considers a limit that a target may set to the number of destination addresses in a jump table. Patch by: Evandro Menezes <e.menezes@samsung.com>, Aditya Kumar <aditya.k7@samsung.com>, Sebastian Pop <s.pop@samsung.com>. Differential revision: https://reviews.llvm.org/D21940 llvm-svn: 282412
* [InstCombine] Fixed bug introduced in r282237Alexey Bataev2016-09-262-6/+17
| | | | | | | | The index of the new insertelement instruction was evaluated in the wrong way, it was considered as the index of the inserted value instead of index of the position, where the value should be inserted. llvm-svn: 282401
* Fix typo in comment, NFCKrzysztof Parzyszek2016-09-261-2/+3
| | | | llvm-svn: 282399
* [InstCombine] Teach the udiv folding logic how to handle constant expressions.Andrea Di Biagio2016-09-262-11/+29
| | | | | | | | | | | | | | | | | | | This patch fixes PR30366. Function foldUDivShl() worked under the assumption that one of the values in input to the function was always an instance of llvm::Instruction. However, function visitUDivOperand() (the only user of foldUDivShl) was clearly violating that precondition; internally, visitUDivOperand() uses pattern matches to check the operands of a udiv. Pattern matchers for binary operators know how to handle both Instruction and ConstantExpr values. This patch fixes the problem in foldUDivShl(). Now we use pattern matchers instead of explicit casts to Instruction. The reduced test case from PR30366 has been added to test file InstCombine/udiv-simplify.ll. Differential Revision: https://reviews.llvm.org/D24565 llvm-svn: 282398
* [AVR] Add AVRMCExprDylan McKay2016-09-264-0/+427
| | | | | | | | | | | | Summary: This adds the AVRMCExpr headers and implementation. Reviewers: arsenm, ruiu, grosbach, kparzysz Subscribers: wdng, beanz, mgorny, kparzysz, jtbandes, llvm-commits Differential Revision: https://reviews.llvm.org/D20503 llvm-svn: 282397
* Revert "[AMDGPU] Disassembler: print label names in branch instructions"Sam Kolton2016-09-265-171/+69
| | | | | | This reverts commit 6c6dbe625263ec9fcf8de0df27263cf147cde550. llvm-svn: 282396
* [AMDGPU] Disassembler: print label names in branch instructionsSam Kolton2016-09-265-69/+171
| | | | | | | | | | | | Summary: Add AMDGPUSymbolizer for finding names for labels from ELF symbol table. Reviewers: vpykhtin, artem.tamazov, tstellarAMD Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, tony-tye Differential Revision: https://reviews.llvm.org/D24802 llvm-svn: 282394
* [ARM] Promote small global constants to constant poolsJames Molloy2016-09-2611-9/+470
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a constant is unamed_addr and is only used within one function, we can save on the code size and runtime cost of an indirection by changing the global's storage to inside the constant pool. For example, instead of: ldr r0, .CPI0 bl printf bx lr .CPI0: &format_string format_string: .asciz "hello, world!\n" We can emit: adr r0, .CPI0 bl printf bx lr .CPI0: .asciz "hello, world!\n" This can cause significant code size savings when many small strings are used in one function (4 bytes per string). This recommit contains fixes for a nasty bug related to fast-isel fallback - because fast-isel doesn't know about this optimization, if it runs and emits references to a string that we inline (because fast-isel fell back to SDAG) we will end up with an inlined string and also an out-of-line string, and we won't emit the out-of-line string, causing backend failures. It also contains fixes for emitting .text relocations which made the sanitizer bots unhappy. llvm-svn: 282387
* [X86] Optimization for replacing LEA with MOV at frame index elimination timeZvi Rackover2016-09-2618-38/+83
| | | | | | | | | | | | | | | Summary: Replace a LEA instruction of the form 'lea (%esp), %ebx' --> 'mov %esp, %ebx' MOV is preferable over LEA because usually there are more issue-slots available to execute MOVs than LEAs. Latest processors also support zero-latency MOVs. Fixes pr29022. Reviewers: hfinkel, delena, igorb, myatsina, mkuper Differential Revision: https://reviews.llvm.org/D24705 llvm-svn: 282385
* [PM] Refactor this unittest a bit to remove duplicated code. This wasChandler Carruth2016-09-261-65/+45
| | | | | | | suggested at one point during code review and I deferred it to a follow-up commit. llvm-svn: 282383
* [X86][avx512] Fix bug in masked compress store.Ayman Musa2016-09-267-22/+78
| | | | | | Differential Revision: https://reviews.llvm.org/D23984 llvm-svn: 282381
* [SCEV] Fix the order of members in the initializer list.Chandler Carruth2016-09-261-1/+1
| | | | | | | Noticed due to the warning on this line. Sanjoy is on a less-than-awesome internet connection, so committing on his behalf. llvm-svn: 282380
* [PM] Add a unittest covering the invalidation of a Module analysis fromChandler Carruth2016-09-261-0/+95
| | | | | | | | | a function pass nested inside of a CGSCC pass manager. This is very similar to the previous unittest but makes sure the invalidation logic works across all the layers here. llvm-svn: 282378
* [PM] Add a unittest for invalidating module analyses with an SCC pass.Chandler Carruth2016-09-261-0/+89
| | | | | | | | | | | | | This reinstates r280447. Original commit log: This wasn't really well explicitly tested with a nice unittest before. It seems good to have reasonably broken out unittests for this kind of functionality as I'm workin go other invalidation features to make sure none of the existing ones regress. This still has too much duplicated code, I plan to factor that out in a subsequent commit to use common helpers for repeated parts of this. llvm-svn: 282377
* [SCEV] Assign LoopPropertiesCache in the move constructorSanjoy Das2016-09-261-0/+1
| | | | | | | | | | | In a previous change I collapsed two different caches into one. When doing that I noticed that ScalarEvolution's move constructor was not moving those caches. To keep the previous change simple, I've moved that bugfix into this separate change. llvm-svn: 282376
* [SCEV] Combine two predicates into one; NFCSanjoy Das2016-09-262-47/+50
| | | | | | | | | Both `loopHasNoSideEffects` and `loopHasNoAbnormalExits` involve walking the loop and maintaining similar sorts of caches. This commit changes SCEV to compute both the predicates via a single walk, and maintain a single cache instead of two. llvm-svn: 282375
* [SCEV] Make it obvious BackedgeTakenInfo's constructor steals storageSanjoy Das2016-09-262-3/+5
| | | | | | | Specifically, it moves SCEVUnionPredicates from its input into its own storage. Make this obvious at the type level. llvm-svn: 282374
* [SCEV] Further isolate incidental data structure; NFCSanjoy Das2016-09-262-6/+9
| | | | llvm-svn: 282373
* [SCEV] Simplify BackedgeTakenInfo::getMax; NFCSanjoy Das2016-09-261-7/+7
| | | | llvm-svn: 282372
* Appease MSVCSanjoy Das2016-09-261-4/+24
| | | | | | | ... by not default move constructors and operator= s. Defaulting these works in clang, but not in MSVC. llvm-svn: 282370
* Attempt to appease MSVCSanjoy Das2016-09-261-0/+9
| | | | | | ... by explicitly deleting the copy constructor. llvm-svn: 282369
* [SCEV] Reserve space in SmallVector; NFCSanjoy Das2016-09-251-0/+1
| | | | llvm-svn: 282368
* [SCEV] Document a gotcha; NFCSanjoy Das2016-09-251-0/+3
| | | | | | | We should re-consider the design decision that led to this gotcah, but for now just document it. llvm-svn: 282367
* [SCEV] Have ExitNotTakenInfo keep a pointer to its predicate; NFCSanjoy Das2016-09-252-13/+23
| | | | | | | SCEVUnionPredicate is a "heavyweight" structure, so it is beneficial to store the (optional) data out of line. llvm-svn: 282366
* [SCEV] Simplify tracking ExitNotTakenInfo instances; NFCSanjoy Das2016-09-252-193/+46
| | | | | | | | | | This change simplifies a data structure optimization in the `BackedgeTakenInfo` class for loops with exactly one computable exit. I've sanity checked that this does not regress compile time performance, using sqlite3's amalgamated build. llvm-svn: 282365
* [SCEV] Rename a couple of fields; NFCSanjoy Das2016-09-252-58/+68
| | | | llvm-svn: 282364
* [SCEV] Remove incidental data structure; NFCSanjoy Das2016-09-252-32/+21
| | | | llvm-svn: 282363
* [SCEV] Clang format most of the SCEV header; NFCSanjoy Das2016-09-251-1652/+1631
| | | | | | | The indentation for the declared classes was not as per LLVM coding style. llvm-svn: 282362
* [X86] Remove what appears to be leftover MMX code involving (v1i64 ↵Craig Topper2016-09-251-4/+0
| | | | | | scalar_to_vector). llvm-svn: 282361
* [X86] Remove patterns for scalar_to_vector from FR32/FR64 to 256-bit ↵Craig Topper2016-09-251-4/+0
| | | | | | vectors. Lowering explicitly avoids creating this pattern. llvm-svn: 282360
* [AVX-512] Replace get512BitSuperRegister with calls to ↵Craig Topper2016-09-253-17/+10
| | | | | | TargetRegisterInfo::getMatchingSuperReg. llvm-svn: 282359
* [AVX-512] Fix some patterns predicates to properly enforce priority for ↵Craig Topper2016-09-252-6/+6
| | | | | | various versions of CVTDQ2PD instruction. llvm-svn: 282358
* [AVX-512] Add rounding versions of instructions to hasUndefRegUpdate.Craig Topper2016-09-251-0/+13
| | | | llvm-svn: 282357
* [AVX-512] Add the scalar unsigned integer to fp conversion instructions to ↵Craig Topper2016-09-253-50/+66
| | | | | | hasUndefRegUpdate. llvm-svn: 282356
* [AVX-512] Remove duplicate instructions for converting integer to scalar ↵Craig Topper2016-09-252-26/+22
| | | | | | floating point. We can use patterns to point to the other instructions instead. llvm-svn: 282355
* Add a comment on StringRef::contains(char)Zachary Turner2016-09-251-0/+2
| | | | llvm-svn: 282350
* Fix signed / unsigned comparison.Zachary Turner2016-09-251-2/+2
| | | | llvm-svn: 282348
* Add some predicated searching functions to StringRef.Zachary Turner2016-09-252-0/+118
| | | | | | | | | | | | | | | | | | | | | | This adds 4 new functions to StringRef, which can be used to take or drop characters while a certain condition is met, or until a certain condition is met. They are: take_while - Return characters until a condition is not met. take_until - Return characters until a condition is met. drop_while - Remove characters until a condition is not met. drop_until - Remove characters until a condition is met. Internally, all of these functions delegate to two additional helper functions which can be used to search for the position of a character meeting or not meeting a condition, which are: find_if - Find the first character matching a predicate. find_if_not - Find the first character not matching a predicate. Differential Revision: https://reviews.llvm.org/D24842 llvm-svn: 282346
* [AVX-512] Don't use two opcodes for INTR_TYPE_SCALAR_MASK_RM. The handling ↵Craig Topper2016-09-252-22/+21
| | | | | | was such that if the second opcode was present the first was ingored, so we can just have one opcode. llvm-svn: 282344
* [X86] Teach combineShuffle to avoid creating floating point operations with ↵Craig Topper2016-09-241-7/+12
| | | | | | | | integer types and integer operations with floating point types. Seems isOperationLegal lies for mismatched types and operations. Fixes PR30511. llvm-svn: 282341
* [AVX-512] Split scalar version of X86ISD::SELECT into a separate opcode ↵Craig Topper2016-09-243-4/+6
| | | | | | because isel is not robust with multiple type profiles for the same opcode. llvm-svn: 282340
* [AVX-512] Remove the patterns for selecting scalar VCOMI/VUCOMI instructions ↵Craig Topper2016-09-242-10/+6
| | | | | | with SAE as there is no way to create the pattern. llvm-svn: 282339
* ObjCARC: Don't look at users of ConstantDataDuncan P. N. Exon Smith2016-09-241-0/+11
| | | | | | | | | | | | | Stop looking at users of UndefValue and ConstantPointerNull in the objective C ARC optimizers. The other users aren't actually interesting, since they're not pointing at a particular object. I imagine these calls could be optimized through -instcombine... maybe they already are? These early returns will be required at some point in the future, with a WIP patch that asserts when someone accesses a use-list on ConstantData. llvm-svn: 282338
* Analysis: Return early for UndefValue in computeKnownBitsDuncan P. N. Exon Smith2016-09-241-0/+8
| | | | | | | | | There is no benefit in looking through assumptions on UndefValue to guess known bits. Return early to avoid walking their use-lists, and assert that all instances of ConstantData are handled here for similar reasons (UndefValue was the only integer/pointer holdout). llvm-svn: 282337
* [x86] don't try to create a vector integer inst for an SSE1 target (PR30512)Sanjay Patel2016-09-242-3/+67
| | | | | | | | | | | | This bug was introduced with: http://reviews.llvm.org/rL272511 We need to restrict the lowering to v4f32 comparisons because that's all SSE1 can handle. This should fix: https://llvm.org/bugs/show_bug.cgi?id=28044 llvm-svn: 282336
OpenPOWER on IntegriCloud