[llvm] a810502 - [LV] Fix warning about Mask being set twice. NFC

David Green via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 20 08:40:16 PDT 2024


Author: David Green
Date: 2024-04-20T16:40:08+01:00
New Revision: a8105026ff548412967bc68ffb57f4fb6aecb652

URL: https://github.com/llvm/llvm-project/commit/a8105026ff548412967bc68ffb57f4fb6aecb652
DIFF: https://github.com/llvm/llvm-project/commit/a8105026ff548412967bc68ffb57f4fb6aecb652.diff

LOG: [LV] Fix warning about Mask being set twice. NFC

Added: 
    

Modified: 
    llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index adae7caf5917c8..33c4decd58a6c2 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -9382,9 +9382,9 @@ void VPWidenLoadEVLRecipe::execute(VPTransformState &State) {
   CallInst *NewLI;
   Value *EVL = State.get(getEVL(), VPIteration(0, 0));
   Value *Addr = State.get(getAddr(), 0, !CreateGather);
-  Value *Mask =
-      getMask() ? State.get(getMask(), 0)
-                : Mask = Builder.CreateVectorSplat(State.VF, Builder.getTrue());
+  Value *Mask = getMask()
+                    ? State.get(getMask(), 0)
+                    : Builder.CreateVectorSplat(State.VF, Builder.getTrue());
   if (CreateGather) {
     NewLI =
         Builder.CreateIntrinsic(DataTy, Intrinsic::vp_gather, {Addr, Mask, EVL},
@@ -9460,9 +9460,9 @@ void VPWidenStoreEVLRecipe::execute(VPTransformState &State) {
   Value *StoredVal = State.get(StoredValue, 0);
   Value *EVL = State.get(getEVL(), VPIteration(0, 0));
   // FIXME: Support reverse store after vp_reverse is added.
-  Value *Mask =
-      getMask() ? State.get(getMask(), 0)
-                : Mask = Builder.CreateVectorSplat(State.VF, Builder.getTrue());
+  Value *Mask = getMask()
+                    ? State.get(getMask(), 0)
+                    : Builder.CreateVectorSplat(State.VF, Builder.getTrue());
   Value *Addr = State.get(getAddr(), 0, !CreateScatter);
   if (CreateScatter) {
     NewSI = Builder.CreateIntrinsic(Type::getVoidTy(EVL->getContext()),


        


More information about the llvm-commits mailing list