summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* TII: Fix inlineasm size counting comments as instsMatt Arsenault2016-07-011-7/+11
| | | | | | | The main problem was counting comments on their own line as instructions. llvm-svn: 274405
* PeepholeOptimizer: Relax assertMatt Arsenault2016-07-011-2/+4
| | | | | | Allow implicit defs llvm-svn: 274402
* [CodeView] Include the offset of nested membersDavid Majnemer2016-07-011-4/+5
| | | | | | | | | | | | | Given something like: struct S { int a; struct { int b; }; }; We would fail to give 'b' offset 4. Instead, we would give it the offset it has inside of it's struct. llvm-svn: 274400
* [CodeView] Pretty print anonymous scopesDavid Majnemer2016-07-011-14/+31
| | | | | | | | A namespace without a name should be written out as `anonymous namespace' while a tag type without a name should be written out as <unnamed-tag>. llvm-svn: 274399
* [codeview] Don't record UDTs for anonymous structsReid Kleckner2016-07-011-0/+4
| | | | | | | | MSVC makes up names for these anonymous structs, but we don't (yet). Eventually Clang should use getTypedefNameForAnonDecl() to put some name in the debug info, and we can update the test case when that happens. llvm-svn: 274391
* [codeview] Assert that our CV type records are validReid Kleckner2016-07-011-3/+27
| | | | | | | | | | | We were asserting that our type records were valid when emitting assembly, but not when emitting an object file. I've been seeing lots of LNK1285 errors (corrupt PDB) during incremental debug self-host builds with the MSVC linker, and hopefully this will catch some of them earlier. llvm-svn: 274373
* CodeGen: Use MachineInstr& in RegisterCoalescer, NFCDuncan P. N. Exon Smith2016-07-011-38/+37
| | | | | | | Remove a few more implicit iterator to pointer conversions by preferring MachineInstr&. llvm-svn: 274363
* CodeGen: Avoid implicit conversions in TargetInstrInfo, NFCDuncan P. N. Exon Smith2016-07-011-2/+2
| | | | | | | Avoid implicit conversions from MachineBasicBlock::iterator to MachineInstr* in TargetInstrInfo. llvm-svn: 274361
* CodeGen: Use MachineInstr& in ScheduleDAGIntrs, NFCDuncan P. N. Exon Smith2016-07-011-43/+43
| | | | | | | | | | | | | Use MachineInstr& to avoid implicit conversions from MachineBasicBlock::iterator to MachineInstr*. In one case, this could use a range-based for loop, but the other loops iterated in reverse order. One of the reverse-loops checked the MachineInstr* for nullptr, a condition that is provably unreachable. (And even if my proof has a flaw, UBSan would catch the bug.) llvm-svn: 274360
* CodeGen: Avoid iterator conversion in UnreachableBlockElim, NFCDuncan P. N. Exon Smith2016-07-011-3/+1
| | | | | | | Avoid an unnecessary (and implicit) iterator to pointer conversion in UnreachableBlockElim by using the post-increment operator. llvm-svn: 274355
* CodeGen: Use MachineInstr& in SlotIndexes.cpp, NFCDuncan P. N. Exon Smith2016-07-011-18/+13
| | | | | | | Avoid implicit conversions from iterator to pointer by preferring MachineInstr& and using range-based for loops. llvm-svn: 274354
* CodeGen: Use MachineInstr& in RegAllocFast, NFCDuncan P. N. Exon Smith2016-07-011-31/+33
| | | | | | | | | Use MachineInstr& instead of MachineInstr* in RegAllocFast to avoid implicit conversions from MachineInstrBundleIterator. RAFast::spillAll and RAFast::spillVirtReg still take iterators, since their argument may be an end iterator from MachineBasicBlock::getFirstTerminator. llvm-svn: 274353
* [CodeGen] Cleanup getVectorShuffle a bit to take advantage of its new ↵Craig Topper2016-07-011-16/+16
| | | | | | ArrayRef argument and its begin/end iterators. Also use 'int' type for number of elements and loop iterators to remove several typecasts. No functional change intended. llvm-svn: 274338
* [CodeGen,Target] Remove the version of DAG.getVectorShuffle that takes a ↵Craig Topper2016-07-016-30/+27
| | | | | | | | pointer to a mask array. Convert all callers to use the ArrayRef version. No functional change intended. For the most part this simplifies all callers. There were two places in X86 that needed an explicit makeArrayRef to shorten a statically sized array. llvm-svn: 274337
* Add support for allowing us to create uniquely identified "COMDAT" or "ELFEric Christopher2016-07-011-4/+2
| | | | | | | | | | | | | Group" sections while lowering. In particular, for ELF sections this is useful for creating function-specific groups that get merged into the same named section. Also use const Twine& instead of StringRef for the getELF functions while we're here. Differential Revision: http://reviews.llvm.org/D21743 llvm-svn: 274336
* 80-column and comment fixups.Eric Christopher2016-07-011-5/+8
| | | | llvm-svn: 274335
* [MBP] method interface cleanupXinliang David Li2016-07-011-25/+20
| | | | | | | Make worklist and ehworklist member of the class so that they don't need to be passed around. llvm-svn: 274333
* [codeview] Add DISubprogram::ThisAdjustmentReid Kleckner2016-07-011-24/+27
| | | | | | | | | | | | | | | | | | | | | Summary: This represents the adjustment applied to the implicit 'this' parameter in the prologue of a virtual method in the MS C++ ABI. The adjustment is always zero unless multiple inheritance is involved. This increases the size of DISubprogram by 8 bytes, unfortunately. The adjustment really is a signed 32-bit integer. If this size increase is too much, we could probably win it back by splitting out a subclass with info specific to virtual methods (virtuality, vindex, thisadjustment, containingType). Reviewers: aprantl, dexonsmith Subscribers: aaboud, amccarth, llvm-commits Differential Revision: http://reviews.llvm.org/D21614 llvm-svn: 274325
* CodeGen: Use MachineInstr& in LiveVariables API, NFCDuncan P. N. Exon Smith2016-07-014-45/+45
| | | | | | | | | Change all the methods in LiveVariables that expect non-null MachineInstr* to take MachineInstr& and update the call sites. This clarifies the API, and designs away a class of iterator to pointer implicit conversions. llvm-svn: 274319
* CodeGen: Remove implicit iterator conversions in PHIElimination, NFCDuncan P. N. Exon Smith2016-07-011-7/+7
| | | | llvm-svn: 274317
* CodeGen: Use MachineInstr& in PostRASchedulerList, NFCDuncan P. N. Exon Smith2016-07-011-6/+6
| | | | | | Remove another unnecessary iterator to pointer conversion. llvm-svn: 274315
* CodeGen: Use MachineInstr& in PostRAHazardRecognizer, NFCDuncan P. N. Exon Smith2016-07-011-6/+4
| | | | | | | | Convert a loop to a range-based for, using MachineInstr& instead of MachineInstr* and removing an implicit conversion from iterator to pointer. llvm-svn: 274311
* CodeGen: Use MachineInstr& in PrologEpilogInserter, NFCDuncan P. N. Exon Smith2016-07-011-18/+20
| | | | | | | | | Use MachineInstr& over MachineInstr* to avoid implicit iterator to pointer conversions. MachineInstr*-as-nullptr was being used as a flag for whether the for loop terminated normally; I added an explicit `bool` instead. llvm-svn: 274310
* Target: Remove unused arguments from overrideSchedPolicy, NFCDuncan P. N. Exon Smith2016-07-011-2/+1
| | | | | | | | | | TargetSubtargetInfo::overrideSchedPolicy takes two MachineInstr* arguments (begin and end) that invite implicit conversions from MachineInstrBundleIterator. One option would be to change their type to an iterator, but since they don't seem to have been used since the API was added in 2010, I'm deleting the dead code. llvm-svn: 274304
* CodeGen: Use MachineInstr& in MachineSink, NFCDuncan P. N. Exon Smith2016-07-011-52/+49
| | | | | | | Use MachineInstr& instead of MachineInstr* in MachineSinker to help avoid implicit conversions from iterator to pointer. llvm-svn: 274303
* 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
OpenPOWER on IntegriCloud