Implement the method FastMaterializeAlloca in Mips fast-isel
Details
Diff Detail
Event Timeline
LGTM with some changes
lib/Target/Mips/MipsFastISel.cpp | ||
---|---|---|
260–263 | This is redundant. DenseMapBase<...>::find() returns DenseMapBase<...>::end() when the key isn't found so there's no need to separately count(AI) and find(AI) | |
test/CodeGen/Mips/Fast-ISel/fastalloca.ll | ||
4–7 | Please drop these four lines from the test. It's better to specify the triple on the command line and using the default datalayout will be better if it ever needs to change. | |
4–7 | Please drop these four lines from the test. It's better to specify the triple on the command line and using the default datalayout will be better if it ever needs to change. (sorry for the duplicate comment, Phabricator won't let me delete either of them for some reason) | |
16–29 | I think we could simplify this test quite a lot. We only want to test alloca instructions so I think we could do something like: define i32 @foo(i32* %d) { %0 = alloca i32, align 4 store i32 %0, i32* %d, align 4 } and just check that appropriate addiu's and sw's are created. Obviously, we'd want to test a few layouts. That said, we've discussed (off-list) your plan to migrate these tests to a style similar to the test/CodeGen/Mips/llvm-ir tests (which tries to test each LLVM-IR instruction with as few dependencies as possible) once the backlog is cleared and I'm happy for this kind of change to be made at that point. | |
31 | Nit: indentation | |
39–57 | Nit: Not needed. |
This is redundant. DenseMapBase<...>::find() returns DenseMapBase<...>::end() when the key isn't found so there's no need to separately count(AI) and find(AI)