summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MIRParser
Commit message (Collapse)AuthorAgeFilesLines
...
* MIR Serialization: Serialize the simple MachineFrameInfo attributes.Alex Lorenz2015-07-091-0/+25
| | | | | | | | | | | | This commit serializes the 13 scalar boolean and integer attributes from the MachineFrameInfo class: IsFrameAddressTaken, IsReturnAddressTaken, HasStackMap, HasPatchPoint, StackSize, OffsetAdjustment, MaxAlignment, AdjustsStack, HasCalls, MaxCallFrameSize, HasOpaqueSPAdjustment, HasVAStart, and HasMustTailInVarArgFunc. These attributes are serialized as part of the frameInfo YAML mapping, which itself is a part of the machine function's YAML mapping. llvm-svn: 241844
* MIR Serialization: Serialize the 'undef' register machine operand flag.Alex Lorenz2015-07-083-2/+8
| | | | llvm-svn: 241762
* MIR Parser: Remove redundant TODO comment. NFC.Alex Lorenz2015-07-081-2/+0
| | | | | | This TODO comment has been redundant since r240474. llvm-svn: 241737
* MIR Serialization: Serialize the 'killed' register machine operand flag.Alex Lorenz2015-07-083-4/+11
| | | | llvm-svn: 241734
* MIR Parser: Use source locations for MBB naming errors.Alex Lorenz2015-07-081-4/+18
| | | | | | | | | This commit changes the type of the field 'Name' in the struct 'yaml::MachineBasicBlock' from 'std::string' to 'yaml::StringValue'. This change allows the MIR parser to report errors related to the MBB name with the proper source locations. llvm-svn: 241718
* MIR Serialization: Serialize the 'dead' register machine operand flag.Alex Lorenz2015-07-073-2/+9
| | | | llvm-svn: 241624
* MIR Parser: wrap 'MBBSlots' from the MI parsing functions in a struct. NFC.Alex Lorenz2015-07-073-33/+32
| | | | | | | | | | | This commit modifies the interface for the machine instruction parsing functions by wrapping the parameter 'MBBSlots' in a new structure called 'PerFunctionMIParsingState'. This change is useful as in the future I will be able to pass new parameters to the machine instruction parser just by modifying the 'PerFunctionMIParsingState' structure instead of adding a new parameter to each function. llvm-svn: 241607
* MIR Parser: Verify the implicit machine register operands.Alex Lorenz2015-07-071-5/+88
| | | | | | | | | | | | This commit verifies that the parsed machine instructions contain the implicit register operands as specified by the MCInstrDesc. Variadic and call instructions aren't verified. Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D10781 llvm-svn: 241537
* MIR Serialization: Serialize the implicit register flag.Alex Lorenz2015-07-063-20/+51
| | | | | | | | | | | | | | This commit serializes the implicit flag for the register machine operands. It introduces two new keywords into the machine instruction syntax: 'implicit' and 'implicit-def'. The 'implicit' keyword is used for the implicit register operands, and the 'implicit-def' keyword is used for the register operands that have both the implicit and the define flags set. Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D10709 llvm-svn: 241519
* MIR Serialization: Serialize MBB successors.Alex Lorenz2015-06-303-3/+46
| | | | | | | | | | | | | This commit implements serialization of the machine basic block successors. It uses a YAML flow sequence that contains strings that have the MBB references. The MBB references in those strings use the same syntax as the MBB machine operands in the machine instruction strings. Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D10699 llvm-svn: 241093
* MIR Parser: refactor error reporting for machine instruction parser errors. NFC.Alex Lorenz2015-06-301-5/+14
| | | | | | | This commit extracts the code that reports an error that's produced by the machine instruction parser into a new method that can be reused in other places. llvm-svn: 241086
* MIR Parser: make the machine instruction parsing interface more consistent. NFC.Alex Lorenz2015-06-303-30/+26
| | | | | | | | | This commit refactors the interface for machine instruction parser. It adopts the pattern of returning a bool and passing in the result in the first argument that is used by the other parsing methods for the the method 'parse' and the function 'parseMachineInstr'. llvm-svn: 241085
* MIR Parser: adopt the 'maybeLex...' pattern. NFC.Alex Lorenz2015-06-301-22/+37
| | | | | | | | | | | | This commit refactors the machine instruction lexer so that the lexing functions use the 'maybeLex...' pattern, where they determine if they can lex the current token by themselves. Reviewers: Sean Silva Differential Revision: http://reviews.llvm.org/D10817 llvm-svn: 241078
* MIR Serialization: Serialize the register mask machine operands.Alex Lorenz2015-06-291-1/+39
| | | | | | | | | | | | | | | | | This commit implements serialization of the register mask machine operands. This commit serializes only the call preserved register masks that are defined by a target, it doesn't serialize arbitrary register masks. This commit also extends the TargetRegisterInfo class and TableGen so that the users of TRI can get the list of all the call preserved register masks and their names. Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D10673 llvm-svn: 240966
* MIR Serialization: Serialize global address machine operands.Alex Lorenz2015-06-265-9/+78
| | | | | | | | | | | | This commit serializes the global address machine operands. This commit doesn't serialize the operand's offset and target flags, it serializes only the global value reference. Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D10671 llvm-svn: 240851
* MIR Serialization: Serialize machine basic block operands.Alex Lorenz2015-06-265-21/+121
| | | | | | | | | | | | | | | | | | | | | | | | | This commit serializes machine basic block operands. The machine basic block operands use the following syntax: %bb.<id>[.<name>] This commit also modifies the YAML representation for the machine basic blocks - a new, required field 'id' is added to the MBB YAML mapping. The id is used to resolve the MBB references to the actual MBBs. And while the name of the MBB can be included in a MBB reference, this name isn't used to resolve MBB references - as it's possible that multiple MBBs will reference the same BB and thus they will have the same name. If the name is specified, the parser will verify that it is equal to the name of the MBB with the specified id. Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D10608 llvm-svn: 240792
* MIR Serialization: Serialize simple MachineRegisterInfo attributes.Alex Lorenz2015-06-241-0/+19
| | | | | | | | | | | | | This commit serializes the 3 scalar boolean attributes from the MachineRegisterInfo class: IsSSA, TracksRegLiveness, and TracksSubRegLiveness. These attributes are serialized as part of the machine function YAML mapping. Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D10618 llvm-svn: 240579
* MIR Serialization: Serialize the null register operands.Alex Lorenz2015-06-243-2/+13
| | | | | | | | | | | | This commit serializes the null register machine operands. It uses the '_' keyword to represent them, but the parser also allows the '%noreg' named register syntax. Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D10580 llvm-svn: 240558
* MILexer.cpp: Try to fix a warning. [-Wsign-compare]NAKAMURA Takumi2015-06-241-1/+1
| | | | llvm-svn: 240525
* MIR Serialization: Serialize immediate machine operands.Alex Lorenz2015-06-233-2/+38
| | | | | | | | Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D10573 llvm-svn: 240481
* MIR Parser: Use correct source locations for machine instruction diagnostics.Alex Lorenz2015-06-231-2/+23
| | | | | | | | | | | | This commit translates the source locations for MIParser diagnostics from the locations in the machine instruction string to the locations in the MIR file. Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D10574 llvm-svn: 240474
* MIR Serialization: Serialize physical register machine operands.Alex Lorenz2015-06-233-3/+164
| | | | | | | | | | | This commit introduces functionality that's used to serialize machine operands. Only the physical register operands are serialized by this commit. Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D10525 llvm-svn: 240425
* MIR Serialization: Introduce a lexer for machine instructions.Alex Lorenz2015-06-224-11/+193
| | | | | | | | | | | | This commit adds a function that tokenizes the string containing the machine instruction. This commit also adds a struct called 'MIToken' which is used to represent the lexer's tokens. Reviewers: Sean Silva Differential Revision: http://reviews.llvm.org/D10521 llvm-svn: 240323
* MIR Serialization: Serialize machine instruction names.Alex Lorenz2015-06-224-3/+153
| | | | | | | | | | | | | | | | This commit implements initial machine instruction serialization. It serializes machine instruction names. The instructions are represented using a YAML sequence of string literals and are a part of machine basic block YAML mapping. This commit introduces a class called 'MIParser' which will be used to parse the machine instructions and operands. Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D10481 llvm-svn: 240295
* MIR Parser: report an error when a basic block isn't found.Alex Lorenz2015-06-191-1/+3
| | | | | | | This commit reports an error when the MIR parser can't find a basic block with the machine basic block's name. llvm-svn: 240174
* MIR Serialization: Serialize the list of machine basic blocks with simple ↵Alex Lorenz2015-06-191-0/+30
| | | | | | | | | | | | | | attributes. This commit implements the initial serialization of machine basic blocks in a machine function. Only the simple, scalar MBB attributes are serialized. The reference to LLVM IR's basic block is preserved when that basic block has a name. Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D10465 llvm-svn: 240145
* MIR Parser: Report an error when a machine function doesn't have a ↵Alex Lorenz2015-06-161-0/+3
| | | | | | | | | | | | | corresponding function. This commit reports an error when a machine function from a MIR file that contains LLVM IR can't find a function with the same name in the loaded LLVM IR module. Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D10468 llvm-svn: 239831
* MIR Serialization: Print and parse simple machine function attributes.Alex Lorenz2015-06-161-0/+5
| | | | | | | | | | | This commit serializes the simple, scalar attributes from the 'MachineFunction' class. Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D10449 llvm-svn: 239790
* MIR Serialization: Create dummy functions when the MIR file doesn't have ↵Alex Lorenz2015-06-151-3/+24
| | | | | | | | | | | | | | | LLVM IR. This commit creates a dummy LLVM IR function with one basic block and an unreachable instruction for each parsed machine function when the MIR file doesn't have LLVM IR. This change is required as the machine function analysis pass creates machine functions only for the functions that are defined in the current LLVM module. Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D10135 llvm-svn: 239778
* MIR Serialization: Report an error when machine functions have the same name.Alex Lorenz2015-06-151-0/+3
| | | | | | | | | | | | This commit reports an error when the MIR parser encounters a machine function with the name that is the same as the name of a different machine function. Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D10130 llvm-svn: 239774
* MIR Serialization: Connect the machine function analysis pass to the MIR parser.Alex Lorenz2015-06-151-22/+83
| | | | | | | | | | | | | | | | | | | | | This commit connects the machine function analysis pass (which creates machine functions) to the MIR parser, which will initialize the machine functions with the state from the MIR file and reconstruct the machine IR. This commit introduces a new interface called 'MachineFunctionInitializer', which can be used to provide custom initialization for the machine functions. This commit also introduces a new diagnostic class called 'DiagnosticInfoMIRParser' which is used for MIR parsing errors. This commit modifies the default diagnostic handling in LLVMContext - now the the diagnostics are printed directly into llvm::errs() so that the MIR parsing errors can be printed with colours. Reviewers: Justin Bogner Differential Revision: http://reviews.llvm.org/D9928 llvm-svn: 239753
* MIR Serialization: use correct line and column numbers for LLVM IR errors.Alex Lorenz2015-05-291-1/+40
| | | | | | | | | | | | | This commit translates the line and column numbers for LLVM IR errors from the numbers in the YAML block scalar to the numbers in the MIR file so that the MIRParser users can report LLVM IR errors with the correct line and column numbers. Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D10108 llvm-svn: 238576
* MIR Serialization: print and parse machine function names.Alex Lorenz2015-05-281-14/+56
| | | | | | | | | | | | | | | | | | This commit introduces a serializable structure called 'llvm::yaml::MachineFunction' that stores the machine function's name. This structure will mirror the machine function's state in the future. This commit prints machine functions as YAML documents containing a YAML mapping that stores the state of a machine function. This commit also parses the YAML documents that contain the machine functions. Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D9841 llvm-svn: 238519
* Resubmit r237954 (MIR Serialization: print and parse LLVM IR using MIR format).Alex Lorenz2015-05-274-0/+130
This commit a 3rd attempt at comitting the initial MIR serialization patch. The first commit (r237708) was reverted in 237730. Then the second commit (r237954) was reverted in r238007, as the MIR library under CodeGen caused a circular dependency where the CodeGen library depended on MIR and MIR library depended on CodeGen. This commit has fixed the dependencies between CodeGen and MIR by reorganizing the MIR serialization code - the code that prints out MIR has been moved to CodeGen, and the MIR library has been renamed to MIRParser. Now the CodeGen library doesn't depend on the MIRParser library, thus the circular dependency no longer exists. --Original Commit Message-- MIR Serialization: print and parse LLVM IR using MIR format. This commit is the initial commit for the MIR serialization project. It creates a new library under CodeGen called 'MIR'. This new library adds a new machine function pass that prints out the LLVM IR using the MIR format. This pass is then added as a last pass when a 'stop-after' option is used in llc. The new library adds the initial functionality for parsing of MIR files as well. This commit also extends the llc tool so that it can recognize and parse MIR input files. Reviewers: Duncan P. N. Exon Smith, Matthias Braun, Philip Reames Differential Revision: http://reviews.llvm.org/D9616 llvm-svn: 238341
OpenPOWER on IntegriCloud