After D138238 introduced the then/else blocks, we should remove UB-implying metadata for the promoted speculative instruction.
This patch fixes the LTO=thin appears broken on nightly rustc? #110256.
Differential D148456
[SROA] Remove UB-implying metadata when promoting speculative instruction. DianQK on Apr 16 2023, 1:45 AM. Authored by
Details After D138238 introduced the then/else blocks, we should remove UB-implying metadata for the promoted speculative instruction. This patch fixes the LTO=thin appears broken on nightly rustc? #110256.
Diff Detail
Event TimelineComment Actions It seems that !noundef means that the loaded value is not an undefined value instead of loading a value from an under ptr is UB. Comment Actions Well, actually you are looking for dropUBImplyingAttrsAndMetadata() from D146629, but for now you can just drop all unknown metadata, and we can add the UB implying distinction later. Comment Actions Promote the load instruction by calling dropUBImplyingAttrsAndMetadata. Thanks for the reminder that dropUBImplyingAttrsAndMetadata()/dropUBImplyingAttrsAndUnknownMetadata() is the method I was looking for. Comment Actions LG
Comment Actions Move the test to llvm/test/Transforms/SROA/select-load.ll. Maybe we should also cherry-pick to 16.0.2? |