[llvm] [RISCV] Fix illegal build_vector when lowering double id buildvec on RV32 (PR #67017)

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 4 08:48:39 PDT 2023


================
@@ -259,25 +259,40 @@ define <4 x i8> @buildvec_vid_stepn3_add3_v4i8() {
 ; CHECK-NEXT:    vsetivli zero, 4, e8, mf4, ta, ma
 ; CHECK-NEXT:    vmv.v.i v9, 3
 ; CHECK-NEXT:    vid.v v8
-; CHECK-NEXT:    li a0, -3
+; CHECK-NEXT:    li a0, 253
----------------
preames wrote:

Talked to Luke about this offline.  My summary is that while we are generating the zero vs sign extended constant for the i8, that we believe hasAllNBitUsers handles this case.  Our theory is that the difference in the LI immediate comes down to the fact that using a different constant on the LI isn't profitable (in either direction) - i.e. no rooting transform.  This seems backed up by the fact we don't see any other test differences which *are* material.

https://github.com/llvm/llvm-project/pull/67017


More information about the llvm-commits mailing list