[PATCH] D107580: [VectorCombine] Support AND/UREM indices that require freezing.

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 13 14:05:48 PDT 2021


lebedev.ri added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/VectorCombine.cpp:808-810
+    assert(isSafeWithFreeze() &&
+           "should only be used when freezing is required");
+    for (Use &U : make_early_inc_range((ToFreeze)->uses()))
----------------
I think you want to assert that `User` is an user of `ToFreeze`.


================
Comment at: llvm/lib/Transforms/Vectorize/VectorCombine.cpp:810
+           "should only be used when freezing is required");
+    for (Use &U : make_early_inc_range((ToFreeze)->uses()))
+      if (U.getUser() == &User) {
----------------



================
Comment at: llvm/lib/Transforms/Vectorize/VectorCombine.cpp:810
+           "should only be used when freezing is required");
+    for (Use &U : make_early_inc_range((ToFreeze)->uses()))
+      if (U.getUser() == &User) {
----------------
lebedev.ri wrote:
> 
Why do you have to go through all the uses of `ToFreeze`, even though you only want to fix `User`?
Can't you just go through the operands of `User`?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D107580



More information about the llvm-commits mailing list