[PATCH] D151977: [X86][NFC]Use ref instead copy in for loop for SDValue::op_values()

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 2 00:45:50 PDT 2023


craig.topper added a comment.

In D151977#4390131 <https://reviews.llvm.org/D151977#4390131>, @XinWang10 wrote:

> In D151977#4390071 <https://reviews.llvm.org/D151977#4390071>, @craig.topper wrote:
>
>> We pass SDValue by value all over the SelectionD
>> AG code. And it looks pretty easy for a compiler to see the unsigned field is unused. Does this change really make a difference?
>
> I don't know about if compiler will do this opt to ignore the unused field for a class obj.

I would expect SROA to break up the memcpy into scalar stores after that dead store elimination should be able to remove it.

For the pointer, I expect store to load forwarding should make it we don’t have to load from the stored copy. Then the store also becomes eligible for dead store elimination.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151977



More information about the llvm-commits mailing list