Implement materialization of floating point constants in Mips fast-isel.
Details
Diff Detail
Event Timeline
Can you edit the summary to describe what the patch is for? It appears to be a list of commits at the moment.
lib/Target/Mips/MipsFastISel.cpp | ||
---|---|---|
232–249 | I'd put the cast in the caller. The caller would then use something like: if (ConstantFP *Tmp = dyn_cast<ConstantFP>(C)) return MaterializeFP(Tmp, ...); else if (ConstantInt *Tmp = dyn_cast<ConstantInt>(C)) return MaterializeInt(Tmp, ...); ... | |
267–304 | This was already in the previous patch | |
test/CodeGen/Mips/Fast-ISel/simplestorefp1.ll | ||
32–33 | It isn't necessary for this patch, but just to let you know. I believe we need to make emit mthc1 to copy the upper 32-bits for the FRmodeless work | |
test/CodeGen/Mips/Fast-ISel/simplestorei.ll | ||
1–63 ↗ | (On Diff #9189) | This was in the previous patch |
Need to run clang-format before putback.
test/CodeGen/Mips/Fast-ISel/simplestorefp1.ll | ||
---|---|---|
32–33 | I'm going to change this anyway to do loads from the constant pool rather than synthesizing the literal. For sure there will be some changes to handle modeless and also when we do mips64. | |
test/CodeGen/Mips/Fast-ISel/simplestorei.ll | ||
1–63 ↗ | (On Diff #9189) | I was not sure how to just make the delta. I surely won't commit the file again. |
LGTM with the change about putting the cast() in the caller as a dyn_cast() instead of using isa() and cast()
test/CodeGen/Mips/Fast-ISel/simplestorefp1.ll | ||
---|---|---|
32–33 | I assume that some constants will still synthesize the literal. At minimum, 0.0 shouldn't use the constant pool. | |
test/CodeGen/Mips/Fast-ISel/simplestorei.ll | ||
1–63 ↗ | (On Diff #9189) | 'arc diff $git_revision' will make the delta from the specified revision instead of the default origin/master. |
I did not understand the comment about using dyn_cast instead of isa.
I will commit as is and make the update after. You can explain what you meant to me.
I did not understand the comment about using dyn_cast instead of isa.
As discussed on the r210414 post-commit review thread, it seems you already made this change in r207790. The original diff for this revision passed a Constant* into MaterializeFP and used isa() in the caller, and cast() in the callee. The request was to move the cast() to the caller, combine it with the isa() to make a dyn_cast(), and change MaterializeFP to take a ConstantFP* instead of Constant*.
The patch here is rather noisy but rL210414 as committed looks good to me (apart from the commit message which should be corrected before you re-commit).
I'd put the cast in the caller. The caller would then use something like: