summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/GlobalISel
Commit message (Collapse)AuthorAgeFilesLines
* GlobalISel: support translation of global addresses.Tim Northover2016-09-122-0/+14
| | | | llvm-svn: 281207
* GlobalISel: translate GEP instructions.Tim Northover2016-09-122-0/+95
| | | | | | | | Unlike SDag, we use a separate G_GEP instruction (much simplified, only taking a single byte offset) to preserve the pointer type information through selection. llvm-svn: 281205
* Fix another -Wunused-variable for non-assert build.Rui Ueyama2016-09-091-3/+4
| | | | llvm-svn: 281073
* Fix -Wunused-variable for non-assert build.Rui Ueyama2016-09-091-3/+2
| | | | llvm-svn: 281069
* GlobalISel: remove G_TYPE and G_PHITim Northover2016-09-093-8/+2
| | | | | | | | 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: fix comments and add assertions for valid instructions.Tim Northover2016-09-091-4/+88
| | | | llvm-svn: 281036
* GlobalISel: move type information to MachineRegisterInfo.Tim Northover2016-09-098-241/+204
| | | | | | | | | | | | | | | | | 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-012-2/+4
| | | | | | | 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-315-5/+15
| | | | | | | | | | 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: combine extracts & sequences created for legalizationTim Northover2016-08-302-0/+83
| | | | | | | | Legalization ends up creating many G_SEQUENCE/G_EXTRACT pairs which leads to inefficient codegen (even for -O0), so add a quick pass over the function to remove them again. llvm-svn: 280155
* 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: switch to SmallVector for pending legalizations.Tim Northover2016-08-291-6/+8
| | | | | | std::queue was doing far to many heap allocations to be healthy. llvm-svn: 279992
* GlobalISel: legalize frem to a libcall on AArch64.Tim Northover2016-08-292-0/+29
| | | | llvm-svn: 279988
* GlobalISel: rework CallLowering so that it can be used for libcalls too.Tim Northover2016-08-293-3/+44
| | | | | | | There should be no functional change here, I'm just making the implementation of "frem" (to libcall) legalization easier for a followup. llvm-svn: 279987
* [InstructionSelect] NumBlocks isn't defined in DEBUG build.Haojian Wu2016-08-291-1/+1
| | | | | | | | | | | | Summary: A follow-up fixing on http://llvm.org/viewvc/llvm-project?view=revision&revision=279905. Reviewers: bkramer Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D23985 llvm-svn: 279959
* [RegBankSelect] Do not abort when the target wants to fall back.Quentin Colombet2016-08-271-17/+48
| | | | llvm-svn: 279906
* [InstructionSelect] Do not abort when the target wants to fall back.Quentin Colombet2016-08-271-7/+28
| | | | llvm-svn: 279905
* [MachineLegalize] Do not abort when the target wants to fall back.Quentin Colombet2016-08-272-6/+26
| | | | llvm-svn: 279904
* [GlobalISel] Teach the core pipeline not to run if ISel failed.Quentin Colombet2016-08-273-0/+14
| | | | llvm-svn: 279889
* [IRTranslator] Do not abort when the target wants to fall back.Quentin Colombet2016-08-261-5/+52
| | | | | | Every pass in the GlobalISel pipeline will need to do something similar. llvm-svn: 279886
* [IRTranslator][NFC] Use DEBUG_TYPE instead of repeating the name.Quentin Colombet2016-08-261-1/+1
| | | | llvm-svn: 279878
* GlobalISel: simplify G_ICMP legalization regime.Tim Northover2016-08-261-30/+20
| | | | | | | | | | | | | | It's unclear how the old %res(32) = G_ICMP { s32, s32 } intpred(eq), %0, %1 is actually different from an s1 verison %res(1) = G_ICMP { s1, s32 } intpred(eq), %0, %1 so we'll remove it for now. llvm-svn: 279843
* GlobalISel: legalize sdiv and srem operations.Tim Northover2016-08-263-0/+46
| | | | llvm-svn: 279842
* GlobalISel: legalize under-width divisions.Tim Northover2016-08-261-0/+27
| | | | llvm-svn: 279841
* GlobalISel: add missing type to G_UADDE instructionsTim Northover2016-08-251-5/+4
| | | | llvm-svn: 279762
* GlobalISel: perform multi-step legalizationTim Northover2016-08-252-2/+41
| | | | llvm-svn: 279758
* 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
* #ifdef out validation code when asserts are disabled to remove unused variableRichard Smith2016-08-231-0/+2
| | | | | | warnings. llvm-svn: 279582
* GlobalISel: make truncate/extend casts uniformTim Northover2016-08-233-21/+46
| | | | | | | 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 integer comparisons on AArch64.Tim Northover2016-08-232-2/+44
| | | | | | | Next step is doing both legalizations at the same time! Marvel at GlobalISel's cunning. llvm-svn: 279566
* GlobalISel: legalize conditional branches on AArch64.Tim Northover2016-08-232-0/+12
| | | | llvm-svn: 279565
* GlobalISel: extend legalizer interface to handle multiple types.Tim Northover2016-08-232-30/+45
| | | | | | | | 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: legalize 1-bit load/store and mark 8/16 bit variants legal on ↵Tim Northover2016-08-231-5/+24
| | | | | | AArch64. llvm-svn: 279548
* GlobalISel: support legalization of G_FCONSTANTsTim Northover2016-08-192-0/+13
| | | | llvm-svn: 279341
* GlobalISel: teach legalizer how to handle integer constants.Tim Northover2016-08-192-3/+12
| | | | llvm-svn: 279340
* GlobalISel: translate floating-point comparisonsTim Northover2016-08-192-11/+29
| | | | llvm-svn: 279319
* GlobalISel: translate floating-point constantsTim Northover2016-08-192-0/+7
| | | | llvm-svn: 279311
* GlobalISel: support translating select instructions.Tim Northover2016-08-192-0/+17
| | | | llvm-svn: 279309
* GlobalISel: fix insert/extract to work on ConstantExprs too.Tim Northover2016-08-191-18/+27
| | | | | | | No tests yet unfortunately (ConstantFolding reduces all supported constants to ConstantInts before we get to translation). Soon. llvm-svn: 279308
* GlobalISel: translate insertvalue instructions.Tim Northover2016-08-191-0/+24
| | | | | | | | | | This adds a G_INSERT instruction, which technically makes G_SEQUENCE redundant (it's equivalent to a G_INSERT into an IMPLICIT_DEF). We'll leave G_SEQUENCE for now though: it's likely to be far more common as it's a fundamental part of legalization, so avoiding the mess and bloat of the extra IMPLICIT_DEFs is probably worthwhile. llvm-svn: 279306
* GlobalISel: improve representation of G_SEQUENCE and G_EXTRACTTim Northover2016-08-193-20/+42
| | | | | | | | | | | | First, make sure all types involved are represented, rather than being implicit from the register width. Second, canonicalize all types to scalar. These operations just act in bits and don't care about vectors. Also standardize spelling of Indices in the MachineIRBuilder (NFC here). llvm-svn: 279294
* GlobalISel: allow extractvalue to extract an aggregate.Tim Northover2016-08-191-1/+1
| | | | llvm-svn: 279287
* GlobalISel: support translation of extractvalue instructions.Tim Northover2016-08-193-2/+23
| | | | llvm-svn: 279285
* GlobalISel: support overflow arithmetic intrinsics.Tim Northover2016-08-193-15/+63
| | | | | | | | | | | | Unsigned addition and subtraction can reuse the instructions created to legalize large width operations (i.e. both produce and consume a carry flag). Signed operations and multiplies get a dedicated op-with-overflow instruction. Once this is produced the two values are combined into a struct register (which will almost always be merged with a corresponding G_EXTRACT as part of legalization). llvm-svn: 279278
* GlobalISel: support irtranslation of icmp instructions.Tim Northover2016-08-172-0/+25
| | | | llvm-svn: 278969
* [AArch64][GlobalISel] Select G_MUL.Ahmed Bougacha2016-08-161-0/+4
| | | | llvm-svn: 278810
* [AArch64][GlobalISel] Select p0 G_FRAME_INDEX.Ahmed Bougacha2016-08-161-2/+2
| | | | | | And mark it as legal. llvm-svn: 278802
* GlobalISel: support loads and stores of strange types.Tim Northover2016-08-151-9/+10
| | | | | | | Before we mischaracterized structs and i1 types as a scalar with size 0 in various ways. llvm-svn: 278744
* GlobalISel: support 'null' constant in translation.Tim Northover2016-08-111-0/+4
| | | | | | | | It's sharing the integer G_CONSTANT for now since I don't *think* it creates any ambiguity (even on weird archs). If that turns out wrong we can create a G_PTRCONSTANT or something. llvm-svn: 278423
* GlobalISel: clear vreg mapping after translating each functionTim Northover2016-08-111-2/+4
| | | | | | | Otherwise we only materialize (shared) constants in the first function they appear in. This doesn't go well. llvm-svn: 278351
OpenPOWER on IntegriCloud