[PATCH] D118545: [ARM] Fix 8-bit immediate overflow in the instruction of segmented stack prologue.

Zhiyao Ma via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 5 11:08:28 PST 2022


ZhiyaoMa98 added a comment.

I am looking into adding more tests, but existing test strikes me as strange. `test_large()` in `llvm/test/CodeGen/Thumb/segmented-stacks.ll` already tests for large stacklet allocation, but the test case is vain.

The test case expects the following output:

  ...
  push 	{r4, r5}
  mov 	r5, sp
  sub  	r5, #40192
  ...

Even if without this patch, the output machine assembly code matches the expected output string and passes the test. But `sub r5, #40192` is not a valid instruction on thumb. After passing through the assembler, the `sub` instruction becomes `subs r5, #0`:

  00000078 <test_large>:
    78:   b430            push    {r4, r5}
    7a:   466d            mov     r5, sp
    7c:   3d00            subs    r5, #0
  ...

How can I perform the test effectively?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D118545/new/

https://reviews.llvm.org/D118545



More information about the llvm-commits mailing list