[PATCH] [mips] Tolerate the use of the %z inline asm operand modifier with non-immediates.

Daniel Sanders daniel.sanders at imgtec.com
Wed Nov 5 05:56:17 PST 2014


LGTM with a small change so that we have to correct the test once we've fixed the materialization of 0.

================
Comment at: test/CodeGen/Mips/inlineasm-operand-code.ll:89
@@ +88,3 @@
+;CHECK_LITTLE_32:    #APP
+;CHECK_LITTLE_32:    mtc0 ${{[0-9]+}}, ${{[0-9]+}}
+;CHECK_LITTLE_32:    #NO_APP
----------------
tomatabacu wrote:
> dsanders wrote:
> > Shouldn't this be restricted to $0?
> No, because in this case we no longer have the "J" constraint (which makes zero-values into immediates), so the value is always put into a register.
The reason I think it should be $0 is that materializing 0 can be done without any code. Whereas the above examples passes in the immediate 0 and printed it as $0, in this code I believe this one should be passing in the register $0.

As we discussed off-list, the code generator is currently materializing 0 with 'addiu $1, $zero, 0'. We need to fix this but it's not related to your patch.

For now, could you add an explicit check for the 'addiu ${{[0-9]+}}, $zero, 0' along with a fixme comment explaining the issue. This way, we will be prompted to correct the test when we fix the materialization problem.

http://reviews.llvm.org/D6023






More information about the llvm-commits mailing list