Make changes to the MSSA-based parts of DSE to recognize and handle masked stores.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I think that the isMaskedStoreOverwrite could be merged into isOverwrite, but it'd need to take instructions in addition to the locations. I think it would be a bit cleaner than what this patch does.
Calling isMaskedStoreOverwrite from isOverwrite to avoid multiple checks.
Fixed a bug in ordering of NI and SI in the previous diff.
llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp | ||
---|---|---|
412 | Might be good to state that Later must overwrite Earlier. We could check that the mask of Later is a superset of the mask of Earlier. Might be good to add a TODO. | |
424 | Wouldn't it be better to check if the pointers are must-alias? | |
1720–1721 | Could you update the doc-comment? | |
1836 | Is it possible to mark masked_store as IntrWriteMem? Then mayReadFromMemory should automatically return false for it. |
Marked masked-storing intrinsics as write-only in 8b7c8f2c549d301fcea75d8e6e98a8ee160d5ff4.
LGTM, thanks!
llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp | ||
---|---|---|
1848 | unrelated change? |
llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp | ||
---|---|---|
1848 | Leftover from the "mayReadFromMemory" function from the previous diff. I'll remove it before committing. |
Might be good to state that Later must overwrite Earlier. We could check that the mask of Later is a superset of the mask of Earlier. Might be good to add a TODO.