We add code to materialize all integer literals.
Details
Diff Detail
Event Timeline
lib/Target/Mips/MipsFastISel.cpp | ||
---|---|---|
246–274 | You could share more code between the paths using something like: unsigned Hi = (Imm >> 16) & 0xffff; unsigned Lo = Imm & 0xffff; if (Hi && !isImm<16>(Imm)) { BuildMI(..., TII.get(Mips::LUi), ...)... Imm &= 0xffff; } if (Lo) { unsigned Opcode = isImm<16>(Imm) ? Mips::ADDiu : Mips::ORi) BuildMI(..., TII.get(Opcode), ...)... } | |
test/CodeGen/Mips/Fast-ISel/simplestorei.ll | ||
11–13 | Inconsistent indentation. It happens in the other functions too. |
lib/Target/Mips/MipsFastISel.cpp | ||
---|---|---|
246–274 | I see your point now. We can change it as you suggest. I just need to add some comments. |
lib/Target/Mips/MipsFastISel.cpp | ||
---|---|---|
246–274 | Upon further reflection, I think that what I have now is very clear. I don't think we are adding anything from reducing a few lines of code. Right now there are four case: I would like to go back though and make some better BuildMI functions because we are repeating too many of the same parameters. |
LGTM with the indentation nits.
lib/Target/Mips/MipsFastISel.cpp | ||
---|---|---|
246–274 | I disagree but it's very subjective and I don't have a strong argument in favour of either style. I suspect that you'll find the number of cases grows significantly when support for 64-bit immediates is added (particularly with MIPS64r6). We can refactor if/when that happens. |
You could share more code between the paths using something like: