Luke Lau
bf46a95f2c
[VPlan] Use target's index type for {First,Last}ActiveLane instead of i64 ( #186361 )
...
Fixes #186005
On RV32 with zve32x, i.e. no legal 64 bit types either scalar or vector,
@llvm.cttz.elts.i64 cannot be lowered and so returns an illegal cost for
scalable VFs. However VPInstruction::FirstActiveLane and
VPInstruction::LastActiveLane always use a hardcoded i64 type.
This causes a legacy/VPlan cost model mismatch in the live-out.ll test,
and in early-exit-live-out.ll prevents the scalable VF from being
chosen.
This PR teaches the two VPInstructions to use the target's index type,
i.e. the width of a pointer in the default address space, so it will
generate a 32 bit cttz.elts on RV32. This should be large enough to hold
the maximum number of elements in a vector, as if the vector was any
bigger it would imply it isn't accessible by memory.
I considered using the canonical IV type but I don't think that will
work since the canonical IV can be i64 on RV32, and it causes
regressions due to extra zexting on 64-bit targets with a 32-bit IV.
2026-03-18 15:01:21 +00:00
..
2026-03-17 13:03:04 +08:00
2026-03-06 14:48:01 +00:00
2026-03-06 14:48:01 +00:00
2026-03-16 21:21:59 +00:00
2026-03-18 15:01:21 +00:00
2026-03-06 14:48:01 +00:00
2026-03-17 13:03:04 +08:00
2026-02-16 09:59:55 +00:00
2026-03-16 21:21:59 +00:00
2026-02-27 11:46:29 +00:00
2026-02-01 20:12:21 +00:00
2026-01-12 17:12:35 -08:00
2026-03-06 14:48:01 +00:00
2026-03-02 12:45:48 +00:00
2026-03-06 15:30:58 +00:00
2026-03-05 12:42:20 +00:00
2026-02-12 13:14:08 +00:00
2025-12-31 22:12:53 +00:00
2026-03-13 16:27:39 -07:00
2026-03-05 12:42:20 +00:00
2026-02-27 11:46:29 +00:00
2026-02-10 08:49:03 +00:00
2025-12-15 10:54:06 +00:00
2026-03-05 12:42:20 +00:00
2026-03-11 19:05:47 +05:30
2026-02-27 09:13:33 +00:00
2026-03-01 16:07:05 +00:00
2026-03-04 13:04:05 +00:00
2026-03-04 13:04:05 +00:00
2026-01-25 23:09:58 +00:00
2026-03-16 21:21:59 +00:00
2026-03-16 21:21:59 +00:00
2026-03-16 21:21:59 +00:00
2026-01-23 14:31:05 -08:00
2026-01-16 11:58:04 +00:00
2026-01-07 10:35:08 +00:00
2026-03-06 14:48:01 +00:00
2026-03-05 12:42:20 +00:00
2026-03-05 12:42:20 +00:00
2026-02-28 12:41:22 +00:00
2026-03-12 10:25:55 +00:00
2026-03-06 17:05:53 +00:00
2026-03-05 12:42:20 +00:00
2026-02-03 07:57:15 +00:00
2026-03-05 12:42:20 +00:00
2026-03-06 17:05:53 +00:00
2026-03-06 14:48:01 +00:00
2026-03-02 08:31:46 +00:00
2026-02-27 11:46:29 +00:00
2026-03-06 14:48:01 +00:00
2026-02-11 11:51:51 +00:00
2022-12-14 15:16:59 +01:00
2026-03-06 14:48:01 +00:00
2026-03-06 14:48:01 +00:00
2026-02-11 11:51:51 +00:00
2026-03-12 12:29:22 +00:00
2026-03-05 12:42:20 +00:00
2026-03-06 14:48:01 +00:00
2026-03-06 14:48:01 +00:00
2026-03-12 12:29:22 +00:00
2026-02-16 09:59:55 +00:00
2026-03-05 12:42:20 +00:00
2026-03-05 12:42:20 +00:00
2026-01-07 10:35:08 +00:00
2026-02-16 09:59:55 +00:00
2026-03-06 14:48:01 +00:00
2026-02-03 07:57:15 +00:00
2026-02-16 09:59:55 +00:00
2026-03-06 14:48:01 +00:00
2026-02-16 09:59:55 +00:00
2026-03-05 12:42:20 +00:00
2026-03-06 14:48:01 +00:00
2026-03-06 14:48:01 +00:00
2026-03-07 10:26:45 +00:00
2026-03-06 14:48:01 +00:00
2026-03-06 14:48:01 +00:00
2026-03-05 12:42:20 +00:00
2026-03-09 04:24:01 +00:00
2026-02-27 09:13:33 +00:00
2026-02-20 21:48:35 +00:00
2026-03-06 15:30:58 +00:00
2026-03-06 15:30:58 +00:00
2026-03-09 10:27:06 +00:00
2026-02-26 11:48:04 +00:00
2026-02-16 09:59:55 +00:00
2026-03-05 12:42:20 +00:00
2026-03-09 04:24:01 +00:00
2026-03-05 12:42:20 +00:00
2026-02-10 00:02:13 +09:00
2026-03-06 14:48:01 +00:00
2026-03-05 12:42:20 +00:00
2026-03-02 10:21:58 +02:00
2026-01-28 17:31:05 +00:00
2025-12-13 22:44:09 +00:00
2026-02-27 11:46:29 +00:00
2026-03-02 08:31:46 +00:00
2026-02-13 16:44:23 +00:00
2026-03-05 22:37:22 +00:00
2026-02-13 16:44:23 +00:00
2026-02-09 15:32:04 +00:00
2026-03-13 17:21:32 +00:00
2026-01-07 10:35:08 +00:00
2026-03-05 12:42:20 +00:00
2026-01-07 10:35:08 +00:00
2026-02-11 11:51:51 +00:00
2026-02-27 09:13:33 +00:00
2026-02-27 11:46:29 +00:00
2026-03-06 14:48:01 +00:00
2026-03-02 17:00:29 +00:00
2026-03-05 12:42:20 +00:00
2026-02-03 07:57:15 +00:00
2026-03-16 21:21:59 +00:00
2026-03-18 15:01:21 +00:00
2026-02-09 22:10:13 +00:00
2026-02-09 22:10:13 +00:00
2026-02-09 22:10:13 +00:00
2026-02-09 22:10:13 +00:00
2026-03-06 14:48:01 +00:00
2026-02-09 22:00:42 +08:00
2026-03-05 12:42:20 +00:00
2026-03-05 12:42:20 +00:00
2026-02-11 11:51:51 +00:00
2026-01-07 10:35:08 +00:00
2026-02-03 07:57:15 +00:00
2026-02-16 09:59:55 +00:00
2026-02-03 07:57:15 +00:00
2026-02-13 15:56:57 +00:00
2026-02-27 11:46:29 +00:00
2026-02-03 07:57:15 +00:00
2026-02-03 07:57:15 +00:00
2026-02-20 04:32:59 +00:00
2026-03-16 12:21:48 +00:00
2026-02-13 12:01:22 +00:00
2026-03-05 12:42:20 +00:00
2026-03-01 16:07:05 +00:00
2026-03-01 16:07:05 +00:00
2026-02-25 14:28:04 +00:00
2026-01-07 04:25:38 +00:00
2026-03-16 09:14:35 +00:00
2026-02-11 11:51:51 +00:00
2026-03-06 14:48:01 +00:00
2026-03-06 14:48:01 +00:00
2026-03-06 14:48:01 +00:00
2026-03-06 14:48:01 +00:00
2026-03-05 12:42:20 +00:00
2026-03-09 04:24:01 +00:00
2026-02-03 07:57:15 +00:00
2026-03-06 14:48:01 +00:00
2026-02-03 07:57:15 +00:00
2026-03-05 12:42:20 +00:00
2026-03-06 14:48:01 +00:00
2026-03-02 12:45:48 +00:00
2026-02-16 09:59:55 +00:00
2026-02-16 09:59:55 +00:00
2026-02-16 09:59:55 +00:00
2026-02-16 09:59:55 +00:00
2026-02-11 11:51:51 +00:00
2026-02-11 11:51:51 +00:00
2025-12-17 20:21:49 +00:00
2026-03-06 14:48:01 +00:00
2026-02-11 11:51:51 +00:00
2026-03-18 11:08:09 +00:00
2026-02-16 09:59:55 +00:00
2026-02-27 11:46:29 +00:00
2026-03-06 17:05:53 +00:00
2026-03-06 14:48:01 +00:00
2026-01-06 20:36:26 +00:00
2026-01-06 20:36:26 +00:00
2026-01-06 20:36:26 +00:00
2026-01-06 20:36:26 +00:00
2026-01-06 20:36:26 +00:00
2026-03-06 14:48:01 +00:00
2026-02-11 11:51:51 +00:00
2026-03-09 10:27:06 +00:00
2026-02-22 21:32:13 +00:00
2026-02-03 07:57:15 +00:00
2026-02-27 11:46:29 +00:00
2026-02-19 10:52:27 +00:00
2026-02-22 21:32:13 +00:00
2026-01-07 20:26:49 +00:00
2026-02-13 12:01:22 +00:00
2026-02-03 07:57:15 +00:00
2026-02-19 10:52:27 +00:00
2026-02-19 10:52:27 +00:00
2026-02-19 10:52:27 +00:00
2026-02-19 10:52:27 +00:00
2026-02-25 14:28:04 +00:00
2026-01-25 23:09:58 +00:00
2026-01-13 20:14:15 +00:00
2026-01-13 20:14:15 +00:00
2026-03-09 04:24:01 +00:00
2026-01-13 20:14:15 +00:00
2026-01-13 20:14:15 +00:00
2026-01-13 20:14:15 +00:00
2026-02-16 09:59:55 +00:00
2026-02-03 07:57:15 +00:00
2026-02-16 09:59:55 +00:00
2026-02-19 10:52:27 +00:00
2026-02-03 07:57:15 +00:00
2026-02-27 09:13:33 +00:00
2026-02-12 23:02:51 +00:00
2026-02-11 11:51:51 +00:00
2026-03-05 12:42:20 +00:00
2026-02-27 09:13:33 +00:00
2026-03-04 13:36:29 +00:00
2026-02-27 09:13:33 +00:00
2026-02-27 11:46:29 +00:00
2026-01-04 09:24:53 +08:00
2026-01-23 14:31:05 -08:00
2026-03-06 14:48:01 +00:00
2026-03-05 12:42:20 +00:00
2026-03-05 12:42:20 +00:00
2026-03-05 12:42:20 +00:00
2026-03-05 12:42:20 +00:00
2026-03-05 12:42:20 +00:00
2026-03-06 14:48:01 +00:00
2026-03-05 12:42:20 +00:00
2026-03-01 16:07:05 +00:00
2026-02-06 19:09:43 +08:00
2026-03-05 12:42:20 +00:00
2026-03-05 12:42:20 +00:00
2026-03-06 14:48:01 +00:00
2026-03-09 04:24:01 +00:00
2026-03-09 04:24:01 +00:00
2026-01-06 20:36:26 +00:00
2026-03-05 12:42:20 +00:00
2026-03-05 12:42:20 +00:00
2026-02-12 20:14:07 +00:00
2026-02-09 22:10:13 +00:00
2026-02-09 22:10:13 +00:00
2026-01-06 13:05:37 +00:00