aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/TargetSchedule.cpp
AgeCommit message (Collapse)AuthorFilesLines
2014-10-14Remove unnecessary TargetMachine.h includes.Eric Christopher1-1/+0
llvm-svn: 219672
2014-09-02Change MCSchedModel to be a struct of statically initialized data.Pete Cooper1-4/+4
This removes static initializers from the backends which generate this data, and also makes this struct match the other Tablegen generated structs in behaviour Reviewed by Andy Trick and Chandler C llvm-svn: 216919
2014-08-05Have MachineFunction cache a pointer to the subtarget to make lookupsEric Christopher1-2/+1
shorter/easier and have the DAG use that to do the same lookup. This can be used in the future for TargetMachine based caching lookups from the MachineFunction easily. Update the MIPS subtarget switching machinery to update this pointer at the same time it runs. llvm-svn: 214838
2014-08-04Remove the TargetMachine forwards for TargetSubtargetInfo basedEric Christopher1-1/+2
information and update all callers. No functional change. llvm-svn: 214781
2014-08-03MachineCombiner Pass for selecting faster instructionGerolf Hoflehner1-0/+22
sequence - target independent framework When the DAGcombiner selects instruction sequences it could increase the critical path or resource len. For example, on arm64 there are multiply-accumulate instructions (madd, msub). If e.g. the equivalent multiply-add sequence is not on the crictial path it makes sense to select it instead of the combined, single accumulate instruction (madd/msub). The reason is that the conversion from add+mul to the madd could lengthen the critical path by the latency of the multiply. But the DAGCombiner would always combine and select the madd/msub instruction. This patch uses machine trace metrics to estimate critical path length and resource length of an original instruction sequence vs a combined instruction sequence and picks the faster code based on its estimates. This patch only commits the target independent framework that evaluates and selects code sequences. The machine instruction combiner is turned off for all targets and expected to evolve over time by gradually handling DAGCombiner pattern in the target specific code. This framework lays the groundwork for fixing rdar://16319955 llvm-svn: 214666
2014-06-26Revert "Introduce a string_ostream string builder facilty"Alp Toker1-4/+5
Temporarily back out commits r211749, r211752 and r211754. llvm-svn: 211814
2014-06-26Introduce a string_ostream string builder faciltyAlp Toker1-5/+4
string_ostream is a safe and efficient string builder that combines opaque stack storage with a built-in ostream interface. small_string_ostream<bytes> additionally permits an explicit stack storage size other than the default 128 bytes to be provided. Beyond that, storage is transferred to the heap. This convenient class can be used in most places an std::string+raw_string_ostream pair or SmallString<>+raw_svector_ostream pair would previously have been used, in order to guarantee consistent access without byte truncation. The patch also converts much of LLVM to use the new facility. These changes include several probable bug fixes for truncated output, a programming error that's no longer possible with the new interface. llvm-svn: 211749
2013-09-30IfConverter: Use TargetSchedule for instruction latenciesArnold Schwaighofer1-2/+5
For targets that have instruction itineraries this means no change. Targets that move over to the new schedule model will use be able the new schedule module for instruction latencies in the if-converter (the logic is such that if there is no itineary we will use the new sched model for the latencies). Before, we queried "TTI->getInstructionLatency()" for the instruction latency and the extra prediction cost. Now, we query the TargetSchedule abstraction for the instruction latency and TargetInstrInfo for the extra predictation cost. The TargetSchedule abstraction will internally call "TTI->getInstructionLatency" if an itinerary exists, otherwise it will use the new schedule model. ATTENTION: Out of tree targets! (I will also send out an email later to LLVMDev) This means, if your target implements unsigned getInstrLatency(const InstrItineraryData *ItinData, const MachineInstr *MI, unsigned *PredCost); and returns a value for "PredCost", you now also need to implement unsigned getPredictationCost(const MachineInstr *MI); (if your target uses the IfConversion.cpp pass) radar://15077010 llvm-svn: 191671
2013-09-25Mark the x86 machine model as incomplete. PR17367.Andrew Trick1-1/+2
Ideally, the machinel model is added at the time the instructions are defined. But many instructions in X86InstrSSE.td still need a model. Without this workaround the scheduler asserts because x86 already has itinerary classes for these instructions, indicating they should be modeled by the scheduler. Since we use the new machine model for other instructions, it expects a new machine model for these too. llvm-svn: 191391
2013-06-17MI-Sched: handle ReadAdvance latencies as used by Swift.Andrew Trick1-1/+4
llvm-svn: 184135
2013-06-15Machine Model: Add MicroOpBufferSize and resource BufferSize.Andrew Trick1-44/+14
Replace the ill-defined MinLatency and ILPWindow properties with with straightforward buffer sizes: MCSchedMode::MicroOpBufferSize MCProcResourceDesc::BufferSize These can be used to more precisely model instruction execution if desired. Disabled some misched tests temporarily. They'll be reenabled in a few commits. llvm-svn: 184032
2013-04-13MI-Sched cleanup. If an instruction has no valid sched class, do not attempt ↵Andrew Trick1-0/+2
to check for a variant. llvm-svn: 179451
2013-03-16Change the default latency for implicit defs.Andrew Trick1-1/+4
Implicit defs are not currently positional and not modeled by the per-operand machine model. Unfortunately, we treat defs that are part of the architectural instruction description, like flags, the same as other implicit defs. Really, they should have a fixed MachineInstr layout and probably shouldn't be "implicit" at all. For now, we'll change the default latency to be the max operand latency. That will give flag setting operands full latency for x86 folded loads. Other kinds of "fake" implicit defs don't occur prior to regalloc anyway, and we would like them to go away postRegAlloc as well. llvm-svn: 177227
2012-12-03Use the new script to sort the includes of every file under lib.Chandler Carruth1-2/+2
Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
2012-11-06misched: TargetSchedule interface for machine resources.Andrew Trick1-4/+35
Expose the processor resources defined by the machine model to the scheduler and other clients through the TargetSchedule interface. Normalize each resource count with respect to other kinds of resources. This allows scheduling heuristics to balance resources against other kinds of resources and latency. llvm-svn: 167444
2012-10-17misched: Better handling of invalid latencies in the machine modelAndrew Trick1-2/+10
llvm-svn: 166107
2012-10-11misched: Handle "transient" non-instructions.Andrew Trick1-17/+23
llvm-svn: 165701
2012-10-10misched: fall-back to a target hook for instr bundles.Andrew Trick1-3/+4
llvm-svn: 165606
2012-10-10misched: Use the TargetSchedModel interface wherever possible.Andrew Trick1-0/+49
Allows the new machine model to be used for NumMicroOps and OutputLatency. Allows the HazardRecognizer to be disabled along with itineraries. llvm-svn: 165603
2012-10-09misched: Add computeInstrLatency to TargetSchedModel.Andrew Trick1-0/+24
llvm-svn: 165566
2012-10-09misched: Allow flags to disable hasInstrSchedModel/hasInstrItineraries for ↵Andrew Trick1-6/+12
external users of TargetSchedule. llvm-svn: 165564
2012-10-04Enable -schedmodel, but prefer itineraries until we have more benchmark data.Andrew Trick1-52/+51
llvm-svn: 165188
2012-09-18TargetSchedule: cleanup computeOperandLatency logic & diagnostics.Andrew Trick1-6/+16
llvm-svn: 164154
2012-09-18TargetSchedModel API. Implement latency lookup, disabled.Andrew Trick1-0/+140
llvm-svn: 164098
2012-09-17Revert r164061-r164067. Most of the new subtarget emitter.Andrew Trick1-140/+0
I have to work out the Target/CodeGen header dependencies before putting this back. llvm-svn: 164072
2012-09-17TargetSchedModel API. Implement latency lookup, disabled.Andrew Trick1-0/+140
llvm-svn: 164065
2012-09-14TargetSchedModel interface. To be implemented...Andrew Trick1-0/+32
llvm-svn: 163934