summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* [SelectionDAG] Add common vector constant folding helper functionSimon Pilgrim2015-10-122-101/+95
| | | | | | | | | | | | We have a number of functions that implement constant folding of vectors (unary and binary ops) in near identical manners (and the differences don't appear to be critical). This patch introduces a common implementation (SelectionDAG::FoldConstantVectorArithmetic) and calls this in both the unary and binary op cases. After this initial patch I intend to begin enabling vector constant folding for a wider number of opcodes in SelectionDAG::getNode(). Differential Revision: http://reviews.llvm.org/D13665 llvm-svn: 250118
* Enable verifier after PeepholeOptimizerMatt Arsenault2015-10-121-1/+1
| | | | | | | No tests fail with this enabled so I assume it was an accident that it isn't enabled now. llvm-svn: 250070
* Don't call PrepareEHLandingPad on non EH padsReid Kleckner2015-10-121-2/+3
| | | | | | | | This was a minor bug in r249492. Calling PrepareEHLandingPad on a non-landingpad was a no-op, but it attempted to get the generic pointer register class, which apparently doesn't exist for some targets. llvm-svn: 250068
* [WinEH] Remove CatchObjRecoverIdxDavid Majnemer2015-10-123-15/+5
| | | | | | | CatchObjRecoverIdx was used for the old scheme, it is no longer relevant. llvm-svn: 250065
* [Debug] Look through bitcasts to find argument registersOliver Stannard2015-10-121-19/+13
| | | | | | | | | | On targets where f32 is not legal, we have to look through a BITCAST SDNode to find the register that an argument is stored in when emitting debug info, or we will not be able to emit a DW_AT_location for it. Differential Revision: http://reviews.llvm.org/D13005 llvm-svn: 250056
* [DAGCombiner] Improved FMA combine support for vectorsSimon Pilgrim2015-10-111-33/+36
| | | | | | | | Enabled constant canonicalization for all constants. Improved combining of constant vectors. llvm-svn: 249993
* [DAGCombiner] Tidyup FMINNUM/FMAXNUM constant foldingSimon Pilgrim2015-10-111-14/+14
| | | | | | | | Enable constant folding for vector splats as well as scalars. Enable constant canonicalization for all scalar and vector constants. llvm-svn: 249978
* [WinEH] Remove more dead codeDavid Majnemer2015-10-104-51/+33
| | | | | | wineh-parent is dead, so is ValueOrMBB. llvm-svn: 249920
* [WinEH] Delete the old landingpad implementation of Windows EHReid Kleckner2015-10-096-2764/+86
| | | | | | | | | | | The new implementation works at least as well as the old implementation did. Also delete the associated preparation tests. They don't exercise interesting corner cases of the new implementation. All the codegen tests of the EH tables have already been ported. llvm-svn: 249918
* [SEH] Update SEH codegen tests to use the new IRReid Kleckner2015-10-091-0/+5
| | | | | | | | | Also Fix a buglet where SEH tables had ranges that spanned funclets. The remaining tests using the old landingpad IR are preparation tests, and will be deleted along with the old preparation. llvm-svn: 249917
* CodeGen: Remove implicit ilist iterator conversions, NFCDuncan P. N. Exon Smith2015-10-099-84/+93
| | | | | | | Finish removing implicit ilist iterator conversions from LLVMCodeGen. I'm sure there are lots more of these in lib/CodeGen/*/. llvm-svn: 249915
* [SEH] Fix _except_handler4 table base statesReid Kleckner2015-10-091-1/+4
| | | | | | | We got them right for the old IR, but not with funclets. Port the old test to the new IR and fix the code. llvm-svn: 249906
* CodeGen: Avoid more ilist iterator implicit conversions, NFCDuncan P. N. Exon Smith2015-10-095-16/+16
| | | | llvm-svn: 249903
* CodeGen: Use range-based for in PostRAScheduler, NFCDuncan P. N. Exon Smith2015-10-091-12/+11
| | | | llvm-svn: 249901
* [SEH] Remember to emit the last invoke range for SEHReid Kleckner2015-10-092-28/+51
| | | | | | | | This wasn't very observable in execution tests, because usually there is an invoke in the catchpad that unwinds the the catchendpad but never actually throws. llvm-svn: 249898
* Revert "Simplify code. NFC."Chad Rosier2015-10-091-1/+6
| | | | | | This reverts commit r248610. llvm-svn: 249887
* CodeGen: Continue removing ilist iterator implicit conversionsDuncan P. N. Exon Smith2015-10-097-45/+51
| | | | llvm-svn: 249884
* CodeGen: Remove implicit iterator conversions from MBB.cppDuncan P. N. Exon Smith2015-10-091-8/+8
| | | | | | | | | | Remove implicit ilist iterator conversions from MachineBasicBlock.cpp. I've also added an overload of `splice()` that takes a pointer, since it's a natural API. This is similar to the overloads I added for `remove()` and `erase()` in r249867. llvm-svn: 249883
* CodeGen: Avoid ilist iterator implicit conversions in a few more places, NFCDuncan P. N. Exon Smith2015-10-092-22/+20
| | | | llvm-svn: 249880
* CodeGen: Remove more ilist iterator implicit conversions, NFCDuncan P. N. Exon Smith2015-10-097-28/+27
| | | | llvm-svn: 249879
* CodeGen: Use range-based for in IntrinsicLowering::AddPrototypes, NFCDuncan P. N. Exon Smith2015-10-091-21/+21
| | | | | | This happens to avoid a host of implicit ilist iterator conversions. llvm-svn: 249877
* CodeGen: Use range-based for in GlobalMerge, NFCDuncan P. N. Exon Smith2015-10-091-16/+15
| | | | llvm-svn: 249876
* CodeGen: Remove a few more ilist iterator implicit conversions, NFCDuncan P. N. Exon Smith2015-10-094-45/+53
| | | | llvm-svn: 249875
* CodeGen: Remove implicit conversions from Analysis and BranchFoldingDuncan P. N. Exon Smith2015-10-092-26/+27
| | | | | | | | | | | | Remove a few more implicit ilist iterator conversions, this time from Analysis.cpp and BranchFolding.cpp. I added a few overloads for `remove()` and `erase()`, which quite naturally take pointers as well as iterators as parameters. This will reduce the churn at least in the short term, but I don't really have a problem with these existing for longer. llvm-svn: 249867
* Refine the definition of convergent to only disallow the addition of new ↵Owen Anderson2015-10-091-1/+2
| | | | | | | | | | control dependencies. This covers the common case of operations that cannot be sunk. Operations that cannot be hoisted should already be handled properly via the safe-to-speculate rules and mechanisms. llvm-svn: 249865
* fix typos; NFCSanjay Patel2015-10-091-13/+12
| | | | llvm-svn: 249863
* CodeGen: Start removing implicit conversions to/from list iterators, NFCDuncan P. N. Exon Smith2015-10-092-4/+4
| | | | | | | Start removing implicit conversions to/from list iterators in CodeGen, ala r249782 for IR. A lot more to go after this. llvm-svn: 249851
* Revert "Revert "Revert r248959, "[WinEH] Emit int3 after noreturn calls on ↵Reid Kleckner2015-10-092-3/+9
| | | | | | | | | | Win64""" This reverts commit r249794. Apparently my checkouts are full of unexpected surprises today. llvm-svn: 249796
* Revert "Revert r248959, "[WinEH] Emit int3 after noreturn calls on Win64""Reid Kleckner2015-10-092-9/+3
| | | | | | | | This reverts commit r249032. TODO write commit msg llvm-svn: 249794
* [WinEH] Fix cleanup state numberingJoseph Tremoulet2015-10-091-4/+20
| | | | | | | | | | | | | | | | | | | Summary: - Recurse from cleanupendpads to their cleanuppads, to make sure the cleanuppad is visited if it has a cleanupendpad but no cleanupret. - Check for and avoid double-processing cleanuppads, to allow for them to have multiple cleanuprets (plus cleanupendpads). - Update Cxx state numbering to visit toplevel cleanupendpads and to recurse from cleanupendpads to their preds, to ensure we number any funclets in inlined cleanups. SEH state numbering already did this. Reviewers: rnk Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D13374 llvm-svn: 249792
* [SEH] Fix llvm.eh.exceptioncode fast register allocation assertionReid Kleckner2015-10-091-1/+1
| | | | | | I called the wrong MachineBasicBlock::addLiveIn() overload. llvm-svn: 249786
* Do not assert on first non-prologue instruction being a CFI directive.Michael Kuperstein2015-10-081-5/+1
| | | | llvm-svn: 249668
* Use range-based for loops. NFC.Craig Topper2015-10-081-13/+7
| | | | llvm-svn: 249659
* CodeGen: print and verify after TargetPassConfig::insertPass by defaultJustin Bogner2015-10-081-19/+31
| | | | | | | | | | | | | | In r224059, we started verifying after addPass, but missed doing so on insertPass. There isn't a good reason for the discrepancy, and skipping the verifier in these cases causes bugs. This also exposes a verifier error that was introduced in r249087, but the verifier doesn't run until after the register coalescer, when the issue happens to have been resolved. I've skipped the verifier after SIFixSGPRLiveRangesID to avoid the failures for now and will follow up with Matt for a proper fix. llvm-svn: 249643
* [WinEH] Refer to filter funclets using their symbol-table symbolDavid Majnemer2015-10-071-1/+2
| | | | | | | | The relocation for the filter funclet will be against a symbol table entry for a function instead of the section, making it easier to understand what is going on. llvm-svn: 249621
* [WinEH] Undo the effect of r249578 for 32-bitReid Kleckner2015-10-073-25/+22
| | | | | | | | | | | | The __CxxFrameHandler3 tables for 32-bit are supposed to hold stack offsets relative to EBP, not ESP. I blindly updated the win-catchpad.ll test case, and immediately noticed that 32-bit catching stopped working. While I'm at it, move the frame index to frame offset WinEH table logic out of PEI. PEI shouldn't have to know about WinEHFuncInfo. I realized we can calculate frame index offsets just fine from the table printer. llvm-svn: 249618
* [WinEH] Remove unreachable blocks before preparationDavid Majnemer2015-10-071-5/+5
| | | | | | | | | | | | | We remove unreachable blocks because it is pointless to consider them for coloring. However, we still had stale pointers to these blocks in some data structures after we removed them from the function. Instead, remove the unreachable blocks before attempting to do anything with the function. This fixes PR25099. llvm-svn: 249617
* [WinEH] Set NoModuleLevelChanges in clone flagsJoseph Tremoulet2015-10-071-2/+7
| | | | | | | | | | | | | | | | Summary: This is necessary to keep the cloner from making bogus copies of debug metadata attached to the IR it is cloning. Also, avoid running RemapInstruction over all instructions in the common case that no cloning was performed. Reviewers: rnk, andrew.w.kaylor, majnemer Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D13514 llvm-svn: 249591
* [WinEH] Fix two minor issues in __CxxFrameHandler3 tablesReid Kleckner2015-10-072-4/+3
| | | | | | | | | | | | There was an off-by-one bug in ip2state tables which manifested when one call immediately preceded the try-range of the next. The return address of the previous call would appear to be within the try range of the next scope, resulting in extra destructors or catches running. We also computed the wrong offset for catch parameter stack objects. The offset should be from RSP, not from RBP. llvm-svn: 249578
* [ARM] Promote helper function to SelectionDAG.Chad Rosier2015-10-071-0/+19
| | | | | | | | | I'll be using the function in a similar combine for AArch64. The helper was also improved to handle undef values. Part of http://reviews.llvm.org/D13442 llvm-svn: 249572
* [WinEH] Update CoreCLR EH for catchpad MBBsJoseph Tremoulet2015-10-072-4/+5
| | | | | | | | | | | | | | | Summary: Set the pad MBB as a funclet entry for CoreCLR as well as MSVCCXX, and update state numbering to put the catchpad block rather than its normal successor into the unwind map. Reviewers: majnemer Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D13492 llvm-svn: 249569
* [X86] Emit .cfi_escape GNU_ARGS_SIZE when adjusting the stack before callsMichael Kuperstein2015-10-071-0/+6
| | | | | | | | | | | | When outgoing function arguments are passed using push instructions, and EH is enabled, we may need to indicate to the stack unwinder that the stack pointer was adjusted before the call. This should fix the exception handling issues in PR24792. Differential Revision: http://reviews.llvm.org/D13132 llvm-svn: 249522
* [SEH] Add llvm.eh.exceptioncode intrinsicReid Kleckner2015-10-074-15/+70
| | | | | | This will support the Clang __exception_code intrinsic. llvm-svn: 249492
* DebugInfo: Include the decl_line/decl_file in subprogram definitions if they ↵David Blaikie2015-10-071-0/+8
| | | | | | | | | | | | | | | differ from those in the declaration This is handy for some AutoFDO stuff, and seems like a minor improvement to correctness (otherwise a debug info consumer might think the decl line/file of the def was the same as that of the declaration - though what a consumer might use that for, I'm not sure - maybe "list <func>" would've misbehaved with the old behavior?) and at a minor cost (in my experiment, with fission, without type units, without compression, 0.01% growth in debug info in the executable/objects, 0.02% growth in the .dwo files). llvm-svn: 249487
* [WinEH] Create a separate MBB for funclet prologuesDavid Majnemer2015-10-063-8/+50
| | | | | | | | | | | | | | | | Our current emission strategy is to emit the funclet prologue in the CatchPad's normal destination. This is problematic because intra-funclet control flow to the normal destination is not erroneous and results in us reevaluating the prologue if said control flow is taken. Instead, use the CatchPad's location for the funclet prologue. This correctly models our desire to have unwind edges evaluate the prologue but edges to the normal destination result in typical control flow. Differential Revision: http://reviews.llvm.org/D13424 llvm-svn: 249483
* Fix Clang-tidy modernize-use-nullptr warnings in source directories and ↵Hans Wennborg2015-10-061-4/+3
| | | | | | | | | | generated files; other minor cleanups. Patch by Eugene Zelenko! Differential Revision: http://reviews.llvm.org/D13321 llvm-svn: 249482
* [WinEH] Implement state numbering for CoreCLRJoseph Tremoulet2015-10-062-0/+91
| | | | | | | | | | | | | | | | Summary: Assign one state number per handler/funclet, tracking parent state, handler type, and catch type token. State numbers are arranged such that ancestors have lower state numbers than their descendants. Reviewers: majnemer, andrew.w.kaylor, rnk Subscribers: pgavlin, AndyAyers, llvm-commits Differential Revision: http://reviews.llvm.org/D13450 llvm-svn: 249457
* [WinEH] Recognize CoreCLR personality functionJoseph Tremoulet2015-10-066-16/+18
| | | | | | | | | | | | | | | Summary: - Add CoreCLR to if/else ladders and switches as appropriate. - Rename isMSVCEHPersonality to isFuncletEHPersonality to better reflect what it captures. Reviewers: majnemer, andrew.w.kaylor, rnk Subscribers: pgavlin, AndyAyers, llvm-commits Differential Revision: http://reviews.llvm.org/D13449 llvm-svn: 249455
* [TwoAddressInstructionPass] When looking for a 3 addr conversion after ↵Craig Topper2015-10-061-0/+7
| | | | | | commuting, make sure regB has been updated to take into account the commute. llvm-svn: 249378
* Move helper classes into an anonymous namespace. NFC.Benjamin Kramer2015-10-051-0/+2
| | | | llvm-svn: 249356
OpenPOWER on IntegriCloud