[PATCH] D115726: [InstCombine] Fold for masked gather when loading the same value each time.

Caroline via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 4 06:04:57 PST 2022


CarolineConcatto added a comment.

Thank you Sander!



================
Comment at: llvm/test/Transforms/InstCombine/vscale_masked_intrinsics.ll:1
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt -instcombine -S < %s | FileCheck %s
----------------
sdesmalen wrote:
> nit: From what I can see, there is nothing really scalable-specific about this transformation, so maybe just add it to llvm/test/Transforms/InstCombine/masked_intrinsics.ll?
> (and also add a test for fixed-width vectors)
Ok, I hope that there  is no problem that the file you are pointing has no vscale tests in there yet.


================
Comment at: llvm/test/Transforms/InstCombine/vscale_masked_intrinsics.ll:30
+
+;; Not all active/one or inactive/zero mask
+define <vscale x 2 x i64> @invalid_mask_invariant_load_i64(i64* %src, <vscale x 2 x i1> %mask) #0 {
----------------
sdesmalen wrote:
> nit: Do you just mean 'Not all active mask' ?
It is both, because it cannot be all zero, this  returns Null
  if (!ConstMask)
    return nullptr;


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115726



More information about the llvm-commits mailing list