[all-commits] [llvm/llvm-project] b153cc: [RISCV] Fix boundary error in compress-opt-select.ll

Philip Reames via All-commits all-commits at lists.llvm.org
Tue Sep 17 07:43:55 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b153cc5c2bd9f08bf34ec13016f7b436b3e8a1d9
      https://github.com/llvm/llvm-project/commit/b153cc5c2bd9f08bf34ec13016f7b436b3e8a1d9
  Author: Philip Reames <preames at rivosinc.com>
  Date:   2024-09-17 (Tue, 17 Sep 2024)

  Changed paths:
    M llvm/test/CodeGen/RISCV/compress-opt-select.ll

  Log Message:
  -----------
  [RISCV] Fix boundary error in compress-opt-select.ll

Per the comment, this test is intending to test the first constant which
can't be encoded via a c.addi.  However, -32 *can* be encoded as in a
c.addi, and all that's preventing it from doing so is the register
allocators choice to use a difference destination register on the
add than it's source.  (Which compressed doesn't support.)

The current LLC codegen for this test looks like:

	addi	a1, a0, -32
	li	a0, -99
	bnez	a1, .LBB0_2
	li	a0, 42
.LBB0_2:
	ret

After https://github.com/llvm/llvm-project/pull/108889, we sink the LI, and
the register allocator picks the same source and dest register for the addi
resulting in the c.addi form being emitted.  So, to avoid a confusing diff
let's fix the test to check what was originally intended.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list