summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
* [LCG] Build an edge abstraction for the LazyCallGraph and use it toChandler Carruth2016-02-021-133/+160
| | | | | | | | | | | | | | | | | | | | | differentiate between indirect references to functions an direct calls. This doesn't do a whole lot yet other than change the print out produced by the analysis, but it lays the groundwork for a very major change I'm working on next: teaching the call graph to actually be a call graph, modeling *both* the indirect reference graph and the call graph simultaneously. More details on that in the next patch though. The rest of this is essentially a bunch of over-engineering that won't be interesting until the next patch. But this also isolates essentially all of the churn necessary to introduce the edge abstraction from the very important behavior change necessary in order to separately model the two graphs. So it should make review of the subsequent patch a bit easier at the cost of making this patch seem poorly motivated. ;] Differential Revision: http://reviews.llvm.org/D16038 llvm-svn: 259463
* [LVI] Introduce an intersect operation on lattice valuesPhilip Reames2016-02-021-32/+85
| | | | | | | | | | | | LVI has several separate sources of facts - edge local conditions, recursive queries, assumes, and control independent value facts - which all apply to the same value at the same location. The existing implementation was very conservative about exploiting all of these facts at once. This change introduces an "intersect" function specifically to abstract the action of picking a good set of facts from all of the separate facts given. At the moment, this function is relatively simple (i.e. mostly just reuses the bits which were already there), but even the minor additions reveal the inherent power. For example, JumpThreading is now capable of doing an inductive proof that a particular value is always positive and removing a half range check. I'm currently only using the new intersect function in one place. If folks are happy with the direction of the work, I plan on making a series of small changes without review to replace mergeIn with intersect at all the appropriate places. Differential Revision: http://reviews.llvm.org/D14476 llvm-svn: 259461
* [libFuzzer] allow passing 1 or more files as individual inputsKostya Serebryany2016-02-024-2/+48
| | | | llvm-svn: 259459
* MachineVerifier: Use report_context() instead of ad-hoc messages.Matthias Braun2016-02-021-10/+32
| | | | llvm-svn: 259457
* [X86] Fix a bug in getMemOpBaseRegImmOfsSanjoy Das2016-02-021-1/+5
| | | | | | | | | Fix a crash in `getMemOpBaseRegImmOfs` that happens if the base of `MemOp` is a frame index memory operand. The fix is to have `getMemOpBaseRegImmOfs` bail out in such cases. We can possibly be more clever here, if needed. llvm-svn: 259456
* [libFuzzer] fail if the corpus dir does not existKostya Serebryany2016-02-022-1/+4
| | | | llvm-svn: 259454
* [X86][FastISel] Don't force Nearest-Even rounding for VCVTPS2PH, use MXCSR.Ahmed Bougacha2016-02-021-2/+4
| | | | | | FastISel counterpart to r259448. llvm-svn: 259449
* [X86] Don't force Nearest-Even rounding for VCVTPS2PH, use MXCSR.Ahmed Bougacha2016-02-021-2/+7
| | | | | | | | | | | | | | | | | | Officially, we don't acknowledge non-default configurations of MXCSR, as getting there would require usage of the FENV_ACCESS pragma (at least insofar as rounding mode is concerned). We don't support the pragma, so we can assume that the default rounding mode - round to nearest, ties to even - is always used. However, it's inconsistent with the rest of the instruction set, where MXCSR is always effective (unless otherwise specified). Also, it's an unnecessary obstacle to the few brave souls that use fenv.h with LLVM. Avoid the hard-coded rounding mode for fp_to_f16; use MXCSR instead. llvm-svn: 259448
* [safestack] Make sure the unsafe stack pointer is popped in all casesAnna Zaks2016-02-021-27/+26
| | | | | | | | | | The unsafe stack pointer is only popped in moveStaticAllocasToUnsafeStack so it won't happen if there are no static allocas. Fixes https://llvm.org/bugs/show_bug.cgi?id=26122 Differential Revision: http://reviews.llvm.org/D16339 llvm-svn: 259447
* [LVI] Fix a latent bug in getValueAtPhilip Reames2016-02-021-0/+8
| | | | | | | | This routine was returning Undefined for most queries. This was utterly wrong. Amusingly, we do not appear to have any callers of this which are actually trying to exploit unreachable code or this would have broken the world. A better approach would be to explicit describe the intersection of facts. That's blocked behind http://reviews.llvm.org/D14476 and I wanted to fix the current bug. llvm-svn: 259446
* fix typos; NFCSanjay Patel2016-02-011-2/+2
| | | | llvm-svn: 259438
* [LVI] Remove overly tight assert from 259429Philip Reames2016-02-011-2/+2
| | | | | | I'll submit a test case shortly which covers this, but it's causing clang self host problems in the builders so I wanted to get it removed. llvm-svn: 259432
* [X86][AVX512] Add support for AVX512 VMOVD (load) shuffle decodingSimon Pilgrim2016-02-011-0/+1
| | | | llvm-svn: 259430
* [LVI] Add select handlingPhilip Reames2016-02-011-0/+49
| | | | | | | | Teach LVI to handle select instructions in the exact same way it handles PHI nodes. This is useful since various parts of the optimizer convert PHI nodes into selects and we don't want these transformations to cause inferior optimization. Note that this patch does nothing to exploit the implied constraint on the inputs represented by the select condition itself. That will be a later patch and is blocked on http://reviews.llvm.org/D14476 llvm-svn: 259429
* [X86][AVX512] Add support for AVX512 VMOVSD/VMOVSS shuffle decodingSimon Pilgrim2016-02-011-0/+4
| | | | llvm-svn: 259427
* function names start with a lowercase letter; NFCSanjay Patel2016-02-0114-324/+324
| | | | llvm-svn: 259425
* [InstCombine] simplify masked scatter/gather intrinsics with zero masksSanjay Patel2016-02-011-4/+22
| | | | | | | | | | | A masked scatter with a zero mask means there's no store. A masked gather with a zero mask means the passthru arg is returned. This is a continuation of: http://reviews.llvm.org/rL259369 http://reviews.llvm.org/rL259392 llvm-svn: 259421
* [X86][AVX512] Add support for AVX512 VINSERTPS shuffle decodingSimon Pilgrim2016-02-011-0/+2
| | | | llvm-svn: 259420
* SmallSet/SmallPtrSet: Refuse huge Small numbersMatthias Braun2016-02-011-2/+2
| | | | | | | | | | These sets do linear searching in small mode; It is not a good idea to use huge numbers as the small value here, save people from themselves by adding a static_assert. Differential Revision: http://reviews.llvm.org/D16706 llvm-svn: 259419
* Move comments a bit closer to associated code. NFC.Chad Rosier2016-02-011-29/+25
| | | | llvm-svn: 259411
* Avoid inlining call sites in unreachable-terminated blockJun Bum Lim2016-02-011-6/+17
| | | | | | | | | | | | | Summary: If the normal destination of the invoke or the parent block of the call site is unreachable-terminated, there is little point in inlining the call site unless there is literally zero cost. Unlike my previous change (D15289), this change specifically handle the call sites followed by unreachable in the same basic block for call or in the normal destination for the invoke. This change could be a reasonable first step to conservatively inline call sites leading to an unreachable-terminated block while BFI / BPI is not yet available in inliner. Reviewers: manmanren, majnemer, hfinkel, davidxl, mcrosier, dblaikie, eraman Subscribers: dblaikie, davidxl, mcrosier, llvm-commits Differential Revision: http://reviews.llvm.org/D16616 llvm-svn: 259403
* Remove extra semicolon. NFC.Chad Rosier2016-02-011-1/+1
| | | | llvm-svn: 259402
* [SCEV] Clean up isKnownPredicateViaConstantRanges; NFCISanjoy Das2016-02-011-63/+20
| | | | | | | | | | | | | | | - ScalarEvolution::isKnownPredicateViaConstantRanges duplicates some logic already present in ConstantRange, use ConstantRange for those bits. - In some cases ScalarEvolution::isKnownPredicateViaConstantRanges returns `false` to mean "definitely false" (e.g. see the `LHSRange.getSignedMin().sge(RHSRange.getSignedMax())` case for `ICmpInst::ICMP_SLT`), but for `isKnownPredicateViaConstantRanges`, `false` actually means "don't know". Get rid of this extra bit of code to avoid confusion. llvm-svn: 259401
* [SCEV] Rename isKnownPredicateWithRanges; NFCSanjoy Das2016-02-011-7/+8
| | | | | | | Make it obvious that it uses constant ranges, and use `Via` instead of `With`, like other similar functions in SCEV. llvm-svn: 259400
* Fix infinite recursion in MCAsmStreamer::EmitValueImpl.Rafael Espindola2016-02-011-7/+5
| | | | | | | | | | | If a target can only emit 8-bits data, we would loop in EmitValueImpl since it will try to split a 32-bits data in 1 chunk of 32-bits. No test since all current targets can emit 32bits at a time. Patch by Alexandru Guduleasa! llvm-svn: 259399
* [ThinLTO] Ensure function summary output order is stableTeresa Johnson2016-02-011-5/+11
| | | | | | | | | Iterate over the function list instead of a DenseMap of Function pointers when emitting the function summary into the module. This fixes PR26419. llvm-svn: 259398
* [InstCombine] simplify masked store intrinsics with all ones or zeros masksSanjay Patel2016-02-011-1/+21
| | | | | | | | | | A masked store with a zero mask means there's no store. A masked store with an allOnes mask means it's a normal vector store. This is a continuation of: http://reviews.llvm.org/rL259369 llvm-svn: 259392
* AArch64: Implement missed conditional compare sequences.Balaram Makam2016-02-013-4/+49
| | | | | | | | | | | | | | | | | | Summary: This is an extension to the existing implementation of r242436 which restricts to only select inputs. This version fixes missed opportunities in pr26084 by attempting to lower conditional compare sequences of and/or trees with setcc leafs. This will additionaly handle the case when a tree with select input is not a conjunction-disjunction tree but some of the sub trees are conjunction-disjunction trees. Reviewers: jmolloy, t.p.northover, mcrosier, MatzeB Subscribers: mcrosier, llvm-commits, junbuml, haicheng, mssimpso, gberry Differential Revision: http://reviews.llvm.org/D16291 llvm-svn: 259387
* [AArch64] Simplify prolog/epilog callee save/restore. NFC.Geoff Berry2016-02-011-61/+87
| | | | | | | | | | | | | | | | | Summary: Factor out common code for callee-save register pair calculation. This is intended to simplify follow-on changes that reduce the number of registers saved/restored. Depends on D16732 Reviewers: mcrosier, jmolloy, t.p.northover Subscribers: aemerson, rengolin, mcrosier, llvm-commits Differential Revision: http://reviews.llvm.org/D16734 llvm-svn: 259384
* [SystemZ] Fix wrong-code generation for certain always-false conditionsUlrich Weigand2016-02-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | We've found another bug in the code generation logic conditions for a certain class of always-false conditions, those of the form if ((a & 1) < 0) These only reach the back end when compiling without optimization. The bug was introduced by the choice of using TEST UNDER MASK to implement a check for if ((a & MASK) < VAL) as if ((a & MASK) == 0) where VAL is less than the the lowest bit of MASK. This is correct in all cases except for VAL == 0, in which case the original condition is always false, but the replacement isn't. Fixed by excluding that particular case. llvm-svn: 259381
* [NFC] Referencing manual for reason why subregbit is checkedColin LeMahieu2016-02-011-1/+2
| | | | llvm-svn: 259380
* [InstCombine] Don't transform (X+INT_MAX)>=(Y+INT_MAX) -> (X<=Y)David Majnemer2016-02-011-1/+1
| | | | | | | | | This miscompile came about because we tried to use a transform which was only appropriate for xor operators when addition was present. This fixes PR26407. llvm-svn: 259375
* [ValueTracking] Improve isKnownNonZero for PHI of non-zero constantsJun Bum Lim2016-02-011-0/+6
| | | | | | It is clear that a PHI is a non-zero if all incoming values are non-zero constants. llvm-svn: 259370
* [InstCombine] simplify masked load intrinsics with all ones or zeros masksSanjay Patel2016-02-011-0/+30
| | | | | | | | | A masked load with a zero mask means there's no load. A masked load with an allOnes mask means it's a normal vector load. Differential Revision: http://reviews.llvm.org/D16691 llvm-svn: 259369
* [PrologEpilogInserter] Add some debug output for callee-save frame object ↵Geoff Berry2016-02-011-0/+2
| | | | | | | | | | | | allocation Reviewers: mcrosier Subscribers: mcrosier, llvm-commits Differential Revision: http://reviews.llvm.org/D16733 llvm-svn: 259367
* [AArch64] Simplify callee-save register save/restore. NFC.Geoff Berry2016-02-012-68/+23
| | | | | | | | | | | | | | | | | | | Summary: Simplify callee-save register save/restore code generation by remembering the size of the callee-save area when it is computed so we don't have to scan the prologue/epilogue instructions again later to reconstruct it. This is intended to simplify follow-on changes that reduce the number of registers saved/restored. Reviewers: mcrosier, jmolloy, t.p.northover Subscribers: aemerson, rengolin, mcrosier, llvm-commits Differential Revision: http://reviews.llvm.org/D16732 llvm-svn: 259365
* [LV] Rename RdxPHIsToFix to PHIsToFix (NFC)Matthew Simpson2016-02-011-39/+32
| | | | | | | | | | In the future, we will vectorize recurrences other than reductions. This patch renames a few variables and updates their associated comments to enable them to be reused for non-reduction PHI nodes. This change was requested in the review for D16197. llvm-svn: 259364
* [X86][AVX512VBMI] add encoding and intrinsics for MultishiftAsaf Badouh2016-02-015-17/+39
| | | | | | Differential Revision: http://reviews.llvm.org/D16399 llvm-svn: 259363
* [mips] Range check uimm16 and fix several bugs this revealed.Daniel Sanders2016-02-017-56/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The bugs were: * teq and similar take 4-bit unsigned immediates on microMIPS. * teqi and similar have side-effects like teq do. * shll_s.w and shra_r.w take 5-bit unsigned immediates. * The various DSP ext* instructions take a 5-bit immediate. * repl.qh takes an 8-bit unsigned immediate. * repl.ph takes a 10-bit unsigned immediate. * rddsp/wrdsp take a 10-bit unsigned immediate. * teqi and similar take signed 16-bit immediates (10-bit for microMIPS). * Out-of-range immediate macros for or/xor take a simm32/simm64 depending on architecture. I'll fix the simm64 case properly when I reach simm32. lui is a bit more lenient than GAS and accepts signed immediates in addition to unsigned. This is because MipsMCExpr can produce signed values when constant folding and it currently lacks a way of knowing it should fold to an unsigned value. Reviewers: vkalintiris Subscribers: dsanders, llvm-commits Differential Revision: http://reviews.llvm.org/D15446 llvm-svn: 259360
* Improved macro emission in dwarf.Amjad Aboud2016-02-016-82/+42
| | | | | | | | Changed emitting offset of macinfo entry into compiler unit DIE to use "addSectionLabel" method rather than explicitly calculating size/offset of macro entry. Differential Revision: http://reviews.llvm.org/D16292 llvm-svn: 259358
* Reapply commit r258404 with fix.Matthew Simpson2016-02-011-11/+231
| | | | | | | The previous patch caused PR26364. The fix is to ensure that we don't enter a cycle when iterating over use-def chains. llvm-svn: 259357
* WebAssembly NFC: simplify control flowJF Bastien2016-02-011-43/+63
| | | | | | This should now be easier to read. llvm-svn: 259349
* AVX512: fix mask handling for gather/scatter/prefetch intrinsics.Igor Breger2016-02-011-39/+18
| | | | | | Differential Revision: http://reviews.llvm.org/D16755 llvm-svn: 259346
* [X86][SSE] Find source of the inserted element of INSERTPSSimon Pilgrim2016-02-011-4/+29
| | | | | | | | Minor patch to trace back through target shuffles to the source of the inserted element in a (V)INSERTPS shuffle. Differential Revision: http://reviews.llvm.org/D16652 llvm-svn: 259343
* AVX512 : Fix SETCCE lowering for KNL 32 bit.Igor Breger2016-02-011-2/+6
| | | | | | Differential Revision: http://reviews.llvm.org/D16752 llvm-svn: 259342
* [X86] Cleanup the WinEHState passDavid Majnemer2016-02-011-25/+14
| | | | | | | | Remove unnecessary includes and class state. No functional change intended. llvm-svn: 259340
* Revert r258580 and r258581.David Majnemer2016-02-011-113/+0
| | | | | | | | | | | | | | | | | | | | | | | | Those commits created an artificial edge from a cleanup to a synthesized catchswitch in order to get the MSVC personality routine to execute cleanups which don't cleanupret and are not wrapped by a catchswitch. This worked well enough but is not a complete solution in situations where there the cleanup infinite loops. However, the real deal breaker behind this approach comes about from a degenerate case where the cleanup is post-dominated by unreachable *and* throws an exception. This ends poorly because the catchswitch will inadvertently catch the exception. Because of this we should go back to our previous behavior of not executing certain cleanups (identical behavior with the Itanium ABI implementation in clang, GCC and ICC). N.B. I think this could be salvaged by making the catchpad rethrow the exception and properly transforming throwing calls in the cleanup into invokes. llvm-svn: 259338
* [MCDwarf] Fix encoding of line tables with weird custom parametersFrederic Riss2016-01-311-2/+5
| | | | | | | | | | | | | | | | With poorly chosen custom parameters, the line table encoding logic would sometimes end up generating a special opcode bigger than 255, which is wrong. The set of default parameters that LLVM uses isn't subject to this bug. When carefully chosing the line table parameters, it's impossible to fall into the corner case that this patch fixes. The standard however doesn't require that these parameters be carefully chosen. And even if it did, we shouldn't generate broken encoding. Add a unittest for this specific encoding bug, and while at it, create some unit tests for the encoding logic using different sets of parameters. llvm-svn: 259334
* Replace usages of llvm::utostr_32 with just llvm::utostr. While this is less ↵Craig Topper2016-01-311-20/+20
| | | | | | efficient, its unclear the few places that were using the _32 version were doing so for efficiency. llvm-svn: 259330
* add helper function for minnum/maxnum ; NFCSanjay Patel2016-01-311-74/+80
| | | | llvm-svn: 259326
OpenPOWER on IntegriCloud