[PATCH] D125041: [GlobalISel] Combine G_SHL, G_ASHR, G_SHL of undef shifts to undef.

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 6 03:51:33 PDT 2022


foad added a comment.

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?



================
Comment at: llvm/include/llvm/Target/GlobalISel/Combine.td:238
 
+def binop_rhs_undef_to_undef: GICombineRule<
+  (defs root:$root),
----------------
I like 'rhs' but all the existing combine names seem to use 'left' and 'right'.


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