Details
Diff Detail
Event Timeline
I messed up this arc call. Hopefully this adds the rest of the files.
Updating D3527: Add basic functionality for assignment of ints.
This creates a lot of core infrastructure in which to add, with little
effort, quite a bit more to mips fast-isel
I've added a few comments inline.
One high-level suggestion I'd like to make is that I think it would be good to flesh out the materialization of constants before you go much further on things that depend on materializing constants. I'm thinking along the lines of a set of tests similar to nullvoid.ll with 'return i8 1', 'return i32 65536', etc.
lib/Target/Mips/MipsFastISel.cpp | ||
---|---|---|
20 | plus some? | |
29 | This should probably be an APInt or at least an int64_t | |
96–100 | It looks like you are accounting for future changes here. When would this be different from isTypeLegal()? | |
103–106 | It would be better to make this a test to allow things you are able to handle than a test to exclude things you can't. For example, it seems unlikely that ConstantArray or FPMathOperator are an acceptable values but these if-statements will currently accept them. | |
117–118 | In isTypeLegal() you checked for MVT::Other as well as isSimple(). Is that not necessary here? | |
133–134 | It would be good to have a fixme comment explaining that this is temporary | |
165–167 | I'd invert this if-statement to: if (EmitStore(...)) return true; return false; | |
208 | In what way is it broken? | |
210–211 | Is the IsThreadLocal variable necessary? It looks like it would be more readable in the if-statement condition |
I agree with your high level comment regarding finishing materialize. I will work on more incremental changes to finish that. I'm essentially copying what other ports do, and modifying it for Mips specifics.
I'm cut and pasting some code from other ports in other areas too and I agree that at time it's awkward because I'm taking out pieces and those that remain can be structured better.
I'll take out things as you suggested that are not being used now and clean things.
I will add it back in as necessary in order to keep the code looking nice.
Essentially, all these fast-isel ports look the same so I know, at least for this first version, what most of these functions will eventually look like.
I'm trying not to allow things to pass through fast-isel that we can't handle yet; but it's not easy to always know.
The existing ports are the best way barring spending months reading the supporting code.
lib/Target/Mips/MipsFastISel.cpp | ||
---|---|---|
96–100 | This is copied from other ports. They allow types that can be simply zero or sign extended like i1, i8 and i16 I will add a comment to that effect. | |
103–106 | This is kind of a catch 22 in terms of what I am doing here. I'm making sure that I don't accept cases that I don't intend to by mimicking the behavior of other ports. |
I will try and do most of what you want except in cases where it will take a huge amount of time because the code will morph back to how it looks now when the additional features are added.
Updating D3527: Add basic functionality for assignment of ints.
This creates a lot of core infrastructure in which to add, with little
effort, quite a bit more to mips fast-isel
With the following changes it will LGTM:
- Address::Offset changed to an APInt or at least an int64_t
- The various FIXME comments added. Particularly the ones that point out thing that are present in other ports but not implemented yet. They will make it obvious that some of the odd-looking style only looks odd because of the missing pieces.
- The ARM-specific comment about FastISel TLS changed to be accurate for MIPS.
lib/Target/Mips/MipsFastISel.cpp | ||
---|---|---|
103–106 | Ok, having looked at the other ports I see what you are doing. A few fixme comments mentioning the missing pieces would be useful. | |
165–167 | I still think this if-statement ought to be inverted but I see all the other ports are using the same style. Up to you if you invert it or not. | |
208 | Having looked at the other ports, this comment seems to be ARM specific. Please change it to something like 'FastISel TLS support is not implemented, punt to SelectionDAG'. |
Updating D3527: Add basic functionality for assignment of ints.
This creates a lot of core infrastructure in which to add, with little
effort, quite a bit more to mips fast-isel
plus some?