summaryrefslogtreecommitdiff
path: root/lib/Target/Hexagon/RDFGraph.h
AgeCommit message (Collapse)Author
2017-12-07[CodeGen] Use MachineOperand::print in the MIRPrinter for MO_Register.Francis Visoiu Mistrih
Work towards the unification of MIR and debug output by refactoring the interfaces. For MachineOperand::print, keep a simple version that can be easily called from `dump()`, and a more complex one which will be called from both the MIRPrinter and MachineInstr::print. Add extra checks inside MachineOperand for detached operands (operands with getParent() == nullptr). https://reviews.llvm.org/D40836 * find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/kill: ([^ ]+) ([^ ]+)<def> ([^ ]+)/kill: \1 def \2 \3/g' * find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/kill: ([^ ]+) ([^ ]+) ([^ ]+)<def>/kill: \1 \2 def \3/g' * find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/kill: def ([^ ]+) ([^ ]+) ([^ ]+)<def>/kill: def \1 \2 def \3/g' * find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/<def>//g' * find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<kill>/killed \1/g' * find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<imp-use,kill>/implicit killed \1/g' * find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<dead>/dead \1/g' * find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<def[ ]*,[ ]*dead>/dead \1/g' * find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<imp-def[ ]*,[ ]*dead>/implicit-def dead \1/g' * find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<imp-def>/implicit-def \1/g' * find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<imp-use>/implicit \1/g' * find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<internal>/internal \1/g' * find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<undef>/undef \1/g' git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320022 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-04[CodeGen] Unify MBB reference format in both MIR and debug outputFrancis Visoiu Mistrih
As part of the unification of the debug format and the MIR format, print MBB references as '%bb.5'. The MIR printer prints the IR name of a MBB only for block definitions. * find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" \) -type f -print0 | xargs -0 sed -i '' -E 's/BB#" << ([a-zA-Z0-9_]+)->getNumber\(\)/" << printMBBReference(*\1)/g' * find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" \) -type f -print0 | xargs -0 sed -i '' -E 's/BB#" << ([a-zA-Z0-9_]+)\.getNumber\(\)/" << printMBBReference(\1)/g' * find . \( -name "*.txt" -o -name "*.s" -o -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" \) -type f -print0 | xargs -0 sed -i '' -E 's/BB#([0-9]+)/%bb.\1/g' * grep -nr 'BB#' and fix Differential Revision: https://reviews.llvm.org/D40422 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319665 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-05[RDF] Simplify construction of maximal registersKrzysztof Parzyszek
The old algoritm was not correct, although it worked most of the time. Avoid the complex reachability analysis and simply calculate the maximal registers out of the set of all referenced registers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314991 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-01[Hexagon] Fix some Clang-tidy modernize-use-using and Include What You Use ↵Eugene Zelenko
warnings; other minor fixes (NFC). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309746 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19[RDF] Switch NodeList to SmallVector from std::vectorKrzysztof Parzyszek
The list has a single element 75+% of the time, reservation of 4 elements is sufficient in 95% of cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300705 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-10[RDF] Implement Liveness::getNearestAliasedRef(Reg, Inst)Krzysztof Parzyszek
This function will find the closest ref node aliased to Reg that is in an instruction preceding Inst. This could be used to identify the hypothetical reaching def of Reg, if Reg was a member of Inst. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297524 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-16[RDF] Differentiate between defining and clobbering nodesKrzysztof Parzyszek
Defining nodes should not alias with one another, while clobbering nodes can. When pushing defs on stacks, push clobbers first, link non-clobbering defs, then push the defs. The data flow in a statement is now: uses -> clobbers -> defs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295356 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-16[RDF] Move normalize(RegisterRef) to PhysicalRegisterInfoKrzysztof Parzyszek
Remove the duplicate from DFG and make some members of PRI private. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295351 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-30[RDF] Add support for regmasksKrzysztof Parzyszek
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293538 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-30[RDF] Extract the physical register information into a separate classKrzysztof Parzyszek
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293510 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-30[RDF] Add phis for entry block live-ins (in addition to function live-ins)Krzysztof Parzyszek
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293491 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-04[Hexagon, TableGen] Fix some Clang-tidy modernize and Include What You Use ↵Eugene Zelenko
warnings; other minor fixes (NFC). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290925 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-16Implement LaneBitmask::any(), use it to replace !none(), NFCIKrzysztof Parzyszek
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289974 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15Extract LaneBitmask into a separate typeKrzysztof Parzyszek
Specifically avoid implicit conversions from/to integral types to avoid potential errors when changing the underlying type. For example, a typical initialization of a "full" mask was "LaneMask = ~0u", which would result in a value of 0x00000000FFFFFFFF if the type was extended to uint64_t. Differential Revision: https://reviews.llvm.org/D27454 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289820 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18Timer: Track name and description.Matthias Braun
The previously used "names" are rather descriptions (they use multiple words and contain spaces), use short programming language identifier like strings for the "names" which should be used when exporting to machine parseable formats. Also removed a unused TimerGroup from Hexxagon. Differential Revision: https://reviews.llvm.org/D25583 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287369 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-24Revert r284972 and remove other defaulted copy/move constructors/=Krzysztof Parzyszek
David Blaikie pointed out that we get them for free without having to write anything. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284996 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-24[RDF] Add default move constructors/assignment operatorsKrzysztof Parzyszek
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284972 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-21[RDF] Use RegisterId typedef more consistently, NFCKrzysztof Parzyszek
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284857 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19[RDF] Switch RefMap in liveness calculation to use lane masksKrzysztof Parzyszek
This required reengineering of some of the part of liveness calculation, including fixing some issues caused by the limitations of the previous approach. The current code is not necessarily the fastest, but it should be functionally correct (at least more so than before). The compile-time performance will be addressed in the future. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284609 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14[RDF] Switch RegisterRef to be a pair (Register, LaneMask)Krzysztof Parzyszek
Use PackedRegisterRef to store the register information in the graph nodes. This commit also removes support for virtual registers. It has never been tested or used. It will be possible to add it back if there is a need. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284255 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03[RDF] Replace RegisterAliasInfo with target-independent code using lane masksKrzysztof Parzyszek
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283122 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-27[RDF] Add "dead" flag to node attributesKrzysztof Parzyszek
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282520 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-27[RDF] Special treatment of exception handling registersKrzysztof Parzyszek
A landing pad can have live-in registers that are defined by the runtime, not the program (exception pointer register and exception selector register). Make sure to recognize that case and not link these registers with any defs in the program. Each landing pad will have phi nodes added at the beginning to provide definitions of these registers, but the uses of those phi nodes will not have any reaching defs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282519 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22[RDF] Add initial support for lane masks in the DFGKrzysztof Parzyszek
Use lane masks for calculating covering and aliasing of register references. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282194 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22[RDF] Use uint32_t for register numbers instead of unsignedKrzysztof Parzyszek
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282190 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-07[RDF] Introduce "undef" flag for ref nodesKrzysztof Parzyszek
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280851 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22[RDF] Make the graph construction/use less expensiveKrzysztof Parzyszek
- FuncNode::findBlock traverses the function every time. Avoid using it, and keep a cache of block addresses in DataFlowGraph instead. - The operator[] in the map of definition stacks was very slow. Replace the map with unordered_map. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276429 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27[hexagon] Move BlockRanges and RDF stuff into the llvm namespace.Benjamin Kramer
No functional change intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270980 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28[RDF] Add option to keep dead phi nodes in DFGKrzysztof Parzyszek
Dead phi nodes are needed for code motion (such as copy propagation), where a new use would be placed in a location that would be dominated by a dead phi. Such a transformation is not legal for copy propagation, and the existence of the phi would prevent it, but if the phi is not there, it may appear to be valid. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267932 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-18[NFC] Header cleanupMehdi Amini
Removed some unused headers, replaced some headers with forward class declarations. Found using simple scripts like this one: clear && ack --cpp -l '#include "llvm/ADT/IndexedMap.h"' | xargs grep -L 'IndexedMap[<]' | xargs grep -n --color=auto 'IndexedMap' Patch by Eugene Kosov <claprix@yandex.ru> Differential Revision: http://reviews.llvm.org/D19219 From: Mehdi Amini <mehdi.amini@apple.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266595 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-18[RDF] Allow unlinking ref nodes from data-flow chains onlyKrzysztof Parzyszek
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258073 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12Register Data Flow: data flow graphKrzysztof Parzyszek
Target independent, SSA-based data flow framework for representing data flow between physical registers. This commit implements the creation of the actual data flow graph. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257477 91177308-0d34-0410-b5e6-96231b3b80d8