summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/GlobalISel/MachineLegalizer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* GlobalISel: rename legalizer components to match others.Tim Northover2016-10-141-173/+0
| | | | | | | | | | The previous names were both misleading (the MachineLegalizer actually contained the info tables) and inconsistent with the selector & translator (in having a "Machine") prefix. This should make everything sensible again. The only functional change is the name of a couple of command-line options. llvm-svn: 284287
* GlobalISel: remove G_TYPE and G_PHITim Northover2016-09-091-5/+0
| | | | | | | | These instructions were only necessary when type information was stored in the MachineInstr (because only generic MachineInstrs possessed a type). Now that it's in MachineRegisterInfo, COPY and PHI work fine. llvm-svn: 281037
* GlobalISel: move type information to MachineRegisterInfo.Tim Northover2016-09-091-6/+25
| | | | | | | | | | | | | | | | | We want each register to have a canonical type, which means the best place to store this is in MachineRegisterInfo rather than on every MachineInstr that happens to use or define that register. Most changes following from this are pretty simple (you need an MRI anyway if you're going to be doing any transformations, so just check the type there). But legalization doesn't really want to check redundant operands (when, for example, a G_ADD only ever has one type) so I've made use of MCInstrDesc's operand type field to encode these constraints and limit legalization's work. As an added bonus, more validation is possible, both in MachineVerifier and MachineIRBuilder (coming soon). llvm-svn: 281035
* GlobalISel: add a G_PHI instruction to give phis a type.Tim Northover2016-09-011-1/+3
| | | | | | | They're another source of generic vregs, which are going to need a type on the definition when we remove the register width from MachineRegisterInfo. llvm-svn: 280412
* GlobalISel: use G_TYPE to annotate physregs with a type.Tim Northover2016-08-311-0/+3
| | | | | | | | | | More preparation for dropping source types from MachineInstrs: regsters coming out of already-selected code (i.e. non-generic instructions) don't have a type, but that information is needed so we must add it manually. This is done via a new G_TYPE instruction. llvm-svn: 280292
* GlobalISel: use multi-dimensional arrays for legalize actions.Tim Northover2016-08-291-12/+16
| | | | | | | | | | | Instead of putting all possible requests into a single table, we can perform the extremely dense lookup based on opcode and type-index in constant time using multi-dimensional array-like things. This roughly halves the time spent doing legalization, which was dominated by queries against the Actions table. llvm-svn: 280011
* GlobalISel: legalize frem to a libcall on AArch64.Tim Northover2016-08-291-0/+1
| | | | llvm-svn: 279988
* GlobalISel: legalize sdiv and srem operations.Tim Northover2016-08-261-0/+1
| | | | llvm-svn: 279842
* Don't use "return {...}" to initialize a std::tuple. This has only been validRichard Smith2016-08-231-2/+2
| | | | | | | | | since 2015 (n4387), though it's allowed by a library DR so new implementations accept it in their C++11 modes... This should unbreak the build with libstdc++ 4.9. llvm-svn: 279583
* GlobalISel: make truncate/extend casts uniformTim Northover2016-08-231-1/+1
| | | | | | | They really should have both types represented, but early variants were created before MachineInstrs could have multiple types so they're rather ambiguous. llvm-svn: 279567
* GlobalISel: legalize conditional branches on AArch64.Tim Northover2016-08-231-0/+5
| | | | llvm-svn: 279565
* GlobalISel: extend legalizer interface to handle multiple types.Tim Northover2016-08-231-23/+31
| | | | | | | | Instructions like G_ICMP have multiple types that may need to be legalized (the boolean output and nearly arbitrary inputs in this case). So the legalizer must be capable of deciding what to do for each of them separately. llvm-svn: 279554
* GlobalISel: teach legalizer how to handle integer constants.Tim Northover2016-08-191-2/+3
| | | | llvm-svn: 279340
* GlobalISel: add code to widen scalar G_ADDTim Northover2016-08-041-0/+5
| | | | llvm-svn: 277747
* [GlobalISel] Const-ify MachineInstrs passed to MachineLegalizer.Ahmed Bougacha2016-08-021-2/+2
| | | | llvm-svn: 277445
* GlobalISel: implement legalization pass, with just one transformation.Tim Northover2016-07-221-4/+5
| | | | | | | | | This adds the actual MachineLegalizeHelper to do the work and a trivial pass wrapper that legalizes all instructions in a MachineFunction. Currently the only transformation supported is splitting up a vector G_ADD into one acting on smaller vectors. llvm-svn: 276461
* GlobalISel: implement Legalization querying framework.Tim Northover2016-07-201-0/+128
This adds an (incomplete, inefficient) framework for deciding what to do with some operation on a given type. llvm-svn: 276184
OpenPOWER on IntegriCloud