[PATCH] D70724: [PowerPC] Add Support for indirect calls on AIX.
Hubert Tong via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 4 11:41:12 PST 2019
hubert.reinterpretcast added inline comments.
================
Comment at: llvm/test/CodeGen/PowerPC/aix_indirect_call.ll:33
+; MIR32-DAG: renamable $[[REG:r[0-9]+]] = LWZ 0, renamable $r3 :: (dereferenceable invariant load 4 from %ir.0)
+; MIR32-DAG: $r2 = LWZ 4, killed renamable $r3 :: (dereferenceable invariant load 4 from %ir.0 + 4)
+; MIR32-DAG: MTCTR killed renamable $[[REG]], implicit-def $ctr
----------------
Just noting here that the test does not actually enforce that r2 is saved before being written to. Similarly for the other tests.
================
Comment at: llvm/test/CodeGen/PowerPC/aix_indirect_call.ll:34
+; MIR32-DAG: $r2 = LWZ 4, killed renamable $r3 :: (dereferenceable invariant load 4 from %ir.0 + 4)
+; MIR32-DAG: MTCTR killed renamable $[[REG]], implicit-def $ctr
+; MIR32-NEXT: BCTRL_LWZinto_toc 20, $r1, csr_aix32, implicit-def dead $lr, implicit-def dead $r2, implicit $ctr, implicit $rm, implicit $r11, implicit $r2, implicit-def $r1, implicit-def $r3
----------------
Just noting here that the test does not actually enforce that the input register is populated before this instruction. Similarly for the other tests.
================
Comment at: llvm/test/CodeGen/PowerPC/aix_indirect_call.ll:72
+; OBJ32: 94 21 ff c0 stwu 1, -64(1)
+; OBJ32-DAG: 80 83 00 00 lwz [[REG:[0-9]+]], 0(3)
+; OBJ32-DAG: 90 41 00 14 stw 2, 20(1)
----------------
This only parameterizes the scratch register in the human readable form. Two of the hex digits are sensitive to the scratch register value. Similarly for the other test.
================
Comment at: llvm/test/CodeGen/PowerPC/aix_indirect_call.ll:74
+; OBJ32-DAG: 90 41 00 14 stw 2, 20(1)
+; OBJ32-DAG: 7c 89 03 a6 mtctr [[REG]]
+; OBJ32-DAG: 81 63 00 08 lwz 11, 8(3)
----------------
Same comment. r4 is hardcoded.
================
Comment at: llvm/test/CodeGen/PowerPC/aix_indirect_call.ll:95
+; MIR32-DAG: $r2 = LWZ 4, killed renamable $r3 :: (dereferenceable invariant load 4 from %ir.0 + 4)
+; MIR32-DAG: $r3 = LI 1
+; MIR32-DAG: $r4 = LI 2
----------------
Just noting that the test does not enforce that the function pointer has been moved to the scratch register before it is clobbered. Similarly for the other tests.
================
Comment at: llvm/test/CodeGen/PowerPC/aix_indirect_call.ll:132
+; ASM64: stdu 1, -112(1)
+; ASM64-DAG: ld 4, 0(3)
+; ASM64-DAG: li 5, 3
----------------
Scratch register is not parameterized here and below.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D70724/new/
https://reviews.llvm.org/D70724
More information about the llvm-commits
mailing list