| Issue |
184650
|
| Summary |
Make VPTypeAnalysis resilient to values being erased
|
| Labels |
vectorizers
|
| Assignees |
|
| Reporter |
lukel97
|
There's a subtle issue that can occur when using VPTypeAnalysis, where if a VPValue is erased then a new VPValue can be allocated at the same address. This can cause the old cached type to be returned for the new value because it still exists at the same key.
We ran into this issue in the wild in RISC-V in #120252, and it's quite easy to accidentally overlook it e.g. in #184101.
The usual solution to this is to defer erasing recipes until you no longer need the VPTypeAnalysis.
However a better fix is probably to have a VPValue version of llvm/IR/ValueMap.h that can listen to values being erased and remove them from the cache automatically. That would also avoid the need to defer erasing recipes and needing to keep around a `SmallVector<VPRecipeBase*> ToDelete`
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs