summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* Fixing a bug with optimized catch-all handlers in WinEHPrepareAndrew Kaylor2015-03-271-5/+14
| | | | llvm-svn: 233439
* fix typo and 80-col; NFCSanjay Patel2015-03-271-2/+2
| | | | llvm-svn: 233427
* [CodeGen] Don't attempt a tail-call with a non-forwarded explicit sret.Ahmed Bougacha2015-03-271-0/+5
| | | | | | | | | | | | Tailcalls are only OK with forwarded sret pointers. With explicit sret, one approximation is to check that the pointer isn't an Instruction, as in that case it might point into some local memory (alloca). That's not OK with tailcalls. Explicit sret counterpart to r233409. Differential Revison: http://reviews.llvm.org/D8510 llvm-svn: 233410
* [CodeGen] Don't attempt a tail-call with implicit sret.Ahmed Bougacha2015-03-271-0/+4
| | | | | | | | | Tailcalls are only OK with forwarded sret pointers. With sret demotion, they're not, as we'd have a pointer into a soon-to-be-dead stack frame. Differential Revison: http://reviews.llvm.org/D8510 llvm-svn: 233409
* [RegisterCoalescer] Refine the terminal rule to still consider the terminalQuentin Colombet2015-03-271-8/+32
| | | | | | | | | | | | | | | nodes. When a node is terminal it is pushed at the end of the list of the copies to coalesce instead of being completely ignored. In effect, this reduces its priority over non-terminal nodes. Because of that, we do not miss the rematerialization opportunities, nor the copies that can be merged with more complex, than the terminal rule, interference checks. Related to PR22768. llvm-svn: 233395
* Remove superfluous .str() and replace std::string concatenation with Twine.Yaron Keren2015-03-276-8/+8
| | | | llvm-svn: 233392
* Complete the MachineScheduler fix made way back in r210390.Andrew Trick2015-03-271-2/+2
| | | | | | | | | | | | | | | | | | "Fix the MachineScheduler's logic for updating ready times for in-order. Now the scheduler updates a node's ready time as soon as it is scheduled, before releasing dependent nodes." This fix was only made in one variant of the ScheduleDAGMI driver. Francois de Ferriere reported the issue in the other bit of code where it was also needed. I never got around to coming up with a test case, but it's an obvious fix that shouldn't be delayed any longer. I'll try to refactor this code a little better. I did verify performance on a wide variety of targets and saw no negative impact with this fix. llvm-svn: 233366
* Require a GC strategy be specified for functions which use gc.statepointPhilip Reames2015-03-271-23/+19
| | | | | | This was discussed a while back and I left it optional for migration. Since it's been far more than the 'week or two' that was discussed, time to actually make this manditory. llvm-svn: 233357
* Allow explicit spill slots to be specified for a gc.statepointPhilip Reames2015-03-271-4/+20
| | | | | | | | | | This patch adds support for explicitly provided spill slots in the GC arguments of a gc.statepoint. This is somewhat analogous to gcroot, but leverages the STATEPOINT MI node and StackMap infrastructure. The motivation for this is: 1) The stack spilling code for gc.statepoints hasn't advanced as fast as I'd like. One major option is to give up on doing spilling in the backend and do it at the IR level instead. We'd give up the ability to have gc values in registers, but that's a minor cost in practice. We are not neccessarily moving in that direction, but having the ability to prototype such a thing cheaply is interesting. 2) I want to port the gcroot lowering to use the statepoint infastructure. Given the metadata printers for gcroot expect a fixed set of stack roots, it's easiest to just reuse the explicit stack slots and pass them directly to the underlying statepoint. I'm holding off on the documentation for the new feature until I'm reasonable sure this is going to stick around. llvm-svn: 233356
* WinEH: Create a parent frame alloca for HandlerType xdata tablesDavid Majnemer2015-03-272-1/+21
| | | | | | | | We don't have any logic to emit those tables yet, so the SDAG lowering of this intrinsic is just a stub. We can see the intrinsic in the prepared IR, though. llvm-svn: 233354
* Fix a bug in SelectionDAG scheduling backtracking code: PR22304.Andrew Trick2015-03-271-1/+2
| | | | | | | | | | | | | | | It can happen (by line CurSU->isPending = true; // This SU is not in AvailableQueue right now.) that a SUnit is mark as available but is not in the AvailableQueue. For SUnit being selected for scheduling both conditions must be met. This patch mainly defensively protects from invalid removing a node from a queue. Sometimes nodes are marked isAvailable but are not in the queue because they have been defered due to some hazard. Patch by Pawel Bylica! llvm-svn: 233351
* [AsmPrinter] Don't assert on GOT equivalent non-constant users.Ahmed Bougacha2015-03-271-1/+1
| | | | | | | We used to dyn_cast<Constant> in the recursive call, but cast<> in the initial one, and there can be non-Constant initial users. llvm-svn: 233346
* Deduplicate a bunch of setOpActions into an MVT range-for. NFC.Ahmed Bougacha2015-03-261-39/+15
| | | | llvm-svn: 233330
* [CodeGen] Report error rather than crash when unable to makeLibCall.Ahmed Bougacha2015-03-261-0/+2
| | | | | | Also, make the assumption explicit in the header. llvm-svn: 233329
* [CodeGen] Don't pretend we can expand f16 libcalls.Ahmed Bougacha2015-03-261-13/+0
| | | | | | | | | | | | | | | | | | | We used to mark a bunch of libm nodes as Expand for f16. There are no libcalls we can use for those, so we eventually just hit an unhelpful llvm_unreachable in ExpandFPLibCall. Instead, just ignore them altogether. If nothing else changes, we'll then get the more descriptive and pleasant "Cannot select" fatal error. There's an argument to be made for consistency, but f16 is already special in all the good ways, and as long as there's no f16 support in the ops expander (this patch), as well as the Soften/Expand float legalizers (which, when hit, will currently segfault), I think there's no point in even pretending we can legalize any of this. This shouldn't affect anything that's not already broken. llvm-svn: 233328
* revert inadvertent changeSanjay Patel2015-03-261-2/+0
| | | | llvm-svn: 233294
* comment cleanup; NFCSanjay Patel2015-03-261-0/+2
| | | | llvm-svn: 233293
* fix indent; NFCSanjay Patel2015-03-261-1/+1
| | | | llvm-svn: 233288
* [RegisterCoalescer] Add a rule to consider more profitable copies first whenQuentin Colombet2015-03-261-2/+72
| | | | | | | | | | | those are in the same basic block. The previous approach was the topological order of the basic block. By default this rule is disabled. Related to PR22768. llvm-svn: 233241
* [DAGCombiner] Add support for TRUNCATE + FP_EXTEND vector constant foldingSimon Pilgrim2015-03-252-55/+50
| | | | | | | | | | This patch adds supports for the vector constant folding of TRUNCATE and FP_EXTEND instructions and tidies up the SINT_TO_FP and UINT_TO_FP instructions to match. It also moves the vector constant folding for the FNEG and FABS instructions to use the DAG.getNode() functionality like the other unary instructions. Differential Revision: http://reviews.llvm.org/D8593 llvm-svn: 233224
* RegisterCoalescer: Fix implicit def handling in register coalescerMatthias Braun2015-03-251-1/+23
| | | | | | | | | | | | | | | | If liveranges induced by an IMPLICIT_DEF get completely covered by a proper liverange the IMPLICIT_DEF instructions and its corresponding definitions have to be removed from the live ranges. This has to happen in the subregister live ranges as well (I didn't see this case earlier because in most programs only some subregisters are covered and the IMPLCIT_DEF won't get removed). No testcase, I spent hours trying to create one for one of the public targets, but ultimately failed because I couldn't manage to properly control the placement of COPY and IMPLICIT_DEF instructions from an .ll file. llvm-svn: 233217
* MachineVerifier: slightly simplify code that is only called with vregsMatthias Braun2015-03-251-30/+25
| | | | llvm-svn: 233216
* WinEH: Create an unwind help alloca for __CxxFrameHandler3 xdata tablesReid Kleckner2015-03-252-0/+23
| | | | | | | | We don't have any logic to emit those tables yet, so the sdag lowering of this intrinsic is just a stub. We can see the intrinsic in the prepared IR, though. llvm-svn: 233209
* 'optnone' should not disable DAG combiner.Paul Robinson2015-03-251-5/+0
| | | | | | | | | Reverts the code change from r221168 and the relevant test. It was a mistake to disable the combiner, and based on the ultimate definition of 'optnone' we shouldn't have considered the test case as failing in the first place. llvm-svn: 233153
* X86: Fix frameescape when not using an FPReid Kleckner2015-03-241-8/+0
| | | | | | | | | | | We can't use TargetFrameLowering::getFrameIndexOffset directly, because Win64 really wants the offset from the stack pointer at the end of the prologue. Instead, use X86FrameLowering::getFrameIndexOffsetFromSP(), which is a pretty close approximiation of that. It fails to handle cases with interestingly large stack alignments, which is pretty uncommon on Win64 and is TODO. llvm-svn: 233137
* Opaque Pointer Types: GEP API migrations to specify the gep type explicitlyDavid Blaikie2015-03-242-3/+4
| | | | | | | | | | | | | | The changes to InstCombine do seem a bit silly - it doesn't make anything obviously better to have the caller access the pointers element type (the thing I'm trying to remove) than the GEP itself, but it's a helpful migration step. This will allow me to more obviously lock down GEP (& Load, etc) API usage, then fix all the code that accesses pointer element types except the places that need to be removed (most of the InstCombines) anyway - at which point I'll need to just remove all that code because it won't be meaningful anymore (there will be no pointer types, so no bitcasts to combine) llvm-svn: 233126
* Internalize the StackMapLiveness pass.Benjamin Kramer2015-03-241-6/+45
| | | | | | No need to have its own header when it's not used anywhere. NFC. llvm-svn: 233072
* [SelectionDAG] Fixed issue with uitofp vector constant folding being treated ↵Simon Pilgrim2015-03-231-4/+2
| | | | | | | | | | | | | | | | | | | | | | | as sitofp While the uitofp scalar constant folding treats an integer as an unsigned value (from lang ref): %X = sitofp i8 -1 to double ; yields double:-1.0 %Y = uitofp i8 -1 to double ; yields double:255.0 The vector constant folding was always using sitofp: %X = sitofp <2 x i8> <i8 -1, i8 -1> to <2 x double> ; yields <double -1.0, double -1.0> %Y = uitofp <2 x i8> <i8 -1, i8 -1> to <2 x double> ; yields <double -1.0, double -1.0> This patch fixes this so that the correct opcode is used for sitofp and uitofp. %X = sitofp <2 x i8> <i8 -1, i8 -1> to <2 x double> ; yields <double -1.0, double -1.0> %Y = uitofp <2 x i8> <i8 -1, i8 -1> to <2 x double> ; yields <double 255.0, double 255.0> Differential Revision: http://reviews.llvm.org/D8560 llvm-svn: 233033
* Refactor how passes get a symbol at the end of a section.Rafael Espindola2015-03-231-9/+2
| | | | | | | | | | There is now a canonical symbol at the end of a section that different passes can request. This also allows us to assert that we don't switch back to a section whose end symbol has already been printed. llvm-svn: 233026
* Re-sort includes with sort-includes.py and insert raw_ostream.h where it's used.Benjamin Kramer2015-03-2314-0/+14
| | | | llvm-svn: 232998
* [winehprepare] Update and sort includes. NFC.Benjamin Kramer2015-03-231-1/+2
| | | | llvm-svn: 232994
* Another set of missing raw_ostream.h. Still no functional change.Benjamin Kramer2015-03-231-0/+1
| | | | llvm-svn: 232993
* More missing includes only visible to MSVC.Benjamin Kramer2015-03-231-0/+1
| | | | | | NFC. llvm-svn: 232981
* Purge unused includes throughout libSupport.Benjamin Kramer2015-03-231-0/+1
| | | | | | NFC. llvm-svn: 232976
* Move private classes into anonymous namespacesBenjamin Kramer2015-03-233-0/+6
| | | | | | NFC. llvm-svn: 232944
* Fix sign extension for MIPS64 in makeLibCall functionPetar Jovanovic2015-03-231-3/+4
| | | | | | | | | | | | Fixing sign extension in makeLibCall for MIPS64. In MIPS64 architecture all 32 bit arguments (int, unsigned int, float 32 (soft float)) must be sign extended. This fixes test "MultiSource/Applications/oggenc/". Patch by Strahinja Petrovic. Differential Revision: http://reviews.llvm.org/D7791 llvm-svn: 232943
* [SDAG] Don't widen VSETCC during type legalization for split operandsHal Finkel2015-03-231-0/+10
| | | | | | | | | | | | Because the operands of a vector SETCC node can be of a different type from the result (and often are), it can happen that even if we'd prefer to widen the result type of the SETCC, the operands have been split instead. In this case, the SETCC result also must be split. This mirrors what is done in WidenVecRes_SELECT, and should be NFC elsewhere because if the operands are not widened the following calls to GetWidenedVector will assert (which is what was happening in the test case). llvm-svn: 232935
* Cache the Function dependent subtarget on the MachineFunction.Eric Christopher2015-03-211-1/+1
| | | | | | | | | | | As preparation for removing the getSubtargetImpl() call from TargetMachine go ahead and flip the switch on caching the function dependent subtarget and remove the bare getSubtargetImpl call from the X86 port. As part of this add a few tests that show we can generate code and assemble on X86 based on features/cpu on the Function. llvm-svn: 232879
* Change getISAEncoding to use the target triple to determineEric Christopher2015-03-211-2/+1
| | | | | | | | thumb-ness similar to the rest of the Module level asm printing infrastructure as debug info finalization happens after the function may be missing. llvm-svn: 232875
* [CodeGen][IfCvt] Don't re-ifcvt blocks with unanalyzable terminators.Ahmed Bougacha2015-03-211-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we couldn't analyze its terminator (i.e., it's an indirectbr, or some other weirdness), we can't safely re-if-convert a predicated block, because we can't tell whether the predicated terminator can fallthrough (it does). Currently, we would completely ignore the fallthrough successor. In the added testcase, this means we used to generate: ... @ %entry: cmp r5, #21 ittt ne @ %cc1f: cmpne r7, #42 @ %cc2t: strne.w r5, [r8] movne pc, r10 @ %cc1t: ... Whereas the successor of %cc1f was originally %bb1. With the fix, we get the correct: ... @ %entry: cmp r5, #21 itt eq @ %cc1t: streq.w r5, [r11] moveq pc, r0 @ %cc1f: cmp r7, #42 itt ne @ %cc2t: strne.w r5, [r8] movne pc, r10 @ %bb1: ... rdar://20192768 Differential Revision: http://reviews.llvm.org/D8509 llvm-svn: 232872
* Fixing a bug with WinEH PHI handlingAndrew Kaylor2015-03-201-1/+19
| | | | llvm-svn: 232851
* Remove dead calls and function arguments dealing with TRI in StackMaps.Eric Christopher2015-03-201-4/+2
| | | | llvm-svn: 232847
* Don't declare all text sections at the start of the .sRafael Espindola2015-03-201-2/+4
| | | | | | | | | | | | | | | | | The code this patch removes was there to make sure the text sections went before the dwarf sections. That is necessary because MachO uses offsets relative to the start of the file, so adding a section can change relaxations. The dwarf sections were being printed at the start just to produce symbols pointing at the start of those sections. The underlying issue was fixed in r231898. The dwarf sections are now printed when they are about to be used, which is after we printed the text sections. To make sure we don't regress, the patch makes the MachO streamer assert if CodeGen puts anything unexpected after the DWARF sections. llvm-svn: 232842
* AsmPrinter: Check subprogram before using itDuncan P. N. Exon Smith2015-03-201-2/+5
| | | | | | | Check return of `getDISubprogram()` before using it. A WIP patch makes `DIDescriptor` accessors more strict (and would crash on this). llvm-svn: 232838
* DwarfDebug: Check for null DebugLocsDuncan P. N. Exon Smith2015-03-201-13/+15
| | | | | | | | | | `DL` might be null, so check for that before using accessors. A WIP patch to make `DIDescriptors` more strict fails otherwise. As a bonus, I think the logic is easier to follow now (despite the extra nesting depth). llvm-svn: 232836
* SelectionDAGBuilder: Rangeify a loop. NFC.Hans Wennborg2015-03-201-8/+6
| | | | llvm-svn: 232831
* SelectionDAGBuilder::handleJTSwitchCase, simplify loop; NFCHans Wennborg2015-03-201-9/+4
| | | | llvm-svn: 232830
* [ARM] Fix handling of thumb1 out-of-range frame offsetsJohn Brawn2015-03-201-5/+7
| | | | | | | | | | | | | | | | LocalStackSlotPass assumes that isFrameOffsetLegal doesn't change its answer when the base register changes. Unfortunately this isn't true in thumb1, where SP-based loads allow a larger offset than non-SP-based loads, and this causes the base register reuse code to generate instructions that are unencodable, causing an assertion failure. Solve this by adding a BaseReg parameter to isFrameOffsetLegal, which ARMBaseRegisterInfo can then make use of to give the correct answer. Differential Revision: http://reviews.llvm.org/D8419 llvm-svn: 232825
* Rewrite StackMap location handling to pre-compute the dwarf registerEric Christopher2015-03-201-83/+95
| | | | | | | | | | | | numbers before emission. This removes a dependency on being able to access TRI at the module level and is similar to the DwarfExpression handling. I've modified the debug support into print/dump routines that'll do the same dumping but is now callable anywhere and if TRI isn't available will go ahead and just print out raw register numbers. llvm-svn: 232821
* At the beginning of doFinalization set the MachineFunction toEric Christopher2015-03-201-0/+5
| | | | | | | | nullptr so that users get an earlier dereferencing error and so that we can use it to conditionalize access to MachineFunction specific data. llvm-svn: 232820
OpenPOWER on IntegriCloud