[PATCH] D133580: [VPlan] Only generate single instr for unpredicated stores of varying value to invariant address

Ayal Zaks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 11 12:34:46 PDT 2022


Ayal added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:9666
+  // A store of a loop varying value to a loop invariant address only
+  // needs a single copy of the store.
+  if (isa<StoreInst>(UI) && !getOperand(1)->getDef()) {
----------------
@reames , @fhahn - rather than detect individual redundant instances at this late stage to suppress their code-gen, would be better to record such uniformity earlier in VPlan - thereby potentially facilitating the detection of additional redundancies, improving cost estimation, and simplifying code-gen?


================
Comment at: llvm/test/Transforms/LoopVectorize/AArch64/sve-illegal-type.ll:89
 ; CHECK: %[[ICMP:.*]] = icmp eq <64 x i64*> %[[GEP]], %[[SPLAT:.*]]
-; CHECK: %[[EXTRACT1:.*]] = extractelement <64 x i1> %[[ICMP]], i32 0
+; CHECK: %[[EXTRACT1:.*]] = extractelement <64 x i1> %[[ICMP]], i32 63
 ; CHECK: store i1 %[[EXTRACT1]], i1* %dst
----------------
(Just noting that this is a somewhat odd test, original CHECK was missing the final store of element 63 presumably.)


================
Comment at: llvm/test/Transforms/LoopVectorize/pr47343-expander-lcssa-after-cfg-update.ll:50
 ; CHECK-NEXT:    store i32 0, i32* @f.e, align 1, !alias.scope !0, !noalias !3
-; CHECK-NEXT:    store i32 0, i32* @f.e, align 1, !alias.scope !0, !noalias !3
 ; CHECK-NEXT:    store i8 10, i8* [[TMP0]], align 1
----------------
Should this have been caught earlier by IsUniform?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133580



More information about the llvm-commits mailing list