[PATCH] D125041: [GlobalISel] Combine G_SHL, G_ASHR, G_SHL of undef shifts to undef.
Amara Emerson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri May 6 12:37:12 PDT 2022
aemerson added a comment.
In D125041#3496339 <https://reviews.llvm.org/D125041#3496339>, @foad wrote:
> In D125041#3495365 <https://reviews.llvm.org/D125041#3495365>, @aemerson wrote:
>
>> Actually G_SHL with undef LHS needs to be optimized to zero, not undef.
>
> I don't understand why that would be true for SHL but not for the other shifts. What are the rules for undef in MIR? Is it like undef in IR, or like poison in IR, or neither?
I'm not exactly sure of the reasoning, it's just what the IR optimizations and SelectionDAG do. SelectionDAG optimizes the other shifts of undef to undef too.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D125041/new/
https://reviews.llvm.org/D125041
More information about the llvm-commits
mailing list