Mips linker doesn't generate lazy binding stub for a function whose address is taken in the program.
Details
Diff Detail
Event Timeline
lib/Target/Mips/MipsISelLowering.cpp | ||
---|---|---|
2425 | I agree that this is equivalent, but is it possible to test for MO_GOT_CALL instead of the conditions that lead to choosing MO_GOT_CALL? | |
test/CodeGen/Mips/prevent-hoisting.ll | ||
13–26 | This is just fixing up a test where the instructions changed order isn't it? If so, I feel that there ought to be a more robust way of testing for this. This is close: CHECK-NEXT: {{BB[0-9_#]+}}: CHECK-DAG: sll $1, $[[R0:[0-9]+]], 4 CHECK: {{BB[0-9_#]+}}: CHECK: [[BB0]]: but there's no guarantee that there will be a second basic block between the two. If neither of us can think of anything better, then we should go ahead with this change as-is and maintain it when necessary. |
lib/Target/Mips/MipsISelLowering.cpp | ||
---|---|---|
2425 | Done. | |
test/CodeGen/Mips/prevent-hoisting.ll | ||
13–26 |
Yes. Currently the following sequence is generated at the start of two blocks: sll $1, $2, 4 sll $2, $2, 6 addu $1, $2, $1 lw $2, %got(assignSE2partition)($16) CHECK-NEXT checks only for the first instruction (it checks for instructions up to the first one that changes $at, which in this case is the first instruction). After the patch is applied, there are the same 4 instructions at the start of two blocks, but reordered: lw $2, %got(assignSE2partition)($2) sll $1, $3, 4 sll $3, $3, 6 addu $1, $3, $1 CHECK-NEXTs in the patch now check for first two instructions. Adding CHECK-DAG for all 4 instructions would protect from reordering, but the test must also make sure that all 4 instructions are at the start of the block, and I think that's not possible to do when DAG is used (that is, to combine DAG and NEXT). |
I agree that this is equivalent, but is it possible to test for MO_GOT_CALL instead of the conditions that lead to choosing MO_GOT_CALL?