[PATCH] D131487: [TypePromotion] Don't insert Truncate for a no-op ZExt

Sergei Barannikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 10 07:21:57 PDT 2022


barannikov88 added inline comments.


================
Comment at: llvm/lib/CodeGen/TypePromotion.cpp:554
     // Don't insert a trunc for a zext which can still legally promote.
+    // Nor insert a trunc for a zext with the same input type as output, this
+    // was a zext that was part of a promotion mutation and will be removed
----------------
The comment is kind of misleading. According to [[ https://llvm.org/docs/LangRef.html#id243 | LangRef ]], the size of the input operand of zext must be less than the size of the output operand. It is also asserted in the constructor of the operation (see CastInst::castIsValid).



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

https://reviews.llvm.org/D131487



More information about the llvm-commits mailing list