summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
* R600 -> AMDGPU renameTom Stellard2015-06-13125-40/+40
| | | | llvm-svn: 239657
* Revert 239644.Matt Wala2015-06-131-3/+1
| | | | llvm-svn: 239650
* AArch64: map bare-metal arm64-macho triple to MachO MC layer.Tim Northover2015-06-122-2/+2
| | | | | | Far better than an assertion about expecting ELF. llvm-svn: 239647
* Fix returning error message in LLVMLinkModulesEli Bendersky2015-06-121-1/+3
| | | | | | | | | | | On error, the temporary output stream wouldn't be flushed and therefore the caller would see an empty error message. Patch by Antoine Pitrou Differential Revision: http://reviews.llvm.org/D10241 llvm-svn: 239646
* [Scalarizer] Fix potential for stale data in Scattered across invocationsMatt Wala2015-06-121-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Scalarizer has two data structures that hold information about changes to the function, Gathered and Scattered. These are cleared in finish() at the end of runOnFunction() if finish() detects any changes to the function. However, finish() was checking for changes by only checking if Gathered was non-empty. The function visitStore() only modifies Scattered without touching Gathered. As a result, Scattered could have ended up having stale data if Scalarizer only scalarized store instructions. Since the data in Scattered is used during the execution of the pass, this introduced dangling pointer errors. The fix is to check whether both Scattered and Gathered are empty before deciding what to do in finish(). Reviewers: srhines Reviewed By: srhines Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10422 llvm-svn: 239644
* [Orc] Fix a bug in the CompileOnDemand layer where stub decls were not clonedLang Hames2015-06-121-2/+0
| | | | | | | | | | | into partitions. Also, add an option to clone stub definitions (not just decls) into partitions: these definitions could be inlined in some places to avoid the overhead of calling via the stub. Found by inspection - no test case yet, although I plan to add a unit test for this once the CompileOnDemand layer refactoring settles down. llvm-svn: 239640
* R600/SI: Add assembler support for FLAT instructionsTom Stellard2015-06-124-89/+194
| | | | | | | | - Add glc, slc, and tfe operands to flat instructions - Add missing flat instructions - Fix the encoding of flat_load_dwordx3 and flat_store_dwordx3. llvm-svn: 239637
* Rangify several for loops in ValueEnumerator constructor.Yaron Keren2015-06-121-22/+18
| | | | llvm-svn: 239636
* [Hexagon] Making intrinsic tests agnostic to register allocation. Narrowing ↵Colin LeMahieu2015-06-123-11/+71
| | | | | | intrinsic parameters to appropriate width. llvm-svn: 239634
* Wrap some long lines in LLVMBuild files. NFCDouglas Katzman2015-06-126-8/+85
| | | | | | | As suggested by jroelofs in a prior review (D9752), it makes sense to generally prefer multi-line format. llvm-svn: 239632
* Add 'shave' processor name to TripleDouglas Katzman2015-06-121-0/+7
| | | | | | | | | | Based on ArchType, Clang's driver can select a non-Clang compiler. String parsing in Clang would have sufficed if it were only that, however this change anticipates true llvm support. Differential Revision: http://reviews.llvm.org/D10413 llvm-svn: 239631
* Refix a use of explicit pointer types in GEP constant foldingDavid Blaikie2015-06-121-4/+4
| | | | | | | | | | | | | | | | | In the glorious future of opaque pointer types, it won't be possible to retrieve the pointee type of a pointer type which is what's being done in this GEP loop - but the first iteration is always a pointer type and the loop doesn't care about that case, except whether or not the index is a constant. So pull that special case out before the loop and start at the second iteration (index 1) instead. Originally committed in r236670 and reverted with a test case in r239015. This change keeps the test case working while also avoiding depending on pointee types. llvm-svn: 239629
* Fix a typo in a comment in MemCpyOpt (test commit)Matt Wala2015-06-121-1/+1
| | | | llvm-svn: 239628
* Rangify two for loops in BitcodeReader.cpp.Yaron Keren2015-06-121-10/+5
| | | | llvm-svn: 239627
* Move OperandList to be allocated prior to User for hung off subclasses.Pete Cooper2015-06-121-11/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For hung off uses, we need a Use* to tell use where the operands are. This was User::OperandList but we want to remove that to save space of all subclasses which aren't making use of 'hung off uses'. Hung off uses now allocate their own 'OperandList' Use* in the User::new which they call. getOperandList() now uses the hung off uses bit to work out where the Use* for the OperandList lives. If a User has hung off uses, then this bit tells them to go back a single Use* from the User* and use that value as the OperandList. If a User has no hung off uses, then we get the first operand by subtracting (NumOperands * sizeof(Use)) from the User this pointer. This saves a pointer from User and all subclasses. Given the average size of a subclass of User is 112 or 128 bytes, this saves around 7% of space With malloc tending to align to 16-bytes the real saving is typically more like 3.5%. On 'opt -O2 verify-uselistorder.lto.bc', peak memory usage prior to this change is 149MB and after is 143MB so the savings are around 2.5% of peak. Looking at some passes which allocate many Instructions and Values, parseIR drops from 54.25MB to 52.21MB while the Inliner calls to Instruction::clone() drops from 28.20MB to 27.05MB. Reviewed by Duncan Exon Smith. llvm-svn: 239623
* Added a version of User::new for hung off uses.Pete Cooper2015-06-121-4/+12
| | | | | | | | | | | | | | | | | There are now 2 versions of User::new. The first takes a size_t and is the current implementation for subclasses which need 0 or more Use's allocated for their operands. The new version takes no extra arguments to say that this subclass needs 'hung off uses'. The HungOffUses bool is now set in this version of User::new and we can assert in allocHungOffUses that we are allowed to have hung off uses. This ensures we call the correct version of User::new for subclasses which need hung off uses. A future commit will then allocate space for a single Use* which will be used in place of User::OperandList once that field has been removed. Reviewed by Duncan Exon Smith. llvm-svn: 239622
* Rename NumOperands to make it clear its managed by the User. NFC.Pete Cooper2015-06-124-24/+33
| | | | | | | | | | | | | | | | | | | | | This is to try make it very clear that subclasses shouldn't be changing the value directly. Now that OperandList for normal instructions is computed using the NumOperands, its critical that the NumOperands is accurate or we could compute the wrong offset to the first operand. I looked over all places which update NumOperands and they are all safe. Hung off use User's don't use NumOperands to compute the OperandList so they are safe to continue to manipulate it. The only other User which changed it was GlobalVariable which has an optional init list but always allocated space for a single Use. It was correctly setting NumOperands to 1 before setting an initializer, and setting it to 0 after clearing the init list, so the order was safe. Added some comments to that code to make sure that this isn't changed in future without being aware of this constraint. Reviewed by Duncan Exon Smith. llvm-svn: 239621
* Replace all accesses to User::OperandList with getter and setter methods. NFC.Pete Cooper2015-06-123-11/+19
| | | | | | | | | | We don't want anyone to access OperandList directly as its going to be removed and computed instead. This uses getter's and setter's instead in which we can later change the underlying implementation of OperandList. Reviewed by Duncan Exon Smith. llvm-svn: 239620
* Don't create instructions from ConstantExpr's in CFLAliasAnalysis.Pete Cooper2015-06-121-12/+41
| | | | | | | | | | The CFLAA code currently calls ConstantExpr::getAsInstruction which creates an instruction from a constant expr. We then pass that instruction to the InstVisitor to analyze it. Its not necessary to create these instructions as we can just cast from Constant to Operator in the visitor. This is how other InstVisitor’s such as SelectionDAGBuilder handle ConstantExpr. llvm-svn: 239616
* Remove a hack that tries to align '*'.Rafael Espindola2015-06-121-1/+1
| | | | | | | | | | | | The alignment is not required, so we can just remove it for now. The old code is a hack as it depends on the buffer management to find the current column. If the alignment is really desirable, the proper way to do it is to pass in a formatted_raw_stream that knows the current column. llvm-svn: 239603
* [ASan] format AddressSanitizer.cpp with `clang-format -style=Google`, NFCAlexander Potapenko2015-06-121-12/+8
| | | | llvm-svn: 239601
* [ARM] Disabling vfp4 should disable fp16John Brawn2015-06-121-1/+5
| | | | | | | | | | | ARMTargetParser::getFPUFeatures should disable fp16 whenever it disables vfp4, as otherwise something like -mcpu=cortex-a7 -mfpu=none leaves us with fp16 enabled (though the only effect that will have is a wrong build attribute). Differential Revision: http://reviews.llvm.org/D10397 llvm-svn: 239599
* Rangify for loops, NFC.Yaron Keren2015-06-121-8/+6
| | | | llvm-svn: 239596
* LowerBitSets: Give names to aliases of unnamed bitset element objects.Peter Collingbourne2015-06-121-2/+3
| | | | | | | | It is valid for globals to be unnamed, but aliases must have a name. To avoid creating invalid IR, we need to assign names to any aliases we create that point to unnamed objects that have been moved into combined globals. llvm-svn: 239590
* Revert commit r239480 as it causes ↵Teresa Johnson2015-06-123-109/+0
| | | | | | https://code.google.com/p/chromium/issues/detail?id=499508#c3. llvm-svn: 239589
* [SanitizerCoverage] Use llvm::getDISubprogram() to get location of the entry ↵Alexey Samsonov2015-06-121-3/+9
| | | | | | | | | | | basic block. DebugLoc::getFnDebugLoc() should soon be removed. Also, getDISubprogram() might become more effective soon and wouldn't need to scan debug locations at all, if function-level metadata would be emitted by Clang. llvm-svn: 239586
* [GVN] Use a simpler form of IRBuilder constructor.Alexey Samsonov2015-06-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: A side effect of this change is that it IRBuilder now automatically created debug info locations for new instructions, which is the same as debug location of insertion point. This is fine for the functions in questions (GetStoreValueForLoad and GetMemInstValueForLoad), as they are used in two situations: * GVN::processLoad, which tries to eliminate a load. In this case new instructions would have the same debug location as the load they eventually replace; * MaterializeAdjustedValue, which adds new instructions to the end of the basic blocks, which could later be used to replace the load definition. In this case we don't yet know the way the load would be eventually replaced (either by assembling the precomputed values via PHI, or by using them directly), so just using the basic block strategy seems to be reasonable. There is also a special case in the code that *would* adjust the location of the last instruction replacing the load definition to the location of the load. Test Plan: regression test suite Reviewers: echristo, dberlin, dblaikie Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10405 llvm-svn: 239585
* [GVN] Use IRBuilder more actively instead of creating instructions manually.Alexey Samsonov2015-06-121-20/+21
| | | | llvm-svn: 239584
* [WinEH] Put finally pointers in the handler scope table fieldReid Kleckner2015-06-112-15/+14
| | | | | | | | | | We were putting them in the filter field, which is correct for 64-bit but wrong for 32-bit. Also switch the order of scope table entry emission so outermost entries are emitted first, and fix an obvious state assignment bug. llvm-svn: 239574
* [Stackmaps][X86] Remove EFLAGS and IP registers from the live-out mask.Juergen Ributzka2015-06-112-0/+18
| | | | | | | | | | | | | Remove the EFLAGS from the stackmap live-out mask. The EFLAGS register is not supposed to be part of that set, because the X86 calling conventions mark the register as NOT preserved. Also remove the IP registers, since spilling and restoring those doesn't really make any sense. Related to rdar://problem/21019635. llvm-svn: 239568
* [WinEH] Create an llvm.x86.seh.exceptioninfo intrinsicReid Kleckner2015-06-114-55/+64
| | | | | | | | | | | | | | This intrinsic is like framerecover plus a load. It recovers the EH registration stack allocation from the parent frame and loads the exception information field out of it, giving back a pointer to an EXCEPTION_POINTERS struct. It's designed for clang to use in SEH filter expressions instead of accessing the EXCEPTION_POINTERS parameter that is available on x64. This required a minor change to MC to allow defining a label variable to another absolute framerecover label variable. llvm-svn: 239567
* [Support] Fix a race initializing a static local in MSVCReid Kleckner2015-06-111-1/+9
| | | | | | | | | static local initialization isn't thread safe with MSVC and a race was reported in PR23817. We can't use std::atomic because it's not trivially constructible, so instead do some lame volatile global integer manipulation. llvm-svn: 239566
* Update stale comment before analyzeLoopUnrollCost. NFC.Michael Zolotukhin2015-06-111-7/+9
| | | | llvm-svn: 239565
* Object: Prepend __imp_ when mangling a dllimport symbol in IRObjectFile.Peter Collingbourne2015-06-111-0/+3
| | | | | | | | | | | | | | | | | We cannot prepend __imp_ in the IR mangler because a function reference may be emitted unmangled in a constant initializer. The linker is expected to resolve such references to thunks. This is covered by the new test case. Strictly speaking we ought to emit two undefined symbols, one with __imp_ and one without, as we cannot know which symbol the final object file will refer to. However, this would require rather intrusive changes to IRObjectFile, and lld works fine without it for now. This reimplements r239437, which was reverted in r239502. Differential Revision: http://reviews.llvm.org/D10400 llvm-svn: 239560
* LTO: expose LTO_SYMBOL_COMDAT flag, which indicates that the definition is ↵Peter Collingbourne2015-06-111-0/+3
| | | | | | | | | | | | part of a comdat group. Reviewers: rafael Subscribers: llvm-commits, ruiu Differential Revision: http://reviews.llvm.org/D10330 llvm-svn: 239559
* Replace string GNU Triples with llvm::Triple in TargetMachine. NFC.Daniel Sanders2015-06-1129-188/+183
| | | | | | | | | | | | | | | | | | Summary: For the moment, TargetMachine::getTargetTriple() still returns a StringRef. This continues the patch series to eliminate StringRef forms of GNU triples from the internals of LLVM that began in r239036. Reviewers: rengolin Reviewed By: rengolin Subscribers: ted, llvm-commits, rengolin, jholewinski Differential Revision: http://reviews.llvm.org/D10362 llvm-svn: 239554
* [CodeGen] ArrayRef'ize cond/pred in various TII APIs. NFC.Ahmed Bougacha2015-06-1129-119/+88
| | | | llvm-svn: 239553
* Generalize emitAbsoluteSymbolDiff.Rafael Espindola2015-06-113-28/+26
| | | | | | | | | | This makes emitAbsoluteSymbolDiff always succeed and moves logic from the asm printer to it. The object one now also works on ELF. If two symbols are in the same fragment, we will never move them apart. llvm-svn: 239552
* Set proper debug location for branch added in BasicBlock::splitBasicBlock().Alexey Samsonov2015-06-111-1/+4
| | | | | | | | | | | | | | | | This improves debug locations in passes that do a lot of basic block transformations. Important case is LoopUnroll pass, the test for correct debug locations accompanies this change. Test Plan: regression test suite Reviewers: dblaikie, sanjoy Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10367 llvm-svn: 239551
* [LoopUnroll] Use IRBuilder to create branch instructions.Alexey Samsonov2015-06-111-10/+9
| | | | | | | | | | | | | | | | | | Use IRBuilder::Create(Cond)?Br instead of constructing instructions manually with BranchInst::Create(). It's consistent with other uses of IRBuilder in this pass, and has an additional important benefit: Using IRBuilder will ensure that new branch instruction will get the same debug location as original terminator instruction it will eventually replace. For now I'm not adding a testcase, as currently original terminator instruction also lack debug location due to missing debug location propagation in BasicBlock::splitBasicBlock. That is, the testcase will accompany the fix for the latter I'm going to mail soon. llvm-svn: 239550
* Replace an instance of custom atomics with standard ones.Benjamin Kramer2015-06-111-3/+3
| | | | | | | Eventually I want to get rid of them entirely, but Statistic.h is still blocked on MSVC bugs. No functionality change. llvm-svn: 239545
* This reverts commit r239529 and r239514.Rafael Espindola2015-06-116-419/+0
| | | | | | | | | Revert "[AArch64] Match interleaved memory accesses into ldN/stN instructions." Revert "Fixing MSVC 2013 build error." The test/CodeGen/AArch64/aarch64-interleaved-accesses.ll test was failing on OS X. llvm-svn: 239544
* Revert "Fix merges of non-zero vector stores"Reid Kleckner2015-06-111-19/+6
| | | | | | | | This reverts commit r239539. It was causing SDAG assertions while building freetype. llvm-svn: 239543
* SLSR: Pass address space to isLegalAddressingModeMatt Arsenault2015-06-111-1/+3
| | | | | | | | | This only updates one of the uses. The other is used in cases that may never touch memory, so I'm not sure why this is even calling it. Perhaps there should be a new, similar hook for such cases or pass -1 for unknown address space. llvm-svn: 239540
* Fix merges of non-zero vector storesMatt Arsenault2015-06-111-6/+19
| | | | | | | | | | Now actually stores the non-zero constant instead of 0. I somehow forgot to include this part of r238108. The test change was just an independent instruction order swap, so just add another check line to satisfy CHECK-NEXT. llvm-svn: 239539
* Replace string GNU Triples with llvm::Triple in computeDataLayout(). NFC.Daniel Sanders2015-06-115-27/+24
| | | | | | | | | | | | | | | | Summary: This continues the patch series to eliminate StringRef forms of GNU triples from the internals of LLVM that began in r239036. Reviewers: rengolin Reviewed By: rengolin Subscribers: llvm-commits, jfb, rengolin Differential Revision: http://reviews.llvm.org/D10361 llvm-svn: 239538
* R600/SI: Define latency for flat instructionsTom Stellard2015-06-111-0/+1
| | | | llvm-svn: 239535
* R600/SI: Move flat instruction defs to CIInstructions.tdTom Stellard2015-06-112-108/+110
| | | | llvm-svn: 239534
* remove function names from comments; NFCSanjay Patel2015-06-111-15/+13
| | | | llvm-svn: 239532
* Fixing MSVC 2013 build error.Aaron Ballman2015-06-111-0/+1
| | | | llvm-svn: 239529
OpenPOWER on IntegriCloud