Luke Lau
c2a879ecaa
[VPlan] Fix VPTypeAnalysis cache clobbering in EVL transform ( #120252 )
...
When building SPEC CPU 2017 with RISC-V and EVL tail folding, this
assertion in VPTypeAnalysis would trigger during the transformation to
EVL recipes:
d8a0709b10/llvm/lib/Transforms/Vectorize/VPlanAnalysis.cpp (L135-L142)
It was caused by this recipe:
```
WIDEN ir<%shr> = vp.or ir<%add33>, ir<0>, vp<%6>
```
Having its type inferred as i16, when ir<%add33> and ir<0> had inferred
types of i32 somehow.
The cause of this turned out to be because the VPTypeAnalysis cache was
getting clobbered: In this transform we were erasing recipes but keeping
around the same mapping from VPValue* to Type*. In the meantime, new
recipes would be created which would have the same address as the old
value. They would then incorrectly get the old erased VPValue*'s cached
type:
```
--- before ---
0x600001ec5030: WIDEN ir<%mul21.neg> = vp.mul vp<%11>, ir<0>, vp<%6>
0x600001ec5450: <badref> <- some value that was erased
--- after ---
0x600001ec5030: WIDEN ir<%mul21.neg> = vp.mul vp<%11>, ir<0>, vp<%6>
0x600001ec5450: WIDEN ir<%shr> = vp.or ir<%add33>, ir<0>, vp<%6> <- a new value that happens to have the same address
```
This fixes this by deferring the erasing of recipes till after the
transformation.
The test case might be a bit flakey since it just happens to have the
right conditions to recreate this. I tried to add an assert in
inferScalarType that every VPValue in the cache was valid, but couldn't
find a way of telling if a VPValue had been erased.
---------
Co-authored-by: Florian Hahn <flo@fhahn.com>
2024-12-18 11:28:28 +08:00
..
2024-12-17 20:44:32 +00:00
2024-12-05 14:36:40 +01:00
2024-12-17 20:44:32 +00:00
2023-12-08 09:56:55 +00:00
2024-10-31 15:58:15 +08:00
2024-12-17 20:44:32 +00:00
2024-12-18 11:28:28 +08:00
2024-11-28 10:12:41 +00:00
2023-05-17 17:03:15 +02:00
2024-06-26 10:18:01 +01:00
2024-12-17 20:44:32 +00:00
2023-05-17 17:03:15 +02:00
2022-12-14 15:16:59 +01:00
2024-11-21 08:06:56 +00:00
2022-12-14 15:16:59 +01:00
2022-12-14 15:16:59 +01:00
2022-12-14 15:16:59 +01:00
2024-05-15 14:03:21 +01:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2024-12-06 19:41:51 +00:00
2024-11-06 11:53:33 +00:00
2022-12-27 23:01:41 +00:00
2022-12-14 15:16:59 +01:00
2024-11-06 11:53:33 +00:00
2024-09-04 16:28:39 +05:30
2022-12-14 15:16:59 +01:00
2022-12-14 15:16:59 +01:00
2023-06-12 13:10:22 +02:00
2024-10-23 04:34:13 +01:00
2024-09-19 09:41:25 +01:00
2022-12-14 15:16:59 +01:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2022-12-14 15:16:59 +01:00
2024-12-17 20:44:32 +00:00
2024-11-14 09:33:46 +00:00
2024-11-06 11:53:33 +00:00
2022-12-14 15:16:59 +01:00
2022-12-14 15:16:59 +01:00
2023-10-28 17:47:46 +08:00
2023-10-24 20:27:39 -07:00
2022-12-14 15:16:59 +01:00
2022-12-14 15:16:59 +01:00
2024-06-14 15:07:27 +01:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2024-12-11 21:11:05 +00:00
2023-01-04 17:25:42 +01:00
2024-12-17 20:44:32 +00:00
2024-12-17 20:44:32 +00:00
2024-12-17 20:44:32 +00:00
2024-12-17 20:44:32 +00:00
2022-12-14 15:16:59 +01:00
2022-12-14 15:16:59 +01:00
2022-12-14 15:16:59 +01:00
2022-12-14 15:16:59 +01:00
2024-08-28 19:12:05 +01:00
2024-12-05 14:36:40 +01:00
2024-12-12 15:58:16 +00:00
2024-11-06 11:53:33 +00:00
2024-12-17 20:44:32 +00:00
2024-09-21 19:47:37 +01:00
2024-11-06 11:53:33 +00:00
2024-07-21 14:03:40 +01:00
2024-12-15 20:46:52 +00:00
2024-12-06 19:41:51 +00:00
2024-07-05 10:08:42 +01:00
2023-04-17 13:08:15 +01:00
2022-12-14 15:16:59 +01:00
2024-12-06 19:41:51 +00:00
2024-07-05 10:08:42 +01:00
2022-12-14 15:16:59 +01:00
2022-12-14 15:16:59 +01:00
2023-01-06 10:56:17 +00:00
2024-12-05 14:36:40 +01:00
2024-12-17 20:44:32 +00:00
2022-12-14 15:16:59 +01:00
2022-12-14 15:16:59 +01:00
2022-12-14 15:16:59 +01:00
2024-08-27 11:55:47 +01:00
2022-12-14 15:16:59 +01:00
2024-12-05 14:36:40 +01:00
2022-12-14 15:16:59 +01:00
2023-11-29 13:19:50 +00:00
2024-12-15 20:46:52 +00:00
2024-11-21 08:06:56 +00:00
2022-12-14 15:16:59 +01:00
2024-12-17 20:44:32 +00:00
2022-12-14 15:16:59 +01:00
2022-12-14 15:16:59 +01:00
2024-12-17 20:44:32 +00:00
2024-11-06 11:53:33 +00:00
2024-12-06 19:41:51 +00:00
2024-11-06 11:53:33 +00:00
2024-11-21 08:06:56 +00:00
2022-12-14 15:16:59 +01:00
2024-11-06 11:53:33 +00:00
2024-01-31 13:31:28 +00:00
2023-01-04 17:25:42 +01:00
2024-11-06 11:53:33 +00:00
2024-01-31 13:31:28 +00:00
2024-12-17 20:44:32 +00:00
2022-12-14 15:16:59 +01:00
2024-11-06 11:53:33 +00:00
2022-12-14 15:16:59 +01:00
2024-12-12 15:58:16 +00:00
2024-12-06 16:28:49 +00:00
2022-12-14 15:16:59 +01:00
2024-11-05 22:45:56 +01:00
2024-12-17 20:44:32 +00:00
2022-12-14 15:16:59 +01:00
2024-12-17 13:48:50 +01:00
2023-12-05 14:09:36 +01:00
2023-08-08 18:10:23 -04:00
2024-07-01 09:26:01 +02:00
2022-12-14 15:16:59 +01:00
2024-12-17 20:44:32 +00:00
2022-12-14 15:16:59 +01:00
2024-06-14 17:18:20 -04:00
2024-12-17 20:44:32 +00:00
2024-12-17 20:44:32 +00:00
2022-12-14 15:16:59 +01:00
2024-09-19 18:50:10 +01:00
2024-11-06 11:53:33 +00:00
2024-12-12 16:48:31 +08:00
2024-12-10 20:09:18 +08:00
2024-12-12 16:48:31 +08:00
2024-12-10 20:09:18 +08:00
2024-12-12 16:48:31 +08:00
2024-12-12 16:48:31 +08:00
2024-02-05 11:57:34 +01:00
2022-12-14 15:16:59 +01:00
2022-12-14 15:16:59 +01:00
2024-12-17 20:44:32 +00:00
2024-12-03 12:41:30 +00:00
2024-11-06 11:53:33 +00:00
2024-11-28 10:12:41 +00:00
2023-01-06 12:14:45 +01:00
2024-12-05 14:36:40 +01:00
2022-12-14 15:16:59 +01:00
2024-11-28 10:12:41 +00:00
2022-12-14 15:16:59 +01:00
2023-10-28 17:47:46 +08:00
2022-12-14 15:16:59 +01:00
2022-12-14 15:16:59 +01:00
2022-12-14 15:16:59 +01:00
2022-12-14 15:16:59 +01:00
2022-12-14 15:16:59 +01:00
2023-06-20 13:17:28 -04:00
2022-12-14 15:16:59 +01:00
2024-10-17 16:50:59 +01:00
2024-10-17 16:50:59 +01:00
2022-12-14 15:16:59 +01:00
2024-12-10 10:00:50 +01:00
2022-12-14 15:16:59 +01:00
2024-12-17 20:44:32 +00:00
2022-12-14 15:16:59 +01:00
2022-12-14 15:16:59 +01:00
2022-12-14 15:16:59 +01:00
2022-12-14 15:16:59 +01:00
2024-12-17 20:44:32 +00:00
2022-12-14 15:16:59 +01:00
2024-08-11 20:38:36 +02:00
2024-12-17 20:44:32 +00:00
2022-12-05 22:17:30 +03:00
2022-12-14 15:16:59 +01:00
2022-12-14 15:16:59 +01:00
2022-12-14 15:16:59 +01:00
2022-12-14 15:16:59 +01:00
2022-12-14 15:16:59 +01:00
2024-12-10 10:00:50 +01:00
2022-12-14 15:16:59 +01:00
2022-12-14 15:16:59 +01:00
2024-07-05 21:41:31 +01:00
2024-11-21 08:06:56 +00:00
2022-12-14 15:16:59 +01:00
2024-12-17 20:44:32 +00:00
2022-12-14 15:16:59 +01:00
2022-12-21 13:58:50 +00:00
2024-12-17 20:44:32 +00:00
2022-12-14 15:16:59 +01:00
2024-12-17 20:44:32 +00:00
2024-12-17 20:44:32 +00:00
2024-10-02 10:28:54 +01:00
2024-11-06 11:53:33 +00:00
2024-12-16 11:55:48 +08:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2022-12-14 15:16:59 +01:00
2024-11-06 11:53:33 +00:00
2024-03-26 16:01:57 +01:00
2024-11-06 11:53:33 +00:00
2024-12-17 20:44:32 +00:00
2022-12-14 15:16:59 +01:00
2022-12-14 15:16:59 +01:00
2024-12-17 20:44:32 +00:00
2023-01-06 12:14:45 +01:00
2022-12-14 15:16:59 +01:00
2024-11-07 14:09:45 +01:00
2024-07-07 20:08:01 +01:00
2023-04-17 13:49:49 +01:00
2022-12-14 15:16:59 +01:00
2022-12-08 02:38:47 +03:00
2024-11-06 11:53:33 +00:00
2024-11-21 08:06:56 +00:00
2024-09-14 21:21:55 +01:00
2024-12-17 20:44:32 +00:00
2024-07-01 09:52:56 -07:00
2023-01-06 12:14:45 +01:00
2023-12-05 14:09:36 +01:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2024-12-17 20:44:32 +00:00
2024-11-06 11:53:33 +00:00
2024-11-28 10:12:41 +00:00
2024-11-28 10:12:41 +00:00
2024-12-17 20:44:32 +00:00
2022-12-14 15:16:59 +01:00
2024-12-17 20:44:32 +00:00
2024-11-28 10:12:41 +00:00
2023-03-07 17:10:34 +01:00
2024-11-06 11:53:33 +00:00
2024-10-10 20:04:46 +01:00
2024-12-17 20:44:32 +00:00
2024-12-06 19:41:51 +00:00
2024-11-06 11:53:33 +00:00
2024-12-15 14:41:07 +00:00
2024-11-06 11:53:33 +00:00
2023-02-15 14:07:51 -08:00
2022-12-14 15:16:59 +01:00
2022-12-14 15:16:59 +01:00
2022-12-14 15:16:59 +01:00
2024-12-17 20:44:32 +00:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2024-11-28 10:12:41 +00:00
2024-12-05 14:36:40 +01:00
2024-12-05 14:36:40 +01:00
2024-09-22 22:08:46 +01:00
2024-11-21 08:06:56 +00:00
2024-11-28 10:12:41 +00:00
2022-12-14 15:16:59 +01:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2024-12-05 14:36:40 +01:00
2024-09-19 09:41:25 +01:00
2024-11-14 08:29:55 +08:00
2022-12-14 15:16:59 +01:00
2024-12-17 20:44:32 +00:00
2022-12-14 15:16:59 +01:00
2024-01-16 21:54:58 -08:00
2024-12-17 20:44:32 +00:00
2022-12-14 15:16:59 +01:00
2024-01-16 21:54:58 -08:00
2022-12-14 15:16:59 +01:00
2024-12-17 20:44:32 +00:00
2024-12-17 20:44:32 +00:00
2024-12-17 20:44:32 +00:00
2024-10-02 11:45:00 +02:00
2024-12-17 20:44:32 +00:00
2022-12-14 15:16:59 +01:00
2022-12-14 15:16:59 +01:00
2022-12-14 15:16:59 +01:00
2022-12-14 15:16:59 +01:00
2024-11-21 11:21:12 +00:00
2024-11-21 11:21:12 +00:00
2024-11-21 11:21:12 +00:00
2024-11-21 11:21:12 +00:00
2022-12-14 15:16:59 +01:00
2024-11-21 11:21:12 +00:00
2024-09-20 11:22:03 +01:00
2022-12-14 15:16:59 +01:00
2024-12-05 14:36:40 +01:00
2022-12-14 15:16:59 +01:00
2024-11-06 11:53:33 +00:00
2023-06-12 13:10:22 +02:00
2022-12-14 15:16:59 +01:00
2024-12-17 20:44:32 +00:00
2023-01-04 17:25:42 +01:00
2023-10-17 03:49:39 +08:00
2024-12-17 20:44:32 +00:00
2024-12-17 20:44:32 +00:00
2024-11-06 11:53:33 +00:00
2024-12-03 09:46:19 +00:00
2024-12-12 16:48:31 +08:00
2024-11-06 11:53:33 +00:00
2024-11-28 10:12:41 +00:00
2022-12-14 15:16:59 +01:00
2024-10-17 16:50:59 +01:00
2024-10-17 16:50:59 +01:00
2024-12-17 20:44:32 +00:00
2024-11-06 11:53:33 +00:00
2024-12-17 20:44:32 +00:00
2022-12-14 15:16:59 +01:00
2022-12-14 15:16:59 +01:00
2023-08-03 00:37:19 -07:00
2022-12-14 15:16:59 +01:00
2024-07-05 10:08:42 +01:00
2022-12-14 15:16:59 +01:00
2024-11-28 10:12:41 +00:00
2023-08-29 11:42:18 +01:00
2022-12-14 15:16:59 +01:00
2024-11-28 10:12:41 +00:00
2024-11-06 11:53:33 +00:00
2024-11-28 10:12:41 +00:00
2024-11-28 10:12:41 +00:00
2022-12-14 15:16:59 +01:00
2024-11-06 11:53:33 +00:00
2022-12-14 15:16:59 +01:00
2024-11-06 11:53:33 +00:00
2024-09-20 11:22:03 +01:00
2024-12-05 14:36:40 +01:00
2024-11-06 11:53:33 +00:00
2024-11-08 17:21:05 -06:00
2024-12-14 20:08:26 +00:00
2022-12-14 15:16:59 +01:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2024-08-21 12:02:54 +02:00
2024-11-07 15:53:51 +08:00
2023-12-05 14:09:36 +01:00
2022-12-14 15:16:59 +01:00
2022-12-14 15:16:59 +01:00
2022-12-14 15:16:59 +01:00
2023-10-28 17:47:46 +08:00
2024-08-19 12:40:20 +01:00
2024-12-11 21:11:05 +00:00
2024-11-06 11:53:33 +00:00
2024-10-16 06:10:19 +01:00
2023-01-04 17:25:42 +01:00
2022-12-14 15:16:59 +01:00
2024-01-31 13:31:28 +00:00
2022-12-14 15:16:59 +01:00
2024-09-19 18:50:10 +01:00
2024-12-05 14:36:40 +01:00
2024-11-06 11:53:33 +00:00
2022-12-24 18:34:54 +00:00
2023-04-25 21:47:14 +01:00
2024-09-06 11:20:14 +02:00
2024-04-16 09:48:13 -04:00
2023-01-06 10:56:17 +00:00
2022-12-14 15:16:59 +01:00
2022-12-14 15:16:59 +01:00
2022-12-14 15:16:59 +01:00
2024-12-17 20:44:32 +00:00
2024-02-20 16:43:57 +00:00
2024-12-12 15:58:16 +00:00
2024-04-04 18:30:17 -04:00
2024-07-07 20:08:01 +01:00
2024-12-15 20:46:52 +00:00
2022-12-05 22:17:30 +03:00
2024-12-12 15:58:16 +00:00
2024-12-12 15:58:16 +00:00
2024-12-12 15:58:16 +00:00
2024-12-16 09:40:03 +00:00
2024-12-12 15:58:16 +00:00
2024-12-15 20:46:52 +00:00
2022-12-14 15:16:59 +01:00
2024-12-12 15:58:16 +00:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2024-09-20 11:22:03 +01:00
2022-12-14 15:16:59 +01:00