[llvm] [VectorCombine] Add type shrinking and zext propagation for fixed-width vector types (PR #104606)

David Green via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 9 03:26:19 PDT 2024


================
@@ -2493,6 +2494,96 @@ bool VectorCombine::foldSelectShuffle(Instruction &I, bool FromReduction) {
   return true;
 }
 
+/// Check if instruction depends on ZExt and this ZExt can be moved after the
+/// instruction. Move ZExt if it is profitable. For example:
+///     logic(zext(x),y) -> zext(logic(x,trunc(y)))
+///     lshr((zext(x),y) -> zext(lshr(x,trunc(y)))
----------------
davemgreen wrote:

`lshr((zext(x),y)` -> `lshr(zext(x),y)`

https://github.com/llvm/llvm-project/pull/104606


More information about the llvm-commits mailing list