summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* MIR Serialization: Serialize simple MachineRegisterInfo attributes.Alex Lorenz2015-06-242-0/+29
| | | | | | | | | | | | | This commit serializes the 3 scalar boolean attributes from the MachineRegisterInfo class: IsSSA, TracksRegLiveness, and TracksSubRegLiveness. These attributes are serialized as part of the machine function YAML mapping. Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D10618 llvm-svn: 240579
* Use Symbol::getValue to simplify object::computeSymbolSizes. NFC.Rafael Espindola2015-06-241-4/+2
| | | | llvm-svn: 240575
* [LSR] canonicalize Prod*(1<<C) to Prod<<CJingyue Wu2015-06-241-5/+12
| | | | | | | | | | | | | | | | | | | | | Summary: Because LSR happens at a late stage where mul of a power of 2 is typically canonicalized to shl, this canonicalization emits code that can be better CSE'ed. Test Plan: Transforms/LoopStrengthReduce/shl.ll shows how this change makes GVN more powerful. Fixes some existing tests due to this change. Reviewers: sanjoy, majnemer, atrick Reviewed By: majnemer, atrick Subscribers: majnemer, llvm-commits Differential Revision: http://reviews.llvm.org/D10448 llvm-svn: 240573
* Use Symbol.getValue to simplify RuntimeDyldCOFF::getSymbolOffset. NFC.Rafael Espindola2015-06-241-17/+2
| | | | llvm-svn: 240572
* Add a SymbolRef::getValue.Rafael Espindola2015-06-242-17/+24
| | | | | | | | | This returns either the symbol offset or address. Since it is not defined which one, it never has to lookup the section and so never fails. I will add users in the next commit. llvm-svn: 240569
* Devirtualize Constant::replaceUsesOfWithOnConstant.Pete Cooper2015-06-243-60/+85
| | | | | | | | | | | | | | | | | | | | This is part of the work to devirtualize Value. The old pattern was to call replaceUsesOfWithOnConstant which was overridden by subclasses. Those could then call replaceUsesOfWithOnConstantImpl on Constant to handle deleting the current value. To be consistent with other parts of the code, this has been changed so that we call the method on Constant, and that dispatches to an Impl on subclasses. As part of this, it made sense to rename the methods to be more descriptive. The new name is Constant::handleOperandChange, and it requires that all subclasses of Constant implement handleOperandChangeImpl, even if they just throw an error if they shouldn't be called. Reviewed by Duncan Exon Smith. llvm-svn: 240567
* AsmPrinter: Cleanup DIEValue::EmitValue() API, NFCDuncan P. N. Exon Smith2015-06-243-14/+13
| | | | | | | | | Stop taking a `dwarf::Form` in `DIEValue::EmitValue()` and `DIEValue::SizeOf()`, since they're always passed `DIEValue::getForm()` anyway. This is just left over from when `DIEValue` didn't know its own form. llvm-svn: 240566
* Refactor duplicated code. NFC.Rafael Espindola2015-06-241-27/+19
| | | | llvm-svn: 240563
* [CaptureTracking] Avoid long compilation time on large basic blocksBruno Cardoso Lopes2015-06-242-25/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CaptureTracking becomes very expensive in large basic blocks while calling PointerMayBeCaptured. PointerMayBeCaptured scans the BB the number of times equal to the number of uses of 'BeforeHere', which is currently capped at 20 and bails out with Tracker->tooManyUses(). The bottleneck here is the number of calls to PointerMayBeCaptured * the basic block scan. In a testcase with a 82k instruction BB, PointerMayBeCaptured is called 130k times, leading to 'shouldExplore' taking 527k runs, this currently takes ~12min. To fix this we locally (within PointerMayBeCaptured) number the instructions in the basic block using a DenseMap to cache instruction positions/numbers. We build the cache incrementally every time we need to scan an unexplored part of the BB, improving compile time to only take ~2min. This triggers in the flow: DeadStoreElimination -> MepDepAnalysis -> CaptureTracking. Side note: after multiple runs in the test-suite I've seen no performance nor compile time regressions, but could note a couple of compile time improvements: Performance Improvements - Compile Time Delta Previous Current StdDev SingleSource/Benchmarks/Misc-C++/bigfib -4.48% 0.8547 0.8164 0.0022 MultiSource/Benchmarks/TSVC/LoopRerolling-dbl/LoopRerolling-dbl -1.47% 1.3912 1.3707 0.0056 Differential Revision: http://reviews.llvm.org/D7010 llvm-svn: 240560
* MIR Serialization: Serialize the null register operands.Alex Lorenz2015-06-244-4/+16
| | | | | | | | | | | | This commit serializes the null register machine operands. It uses the '_' keyword to represent them, but the parser also allows the '%noreg' named register syntax. Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D10580 llvm-svn: 240558
* [LoopVectorizer] Fix bailing-out condition for OptForSize case.Michael Zolotukhin2015-06-241-4/+3
| | | | | | | | | | With option OptForSize enabled, the Loop Vectorizer is not supposed to create tail loop. The condition checking that was invalid and was not matching to the comment above. Patch by Marianne Mailhot-Sarrasin. llvm-svn: 240556
* Simplify the logic, NFC.Rafael Espindola2015-06-241-12/+8
| | | | llvm-svn: 240554
* Eliminate additional redundant copies of Triple objects. NFC.Daniel Sanders2015-06-242-2/+2
| | | | | | | | Subscribers: rafael, llvm-commits, rengolin Differential Revision: http://reviews.llvm.org/D10654 llvm-svn: 240540
* Fix instruction scheduling live register trackingPawel Bylica2015-06-241-8/+17
| | | | | | | | | | | | | | | | | | | Summary: This patch fixes PR23405 (https://llvm.org/bugs/show_bug.cgi?id=23405). During a node unscheduling an entry in LiveRegGens can be replaced with a new value. That corrupts the live reg tracking and LiveReg* structure is not cleared as should be during unscheduling. Problematic condition that enforces Gen replacement is `I->getSUnit()->getHeight() < LiveRegGens[I->getReg()]->getHeight()`. This condition should be checked only if LiveRegGen was set in current node unscheduling. Test Plan: Regression test included. Reviewers: hfinkel, atrick Reviewed By: atrick Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9993 llvm-svn: 240538
* [mips][microMIPS] Implement BREAK, EHB and EI instructionsZoran Jovanovic2015-06-244-2/+63
| | | | | | http://reviews.llvm.org/D10090 llvm-svn: 240531
* Change how symbol sizes are handled in lib/Object.Rafael Espindola2015-06-247-32/+25
| | | | | | | | | | | | | | COFF and MachO only define symbol sizes for common symbols. Reflect that in the class hierarchy by having a method for common symbols only in the base and a general one in ELF. This avoids the need of using a magic value for the size, which had a few problems * Most callers didn't check for it. * The ones that did could not tell the magic value from a file actually having that value. llvm-svn: 240529
* Hexagon: Paper over the undefined behaviour introduced by r238692Justin Bogner2015-06-242-1/+3
| | | | | | | | | | | | | | | | This stops shifting a 32-bit value by such absurd amounts as 96 and 120. We do this by dropping a call to the function that was doing this entirely, which rather surprisingly doesn't break *any* tests. I've also added an assert in the misbehaving function to prove that it's no longer being called with completely invalid arguments. This change looks pretty bogus and we should probably be reverting r238692 instead, but this is hard to do with the number of follow ups that have happened since. It can't be any worse than the undefined behaviour that was happening before though. llvm-svn: 240526
* MILexer.cpp: Try to fix a warning. [-Wsign-compare]NAKAMURA Takumi2015-06-241-1/+1
| | | | llvm-svn: 240525
* [TableGen] Restore the use of the TheInit field in Record to cache the ↵Craig Topper2015-06-241-7/+3
| | | | | | Record's DefInit. I broke this when I fixed memory leaks recently. Remove the DenseMap that mapped Record's to DefInit. llvm-svn: 240524
* Hexagon: Avoid left shifting negative values (it's UB)Justin Bogner2015-06-241-1/+1
| | | | | | Found by ubsan. llvm-svn: 240521
* SystemZ: Rephrase this allOnes calculation to avoid UBJustin Bogner2015-06-241-1/+3
| | | | | | | | | | | | | This allOnes function hits undefined behaviour if Count is greater than 64, but we can avoid that and simplify the calculation by just saturating if such a value is passed in. This comes up under ubsan becauseRxSBGOperands is sometimes created with values that are 128 bits wide. Somebody more familiar with this code should probably look into whether that's expected, as a 64 bit mask may or may not be appropriate for such types. llvm-svn: 240520
* [X86] Don't generate vbroadcasti128 for v4i64 splats from memory.Ahmed Bougacha2015-06-241-4/+5
| | | | | | | | | | | | | | | | | | | | | We used to erroneously match: (v4i64 shuffle (v2i64 load), <0,0,0,0>) Whereas vbroadcasti128 is more like: (v4i64 shuffle (v2i64 load), <0,1,0,1>) This problem doesn't exist for vbroadcastf128, which kept matching the intrinsic after r231182. We should perhaps re-introduce the intrinsic here as well, but that's a separate issue still being discussed. While there, add some proper vbroadcastf128 tests. We don't currently match those, like for loading vbroadcastsd/ss on AVX (the reg-reg broadcasts where added in AVX2). Fixes PR23886. llvm-svn: 240488
* Remove unused GlobalVariable::replaceUsesOfWithOnConstant. NFC.Pete Cooper2015-06-241-20/+4
| | | | | | | | | | | | | | | The only caller of this method is Value::replaceAllUsesWith which explicitly checks that we are not a GlobalValue. So replace the body with an unreachable to ensure that we never call it. The unreachable itself is moved to GlobalValue not GlobalVariable as that is the base class of all the globals we don't want to call this method on. Note, this patch is short lived as i'll soon refactor all callers of this method. llvm-svn: 240486
* MIR Serialization: Serialize immediate machine operands.Alex Lorenz2015-06-234-2/+41
| | | | | | | | Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D10573 llvm-svn: 240481
* fix typo; NFCSanjay Patel2015-06-231-1/+1
| | | | llvm-svn: 240480
* don't repeat function names in comments; NFCSanjay Patel2015-06-231-18/+15
| | | | llvm-svn: 240478
* MIR Parser: Use correct source locations for machine instruction diagnostics.Alex Lorenz2015-06-231-2/+23
| | | | | | | | | | | | This commit translates the source locations for MIParser diagnostics from the locations in the machine instruction string to the locations in the MIR file. Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D10574 llvm-svn: 240474
* Devirtualize Constant::destroyConstant.Pete Cooper2015-06-232-29/+37
| | | | | | | | | | | | | | | This reorganizes destroyConstant and destroyConstantImpl. Now there is only destroyConstant in Constant itself, while subclasses are required to implement destroyConstantImpl. destroyConstantImpl no longer calls delete but is instead only responsible for removing the constant from any maps in which it is contained. Reviewed by Duncan Exon Smith. llvm-svn: 240471
* Let llvm::ReplaceInstWithInst copy debug location from old to new instruction.Alexey Samsonov2015-06-231-2/+5
| | | | | | | | | | | | | | Currently some users of this function do this explicitly, and all the rest forget to do this. ThreadSanitizer was one of such users, and had missing debug locations for calls into TSan runtime handling atomic operations, eventually leading to poorly symbolized stack traces and malfunctioning suppressions. This is another change relevant to PR23837. llvm-svn: 240460
* Revert "[FaultMaps] Move FaultMapParser to Object/"Sanjoy Das2015-06-233-62/+36
| | | | | | | This reverts commit r240364 (git c49542e5bb186). The issue r240364 was trying to fix was fixed independently in r240362. llvm-svn: 240448
* This change fixes three bugs in loop unswitching. This change causes an 81% ↵Mark Heffernan2015-06-231-40/+65
| | | | | | | | | | | | | | | speed-up on a benchmark that is based on EigenConvolutionKernel2D from Eigen3, where the lack of loop unswitching blocks hoisting of loads out of a nested loop (see bug 23816 for how loop unswitching and load hoisting are related). Change 1: Unswitching on trivial conditions should always happen regardless of the computed unswitching cost, as really the cost is zero. While there is code to make that happen, the logic that checks the unswitching cost against a threshold was moved to an earlier point (revision 147935) than the point where trivial unswitching is detected, so trivial unswitching is currently blocked by the cost threshold. This change fixes that. Change 2: Before revision 147935 (from 2012-01-11), the threshold parameter was a per-loop threshold. So an unswitching happened only if the cost of the unswitching was less than the threshold. In an indirect way (and I believe unintentionally), the logic for this since then has been that the threshold is an over-all budget across all loops for all loop unswitching done by a given LoopUnswitch loop pass object. So if an unswitching with cost 100 happens in one function, that in effect reduces the threshold from 100 to 0 for the loops even in another function. This persists for the lifetime of that loop pass object. This makes no difference for most small examples but it is important for large examples. This revision fixes that. Change 3: The cost is currently calculated as std::min(NumInstructions, 5 * NumBlocks). So a loop with 2 blocks and a million instructions will have an unswitching cost of 10. I changed this to just NumInstructions, as it were before revision 147935, though I'm open to e.g. instead replacing std::min with std::max. I've tried to make the change minimally invasive while staying with what I think was the original intent of the code. Submitted on behalf of broune@. llvm-svn: 240438
* ADT: Add a string APSInt constructor.Alex Lorenz2015-06-232-14/+20
| | | | | | | | | | | | This commit moves the APSInt initialization code that's used by the LLLexer class into a new APSInt constructor that constructs APSInts from strings. This change is useful for MIR Serialization, as it would allow the MILexer class to use the same APSInt initialization as LLexer when parsing immediate machine operands. llvm-svn: 240436
* AsmParser: Extend the API to make the global value and metadata node slot ↵Alex Lorenz2015-06-233-11/+27
| | | | | | | | | | | | | | | | | | mappings publicly accessible. This commit creates a new structure called 'SlotMapping' in the AsmParser library. This structure can be passed into the public parsing APIs from the AsmParser library in order to extract the data structures that map from slot numbers to unnamed global values and metadata nodes. This change is useful for MIR Serialization, as the MIR Parser has to lookup the unnamed global values and metadata nodes by their slot numbers. Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D10551 llvm-svn: 240427
* MIR Serialization: Serialize physical register machine operands.Alex Lorenz2015-06-234-4/+213
| | | | | | | | | | | This commit introduces functionality that's used to serialize machine operands. Only the physical register operands are serialized by this commit. Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D10525 llvm-svn: 240425
* [ARM] ARMLoadStoreOpt::UpdateBaseRegUses should stop on defJohn Brawn2015-06-231-1/+1
| | | | | | | | | | | | When UpdateBaseRegUses sees an instruction that defines the base register it must stop, as the base register value it is updating is no longer live. Ideally we would already have seen the register be killed (which is already checked for), but the kill flags may be inaccurate and we have to account for this. Differential Revision: http://reviews.llvm.org/D10566 llvm-svn: 240424
* SystemZ: Avoid left shifting negative values (it's UB)Justin Bogner2015-06-231-4/+4
| | | | | | Found by ubsan. llvm-svn: 240420
* [Option] Plug a leak when move-assigning an InputArgList.Benjamin Kramer2015-06-231-6/+6
| | | | | | | | The class has a non-trivial dtor so we have to clean up before we move in new members. Remove misleading comment as a default move assignment operator will never be synthesized for this class. llvm-svn: 240417
* Make helper functions static. NFC.Benjamin Kramer2015-06-232-4/+5
| | | | llvm-svn: 240416
* [BranchFolding] Document why replacing HashMachineInstr with hash_code ↵Benjamin Kramer2015-06-231-1/+3
| | | | | | doesn't work llvm-svn: 240415
* [MachineBasicBlock] Add getFirstNonDebugInstr to complement getLastNonDebugInstrBenjamin Kramer2015-06-234-70/+30
| | | | | | Use it in CodeGen where applicable. No functionality change intended. llvm-svn: 240414
* [MachineBasicBlock] Use the const_cast(this) trick to reduce duplicationBenjamin Kramer2015-06-231-25/+0
| | | | | | NFC. llvm-svn: 240413
* Be sure to set the DataLayout before checking the cache.Rafael Espindola2015-06-231-2/+2
| | | | | | | | This makes sure the same mangling is used. Should fix the OS X bots. llvm-svn: 240411
* [mips] [IAS] Add partial support for the ULHU pseudo-instruction.Toma Tabacu2015-06-232-0/+114
| | | | | | | | | | | | | | | | Summary: This only adds support for ULHU of an immediate address with/without a source register. It does not include support for ULHU of the address of a symbol. Reviewers: dsanders Reviewed By: dsanders Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9671 llvm-svn: 240410
* Remove unused arguments and move ManglerPrefixTy to the implementation.Rafael Espindola2015-06-231-13/+25
| | | | llvm-svn: 240408
* [mips] [IAS] Add support for generating DADDu to createAddu(). NFC.Toma Tabacu2015-06-231-7/+7
| | | | | | | | | | | | | | Summary: This isn't used right now, but it will be in some upcoming changes. Reviewers: dsanders Reviewed By: dsanders Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10568 llvm-svn: 240407
* Simplify the Mangler interface now that DataLayout is mandatory.Rafael Espindola2015-06-2311-37/+28
| | | | | | | We only need to pass in a DataLayout when mangling a raw string, not when constructing the mangler. llvm-svn: 240405
* [mips64] Emit correct addend for some PC-relative relocationsPetar Jovanovic2015-06-233-13/+10
| | | | | | | | | | | So far, LLVM has not emitted correct addend for N64 and N32 ABI. This patch fixes that. It also removes fixup from MCJIT for R_MIPS_PC16 relocation. Patch by Vladimir Radosavljevic. Differential Revision: http://reviews.llvm.org/D10565 llvm-svn: 240404
* [Hexagon] Use MF reference from parent class in HexagonPacketizerListKrzysztof Parzyszek2015-06-231-10/+7
| | | | llvm-svn: 240403
* [mips] [IAS] Move some function definitions to MipsTargetStreamer.cpp. NFC.Toma Tabacu2015-06-232-8/+13
| | | | | | | | | | | | | | Summary: For the sake of consistency and to make some upcoming changes a little less noisy. Reviewers: dsanders Reviewed By: dsanders Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10639 llvm-svn: 240398
* Use MCSymbols for FastISel.Rafael Espindola2015-06-238-31/+72
| | | | | | | | | | | The summary is that it moves the mangling earlier and replaces a few calls to .addExternalSymbol with addSym. I originally wanted to replace all the uses of addExternalSymbol with addSym, but noticed it was a lot of work and doesn't need to be done all at once. llvm-svn: 240395
OpenPOWER on IntegriCloud