summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* CodeGen: Use MachineInstr& more in MachineTraceMetrics, NFCDuncan P. N. Exon Smith2016-07-011-20/+20
| | | | | | | | Push MachineInstr& through helper APIs for consistency. This doesn't remove any more implicit conversions, but it's a nice cleanup after r274300. llvm-svn: 274301
* CodeGen: Use MachineInstr& in MachineTraceMetrics, NFCDuncan P. N. Exon Smith2016-06-301-14/+14
| | | | | | This avoids an implicit conversion from iterator to pointer. llvm-svn: 274300
* CodeGen: Use MachineInstr& in LocalStackSlotAllocation, NFCDuncan P. N. Exon Smith2016-06-301-35/+29
| | | | | | | Avoid a number of implicit conversions from iterator to pointer by using range-based for and MachineInstr&. llvm-svn: 274298
* CodeGen: Use range-based for in LiveVariables, NFCDuncan P. N. Exon Smith2016-06-301-6/+4
| | | | | | | Avoid an implicit iterator to pointer conversion in LiveVariables::runOnBlock by switching to a range-based for. llvm-svn: 274297
* CodeGen: Use MachineInstr& in HoistSpillHelper, NFCDuncan P. N. Exon Smith2016-06-301-14/+15
| | | | | | Avoid another few implicit conversions from iterator to pointer. llvm-svn: 274295
* CodeGen: Use MachineInstr& in LDVImpl::handleDebugValue, NFCDuncan P. N. Exon Smith2016-06-301-14/+13
| | | | | | Avoid another implicit conversion from iterator to pointer. llvm-svn: 274294
* CodeGen: Use MachineInstr& in ExpandISelPseudos, NFCDuncan P. N. Exon Smith2016-06-301-3/+3
| | | | | | | Avoid another implicit conversion from MachineInstrBundleIterator to MachineInstr* by using MachineInstr&. llvm-svn: 274292
* CodeGen: Use MachineInstr& in IfConversion, NFCDuncan P. N. Exon Smith2016-06-301-9/+9
| | | | | | | | Switch to a range-based for in IfConverter::PredicateBlock and take MachineInstr& in MaySpeculate to avoid an implicit conversion from MachineBasicBlock::iterator to MachineInstr*. llvm-svn: 274290
* CodeGen: Use MachineInstr& in TargetLowering, NFCDuncan P. N. Exon Smith2016-06-304-8/+8
| | | | | | | | | | | | | This is a mechanical change to make TargetLowering API take MachineInstr& (instead of MachineInstr*), since the argument is expected to be a valid MachineInstr. In one case, changed a parameter from MachineInstr* to MachineBasicBlock::iterator, since it was used as an insertion point. As a side effect, this removes a bunch of MachineInstr* to MachineBasicBlock::iterator implicit conversions, a necessary step toward fixing PR26753. llvm-svn: 274287
* Add an artificial line-0 debug location when the compiler emits a call toYunzhong Gao2016-06-301-0/+2
| | | | | | | | __stack_chk_fail(). This avoids a compiler crash. Differential Revision: http://reviews.llvm.org/D21818 llvm-svn: 274263
* Delete MCCodeGenInfo.Rafael Espindola2016-06-301-1/+4
| | | | | | | MC doesn't really care about CodeGen stuff, so this was just complicating target initialization. llvm-svn: 274258
* revert http://reviews.llvm.org/D21101Etienne Bergeron2016-06-301-39/+0
| | | | llvm-svn: 274251
* [exceptions] Upgrade exception handlers when stack protector is usedEtienne Bergeron2016-06-301-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: MSVC provide exception handlers with enhanced information to deal with security buffer feature (/GS). To be more secure, the security cookies (GS and SEH) are validated when unwinding the stack. The following code: ``` void f() {} void foo() { __try { f(); } __except(1) { f(); } } ``` Reviewers: majnemer, rnk Subscribers: thakis, llvm-commits, chrisha Differential Revision: http://reviews.llvm.org/D21101 llvm-svn: 274239
* Delete unused includes. NFC.Rafael Espindola2016-06-308-7/+1
| | | | llvm-svn: 274225
* [CodeView] Implement support for bitfields in LLVMDavid Majnemer2016-06-301-11/+21
| | | | | | | | | | | | | CodeView need to know the offset of the storage allocation for a bitfield. Encode this via the "extraData" field in DIDerivedType and introduced a new flag, DIFlagBitField, to indicate whether or not a member is a bitfield. This fixes PR28162. Differential Revision: http://reviews.llvm.org/D21782 llvm-svn: 274200
* RegisterScavenging: Code cleanup; NFCMatthias Braun2016-06-301-40/+26
| | | | | | | | | | | | | - Use range based for loops - No need for some !Reg checks: isPhysicalRegister() reports false for NoRegister anyway - Do not repeat function name in documentation comment. - Do not repeat documentation comment in implementation when we already have one at the declaration. - Factor some common subexpressions out. - Change file comments to use doxygen syntax. llvm-svn: 274194
* CodeGen: Use MachineInstr& in TargetInstrInfo, NFCDuncan P. N. Exon Smith2016-06-3022-285/+259
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is mostly a mechanical change to make TargetInstrInfo API take MachineInstr& (instead of MachineInstr* or MachineBasicBlock::iterator) when the argument is expected to be a valid MachineInstr. This is a general API improvement. Although it would be possible to do this one function at a time, that would demand a quadratic amount of churn since many of these functions call each other. Instead I've done everything as a block and just updated what was necessary. This is mostly mechanical fixes: adding and removing `*` and `&` operators. The only non-mechanical change is to split ARMBaseInstrInfo::getOperandLatencyImpl out from ARMBaseInstrInfo::getOperandLatency. Previously, the latter took a `MachineInstr*` which it updated to the instruction bundle leader; now, the latter calls the former either with the same `MachineInstr&` or the bundle leader. As a side effect, this removes a bunch of MachineInstr* to MachineBasicBlock::iterator implicit conversions, a necessary step toward fixing PR26753. Note: I updated WebAssembly, Lanai, and AVR (despite being off-by-default) since it turned out to be easy. I couldn't run tests for AVR since llc doesn't link with it turned on. llvm-svn: 274189
* PrologEpilogInserter: Some code cleanup; NFCMatthias Braun2016-06-291-40/+36
| | | | | | | | | - Use range based for - Use the more common variable names MBB and MF for MachineBasicBlock/MachineFunction variables. - Add a few const modifiers llvm-svn: 274187
* StackColoring for SafeStack.Evgeniy Stepanov2016-06-296-38/+696
| | | | | | | | | | | | | | | | This is a fix for PR27842. An IR-level implementation of stack coloring tailored to work with SafeStack. It is a bit weaker than the MI implementation in that it does not the "lifetime start at first access" logic. This can be improved in the future. This patch also replaces the naive implementation of stack frame layout with a greedy algorithm that can split existing stack slots and even fit small objects inside the alignment padding of other objects. llvm-svn: 274162
* [DAGCombine] Teach DAG combine to handle ORs of shuffles involving zero ↵Craig Topper2016-06-291-45/+52
| | | | | | vectors where the zero vector is the first operand to the shuffle instead of the second. llvm-svn: 274097
* [CodeGen] Make ShuffleVectorSDNode::commuteMask take a MutableArrayRef ↵Craig Topper2016-06-291-1/+1
| | | | | | instead of SmallVectorImpl. NFC. llvm-svn: 274095
* Codegen: [MBP] Add messages to asserts. NFCKyle Butt2016-06-281-3/+4
| | | | llvm-svn: 274075
* Use isPositionIndependent in a few more places.Rafael Espindola2016-06-283-3/+3
| | | | | | | | | I think this converts all the simple cases that really just care about the generated code being position independent or not. The remaining uses are a bit more complicated and are checking things like "is this a library or executable" or "can this symbol be preempted". llvm-svn: 274055
* Fix typoKrzysztof Parzyszek2016-06-281-1/+1
| | | | llvm-svn: 274051
* Fixed MSVC unresolved symbol error due to an incorrectly declared externSimon Pilgrim2016-06-281-1/+1
| | | | llvm-svn: 274007
* [BFI/MBFI]: cfg graph view with color scheme Xinliang David Li2016-06-281-1/+9
| | | | | | | | | | This patch enhances dot graph viewer to show hot regions with hot bbs/edges displayed in red. The ratio of the bb freq to the max freq of the function needs to be no less than the value specified by view-hot-freq-percent option. The default value is 10 (i.e. 10%). llvm-svn: 273996
* [BFI]: enhance BFI graph dumpXinliang David Li2016-06-281-4/+3
| | | | | | | | | MBFI supports profile count dumping and function name based filtering. Add these two feature to BFI as well. The filtering option is shared between BFI and MBFI: -view-bfi-func-name=.. llvm-svn: 273992
* [BFI]: graph viewer code refactoring Xinliang David Li2016-06-281-47/+11
| | | | | | | | | | | BFI and MBFI's dot traits class share most of the code and all future enhancement. This patch extracts common implementation into base class BFIDOTGraphTraitsBase. This patch also enables BFI graph to show branch probability on edges as MBFI does before. llvm-svn: 273990
* [BFI]: code cleanup Xinliang David Li2016-06-281-4/+9
| | | | | | | | Expose getBPI interface from BFI impl and use it in graph viewer. This eliminates the dependency on old PM interface. llvm-svn: 273967
* Move shouldAssumeDSOLocal to Target.Rafael Espindola2016-06-272-45/+1
| | | | | | Should fix the shared library build. llvm-svn: 273958
* Teach shouldAssumeDSOLocal about tls.Rafael Espindola2016-06-271-20/+19
| | | | | | Fixes a fixme about handling other visibilities. llvm-svn: 273921
* DAGCombiner: Don't narrow volatile vector loads + extractMatt Arsenault2016-06-271-3/+8
| | | | llvm-svn: 273909
* [ARM] Fix Thumb text sections' flags under COFF/WindowsRenato Golin2016-06-271-5/+7
| | | | | | | | | | | | | | | | The main issue here is that the "thumb" flag wasn't set for some of these sections, making MSVC's link.exe fails to correctly relocate code against the symbols inside these sections. link.exe could fail for instance with the "fixup is not aligned for target 'XX'" error. If linking doesn't fail, the relocation process goes wrong in the end and invalid code is generated by the linker. This patch adds Thumb/ARM information so that the right flags are set on COFF/Windows. Patch by Adrien Guinet. llvm-svn: 273880
* Move isPositionIndependent up to AsmPrinter.Rafael Espindola2016-06-271-0/+4
| | | | | | Use it in ppc too. llvm-svn: 273877
* Use isPositionIndependent predicate. NFC.Rafael Espindola2016-06-261-1/+1
| | | | llvm-svn: 273830
* Use isPositionIndependent predicate.Rafael Espindola2016-06-261-1/+1
| | | | llvm-svn: 273828
* Refactor a duplicated predicate. NFC.Rafael Espindola2016-06-261-0/+4
| | | | llvm-svn: 273826
* Revert r273807 (and r273809, r273810), it caused PR28311Nico Weber2016-06-261-49/+3
| | | | llvm-svn: 273815
* Fixed build failure (due to unused variable error) in r273807.Amjad Aboud2016-06-261-0/+1
| | | | llvm-svn: 273810
* Fixed build failure (due to unused variable error) in r273807.Amjad Aboud2016-06-261-3/+1
| | | | llvm-svn: 273809
* [codeview] Improved array type support.Amjad Aboud2016-06-261-2/+49
| | | | | | | | | | | Added support for: 1. Multi dimension array. 2. Array of structure type, which previously was declared incompletely. 3. Dynamic size array. Differential Revision: http://reviews.llvm.org/D21526 llvm-svn: 273807
* [SelectionDAG] Use DAG.getCommutedVectorShuffle instead of reimplementing it.Craig Topper2016-06-261-15/+2
| | | | llvm-svn: 273802
* Revert "[SimplifyCFG] Stop inserting calls to llvm.trap for UB"David Majnemer2016-06-251-3/+3
| | | | | | This reverts commit r273778, it seems to break UBSan :/ llvm-svn: 273779
* [SimplifyCFG] Stop inserting calls to llvm.trap for UBDavid Majnemer2016-06-251-3/+3
| | | | | | | | | | | | | | | | | SimplifyCFG had logic to insert calls to llvm.trap for two very particular IR patterns: stores and invokes of undef/null. While InstCombine canonicalizes certain undefined behavior IR patterns to stores of undef, phase ordering means that this cannot be relied upon in general. There are much better tools than llvm.trap: UBSan and ASan. N.B. I could be argued into reverting this change if a clear argument as to why it is important that we synthesize llvm.trap for stores, I'd be hard pressed to see why it'd be useful for invokes... llvm-svn: 273778
* MachineScheduler: Remember top/bottom choice in bidirectional schedulingMatthias Braun2016-06-251-9/+50
| | | | | | | | | | | | | Remember the last choice for the top/bottom scheduling boundary in bidirectional scheduling mode. The top choice should not change if we schedule at the bottom and vice versa. This allows us to improve compiletime: We only recalculate the best pick for one border and re-use the cached top-pick from the other border. Differential Revision: http://reviews.llvm.org/D19350 llvm-svn: 273766
* MachineScheduler: Fully compare top/bottom candidatesMatthias Braun2016-06-251-99/+103
| | | | | | | | | | In bidirectional scheduling this gives more stable results than just comparing the "reason" fields of the top/bottom node because the reason field may be higher depending on what other nodes are in the queue. Differential Revision: http://reviews.llvm.org/D19401 llvm-svn: 273755
* [MBP] show function name in debug dumpXinliang David Li2016-06-241-0/+1
| | | | llvm-svn: 273744
* Fix the type signature of DwarfExpression::Add.*Constant to support values ↵Adrian Prantl2016-06-242-4/+4
| | | | | | | | | | | >32 bits. This fixes an embarrassing bug when emitting .debug_loc entries for 64-bit+ constants, which were previously silently truncated to 32 bits. <rdar://problem/26843232> llvm-svn: 273736
* [PM] Port PreISelIntrinsicLowering to the new PMMichael Kuperstein2016-06-242-12/+21
| | | | llvm-svn: 273713
* Revert r273545, "[IfConversion] Bugfix: Don't use undef flag while adding ↵Peter Collingbourne2016-06-241-16/+3
| | | | | | | | use operands." as it caused PR28295. llvm-svn: 273707
OpenPOWER on IntegriCloud