summaryrefslogtreecommitdiffstats
path: root/llvm
Commit message (Collapse)AuthorAgeFilesLines
* Ignore !associated metadata with null argument.Evgeniy Stepanov2017-05-082-1/+10
| | | | | | | Fixes PR32577 (comment 10). Such metadata may legitimately appear in LTO. llvm-svn: 302485
* Relax Dwarf filecheck test for 32-bit hostsReid Kleckner2017-05-081-1/+2
| | | | llvm-svn: 302484
* Use the frame index side table for byval and inalloca argumentsReid Kleckner2017-05-088-108/+284
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: For inalloca functions, this is a very common code pattern: %argpack = type <{ i32, i32, i32 }> define void @f(%argpack* inalloca %args) { entry: %a = getelementptr inbounds %argpack, %argpack* %args, i32 0, i32 0 %b = getelementptr inbounds %argpack, %argpack* %args, i32 0, i32 1 %c = getelementptr inbounds %argpack, %argpack* %args, i32 0, i32 2 tail call void @llvm.dbg.declare(metadata i32* %a, ... "a") tail call void @llvm.dbg.declare(metadata i32* %c, ... "b") tail call void @llvm.dbg.declare(metadata i32* %b, ... "c") Even though these GEPs can be simplified to a constant offset from EBP or RSP, we don't do that at -O0, and each GEP is computed into a register. Registers used to compute argument addresses are typically spilled and clobbered very quickly after the initial computation, so live debug variable tracking loses information very quickly if we use DBG_VALUE instructions. This change moves processing of dbg.declare between argument lowering and basic block isel, so that we can ask if an argument has a frame index or not. If the argument lives in a register as is the case for byval arguments on some targets, then we don't put it in the side table and during ISel we emit DBG_VALUE instructions. Reviewers: aprantl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32980 llvm-svn: 302483
* Add basic test case for -instnamerSanjoy Das2017-05-081-0/+19
| | | | llvm-svn: 302482
* [InstNamer] Use range-forSanjoy Das2017-05-081-4/+3
| | | | llvm-svn: 302481
* [InstNamer] Don't check type of arguments (they're never void)Sanjoy Das2017-05-081-1/+1
| | | | llvm-svn: 302480
* Delete trailing whitespaceSanjoy Das2017-05-081-3/+3
| | | | llvm-svn: 302479
* [InstCombine] add tests from D32285 to show current problems; NFCSanjay Patel2017-05-081-0/+38
| | | | llvm-svn: 302475
* Add const to "DWARFDie &Die" in a few functions as they can't change the ↵Greg Clayton2017-05-082-4/+4
| | | | | | DWARFDie. llvm-svn: 302471
* Fix typoEugene Zemtsov2017-05-081-1/+1
| | | | llvm-svn: 302470
* Make it illegal for two Functions to point to the same DISubprogramAdrian Prantl2017-05-087-79/+220
| | | | | | | | | | | | | | | | As recently discussed on llvm-dev [1], this patch makes it illegal for two Functions to point to the same DISubprogram and updates FunctionCloner to also clone the debug info of a function to conform to the new requirement. To simplify the implementation it also factors out the creation of inlineAt locations from the Inliner into a general-purpose utility in DILocation. [1] http://lists.llvm.org/pipermail/llvm-dev/2017-May/112661.html <rdar://problem/31926379> Differential Revision: https://reviews.llvm.org/D32975 llvm-svn: 302469
* STLExtras: Fix enumerate() documentationMatthias Braun2017-05-081-1/+1
| | | | llvm-svn: 302467
* Fix typo "veify" to "verify".Greg Clayton2017-05-082-2/+2
| | | | llvm-svn: 302466
* [InstCombine] add folds for not-of-shift-rightSanjay Patel2017-05-082-21/+48
| | | | | | | | | | | | | | | This is another step towards getting rid of dyn_castNotVal, so we can recommit: https://reviews.llvm.org/rL300977 As the tests show, we were missing the lshr case for constants and both ashr/lshr vector splat folds. The ashr case with constant was being performed inefficiently in 2 steps. It's also possible there was a latent bug in that case because we can't do that fold if the constant is positive: http://rise4fun.com/Alive/Bge llvm-svn: 302465
* [PartialInlining] Capture by reference rather than by value.Davide Italiano2017-05-081-3/+3
| | | | llvm-svn: 302464
* ARM: use divmod libcalls on embedded MachO platforms too.Tim Northover2017-05-083-41/+39
| | | | | | | The separated libcalls are implemented in terms of __divmodsi4 and __udivmodsi4 anyway, so we should always use them if possible. llvm-svn: 302462
* Don't add DBG_VALUE instructions for static allocas in dbg.declareReid Kleckner2017-05-084-208/+0
| | | | | | | | | | | | | | | | | | | | | | | Summary: An llvm.dbg.declare of a static alloca is always added to the MachineFunction dbg variable map, so these values are entirely redundant. They survive all the way through codegen to be ignored by DWARF emission. Effectively revert r113967 Two bugpoint-reduced test cases from 2012 broke as a result of this change. Despite my best efforts, I haven't been able to rewrite the test case using dbg.value. I'm not too concerned about the lost coverage because these were reduced from the test-suite, which we still run. Reviewers: aprantl, dblaikie Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32920 llvm-svn: 302461
* Add some useful helper methods / operators to TypeIndex.Zachary Turner2017-05-081-0/+55
| | | | llvm-svn: 302460
* Update instructions for using the experimental monorepoReid Kleckner2017-05-081-2/+2
| | | | llvm-svn: 302459
* [BitVector] Make find_prev member function const.Zachary Turner2017-05-081-1/+1
| | | | | | NFC. llvm-svn: 302458
* Add a blurb to the release notes about the WeakVH -> WeakTrackingVH transitionSanjoy Das2017-05-081-0/+4
| | | | llvm-svn: 302456
* [CodeView] Add support for random access type visitors.Zachary Turner2017-05-088-35/+197
| | | | | | | | | | | | | | | | | | | | | | | Previously type visitation was done strictly sequentially, and TypeIndexes were computed by incrementing the TypeIndex of the last visited record. This works fine for situations like dumping, but not when you want to visit types in random order. For example, in a debug session someone might lookup a symbol by name, find that it has TypeIndex 10,000 and then want to go straight to TypeIndex 10,000. In order to make this work, the visitation framework needs a mode where it can plumb TypeIndices through the callback pipeline. This patch adds such a mode. In doing so, it is necessary to provide an alternative implementation of TypeDatabase that supports random access, so that is done as well. Nothing actually uses these random access capabilities yet, but this will be done in subsequent patches. Differential Revision: https://reviews.llvm.org/D32928 llvm-svn: 302454
* [AArch64][RegisterBankInfo] Change the default mapping of fp loads.Quentin Colombet2017-05-082-0/+64
| | | | | | | | | | | This fixes PR32550, in a way that does not imply running the greedy mode at O0. The fix consists in checking if a load is used by any floating point instruction and if yes, we return a default mapping with FPR instead of GPR. llvm-svn: 302453
* [AArch64][RegisterBankInfo] Fix mapping cost for GPR.Quentin Colombet2017-05-081-1/+1
| | | | | | | | | | | | | | | | In r292478, we changed the order of the enum that is referenced by PMI_FirstXXX. This had the side effect of changing the cost of the mapping of all the loads, instead of just the FPRs ones. Reinstate the higher cost for all but GPR loads. Note: This did not have any external visible effects: - For Fast mode, the cost would have been higher, but we don't care because we don't try to use alternative mappings. - For Greedy mode, the higher cost of the GPR loads, would have triggered the use of the supposedly alternative mapping, that would be in fact the same GPR mapping but with a lower cost. llvm-svn: 302452
* [InstCombine] move/add tests for not(shr (not X), Y); NFCSanjay Patel2017-05-082-17/+60
| | | | llvm-svn: 302451
* [ARM] Use a Changed flag to avoid making a pass's return value dependent on ↵Craig Topper2017-05-081-1/+3
| | | | | | | | | | a compare with a Statistic object. Statistic compile to always be 0 in release build so this compare would always return false. And in the debug builds Statistic are global variables and remember their values across pass runs. So this compare returns true anytime the pass runs after the first time it modifies something. This was found after reviewing all usages of comparison operators on a Statistic object. We had some internal code that did a compare with a statistic that caused a mismatch in output between debug and release builds. So we did an audit out of paranoia. llvm-svn: 302450
* [SCEV] Make setRange take ConstantRange by value instead of rvalue reference ↵Craig Topper2017-05-081-1/+1
| | | | | | so we don't force anything on the caller. llvm-svn: 302449
* [SCEV] Don't use std::move on both inputs to APInt::operator+ or operator-. ↵Craig Topper2017-05-081-4/+4
| | | | | | It might be confusing to the reader. NFC llvm-svn: 302448
* ConstantFold: Handle gep nonnull, undef as wellDaniel Berlin2017-05-082-4/+5
| | | | llvm-svn: 302447
* ConstantFold: Fold getelementptr (i32, i32* null, i64 undef) to null.Daniel Berlin2017-05-083-6/+6
| | | | | | | | Transforms/IndVarSimplify/2011-10-27-lftrnull will fail if this regresses. Transforms/GVN/PRE/2011-06-01-NonLocalMemdepMiscompile.ll has been changed to still test what it was trying to test. llvm-svn: 302446
* [ValueTracking] Use KnownOnes to provide a better bound on known zeros for ↵Craig Topper2017-05-082-7/+41
| | | | | | | | | | ctlz/cttz intrinics This patch uses KnownOnes of the input of ctlz/cttz to bound the value that can be returned from these intrinsics. This makes these intrinsics more similar to the handling for ctpop which already uses known bits to produce a similar bound. Differential Revision: https://reviews.llvm.org/D32521 llvm-svn: 302444
* [X86] Split test configurations. NFC.Zvi Rackover2017-05-081-107/+266
| | | | | | Split test that includes reproducer for pr32967 to KNL and SKX. llvm-svn: 302442
* [InstSimplify] fix typo; NFCSanjay Patel2017-05-081-1/+1
| | | | llvm-svn: 302439
* [InstCombine] use local variable to reduce code duplication; NFCISanjay Patel2017-05-081-14/+11
| | | | llvm-svn: 302438
* [ValueTracking] Introduce a version of computeKnownBits that returns a ↵Craig Topper2017-05-082-67/+57
| | | | | | | | | | | | | | | | KnownBits struct. Begin using it to replace internal usages of ComputeSignBit This introduces a new interface for computeKnownBits that returns the KnownBits object instead of requiring it to be pre-constructed and passed in by reference. This is a much more convenient interface as it doesn't require the caller to figure out the BitWidth to pre-construct the object. It's so convenient that I believe we can use this interface to remove the special ComputeSignBit flavor of computeKnownBits. As a step towards that idea, this patch replaces all of the internal usages of ComputeSignBit with this new interface. As you can see from the patch there were a couple places where we called ComputeSignBit which really called computeKnownBits, and then called computeKnownBits again directly. I've reduced those places to only making one call to computeKnownBits. I bet there are probably external users that do it too. A future patch will update the external users and remove the ComputeSignBit interface. I'll also working on moving more locations to the KnownBits returning interface for computeKnownBits. Differential Revision: https://reviews.llvm.org/D32848 llvm-svn: 302437
* [InstCombine/InstSimplify] add comments about code duplication; NFCSanjay Patel2017-05-082-0/+6
| | | | llvm-svn: 302436
* [InstCombine] add another test for PR32949; NFCSanjay Patel2017-05-081-0/+13
| | | | | | | A patch for the InstSimplify variant of this bug is up for review here: https://reviews.llvm.org/D32954 llvm-svn: 302434
* InstructionSimplify: Refactor foldIdentityShuffles. NFC.Zvi Rackover2017-05-081-13/+7
| | | | | | | | | | | | | | | | | | | Summary: Minor refactoring of foldIdentityShuffles() which allows the removal of a ConstantDataVector::get() in SimplifyShuffleVectorInstruction. Reviewers: spatel Reviewed By: spatel Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32955 Conflicts: lib/Analysis/InstructionSimplify.cpp llvm-svn: 302433
* Fix comment typos.Geoff Berry2017-05-082-2/+2
| | | | llvm-svn: 302432
* Adding reproducer for pr32967. NFC.Zvi Rackover2017-05-081-0/+27
| | | | llvm-svn: 302426
* [X86][SSE] Improve combineLogicBlendIntoPBLENDV to use general masks.Simon Pilgrim2017-05-084-58/+34
| | | | | | | | | | | | | | | Currently combineLogicBlendIntoPBLENDV can only match ASHR to detect sign splatting of a bit mask, this patch generalises this to use computeNumSignBits instead. This is a first step in several things we can do to improve PBLENDV support: * Better matching of X86ISD::ANDNP patterns. * Handle floating point cases. * Better vector and bitcast support in computeNumSignBits. * Recognise that PBLENDV only uses the sign bit of the mask, we should be able strip away sign splats (ASHR, PCMPGT isNeg tests etc.). Differential Revision: https://reviews.llvm.org/D32953 llvm-svn: 302424
* Normalize line endings. NFCI,Simon Pilgrim2017-05-082-44/+44
| | | | llvm-svn: 302422
* IR: Add a shufflevector mask commutation helper function. NFC.Zvi Rackover2017-05-083-7/+21
| | | | | | | | | | | | | | | | Summary: Following up on Sanjay's suggetion in D32955, move this functionality into ShuffleVectornstruction. Reviewers: spatel, RKSimon Reviewed By: RKSimon Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32956 llvm-svn: 302420
* [ARM][NEON] Add support for ISD::ABS lowering Simon Pilgrim2017-05-083-26/+43
| | | | | | | | | | Update NEON int_arm_neon_vabs intrinsic to use the ISD::ABS opcode directly Added constant folding tests. Differential Revision: https://reviews.llvm.org/D32938 llvm-svn: 302417
* [ARM] Clear the constant pool cache on explicit .ltorg directivesMartin Storsjo2017-05-084-0/+42
| | | | | | | | | | | | | | | | | | | | | | Multiple ldr pseudoinstructions with the same constant value will reuse the same constant pool entry. However, if the constant pool is explicitly flushed with a .ltorg directive, we should not try to reference constants in the previous pool any longer, since they may be out of range. This fixes assembling hand-written assembler source which repeatedly loads the same constant value, across a binary size larger than the pc-relative fixup range for ldr instructions (4096 bytes). Such assembler source already uses explicit .ltorg instructions to emit constant pools with regular intervals. However if we try to reuse constants emitted in earlier pools, they end up out of range. This makes the output of the testcase match what binutils gas does (prior to this patch, it would fail to assemble). Differential Revision: https://reviews.llvm.org/D32847 llvm-svn: 302416
* [AARCH64][NEON] Add support for ISD::ABS lowering Simon Pilgrim2017-05-082-40/+22
| | | | | | | | Update int_aarch64_neon_abs intrinsic to use the ISD::ABS opcode directly Differential Revision: https://reviews.llvm.org/D32940 llvm-svn: 302415
* [GlobalISel][X86] G_GEP selection support.Igor Breger2017-05-086-10/+339
| | | | | | | | | | | | | | Summary: [GlobalISel][X86] G_GEP selection support. Reviewers: zvi, guyblank Reviewed By: guyblank Subscribers: dberris, rovka, llvm-commits, kristof.beyls Differential Revision: https://reviews.llvm.org/D32396 llvm-svn: 302412
* [GlobalISel][X86] G_MUL legalizer/selector support.Igor Breger2017-05-0813-2/+1364
| | | | | | | | | | | | | | | | | Summary: G_MUL legalizer/selector/regbank support. Use only Tablegen-erated instruction selection. This patch dealing with legal operations only. Reviewers: zvi, guyblank Reviewed By: guyblank Subscribers: krytarowski, rovka, kristof.beyls, llvm-commits Differential Revision: https://reviews.llvm.org/D32698 llvm-svn: 302410
* [Lit] Fix to prevent creation of "%SystemDrive%" directory on Windows.Andrew Ng2017-05-081-0/+4
| | | | | | | | | | | | | | This patch propogates the environment variable SYSTEMDRIVE on Windows when running the unit tests. This prevents the creation of a directory named "%SystemDrive%" when running the unit tests from FileSystemTest that use the function llvm::sys::fs::remove_directories which in turn uses SHFileOperationW. It is within SHFileOperationW that this environment variable may be used and if undefined causes the creation of a "%SystemDrive%" directory in the current directory. Differential Revision: https://reviews.llvm.org/D32910 llvm-svn: 302409
* [APInt] Modify tcMultiplyPart's overflow detection to not depend on 'i' from ↵Craig Topper2017-05-081-6/+5
| | | | | | | | the earlier loop. NFC The value of 'i' is always the smaller of DstParts and SrcParts so we can just use that fact to write all the code in terms of SrcParts and DstParts. llvm-svn: 302408
OpenPOWER on IntegriCloud