[PATCH] D132657: [DSE] Eliminate noop store even through has clobbering between LoadI and StoreI

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 2 03:12:10 PDT 2022


nikic added a comment.

In D132657#3766537 <https://reviews.llvm.org/D132657#3766537>, @StephenFan wrote:

> In D132657#3766519 <https://reviews.llvm.org/D132657#3766519>, @nikic wrote:
>
>> In D132657#3766472 <https://reviews.llvm.org/D132657#3766472>, @StephenFan wrote:
>>
>>> In D132657#3766284 <https://reviews.llvm.org/D132657#3766284>, @nikic wrote:
>>>
>>>> In D132657#3766253 <https://reviews.llvm.org/D132657#3766253>, @efriedma wrote:
>>>>
>>>>> Do you need some sort of alignment check here?
>>>>
>>>> Gah, you're right. If it doesn't happen to be a splat value, then writes at an offset become a problem.
>>>
>>> https://godbolt.org/z/5oEh8rdY6 Is this the problem you mentioned?
>>
>> Yes, exactly.
>
> I found GCC would delete the last store. Is this a bug in GCC?

It does seem that way. It happens also if alignment is forced to 1, so this is not relying on UB of unaligned stores: https://godbolt.org/z/Yb8Kj3sT3


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132657/new/

https://reviews.llvm.org/D132657



More information about the llvm-commits mailing list