[llvm] 0fbec1e - [SandboxVec][BottomUpVec][NFC] Add comments

Vasileios Porpodas via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 20 09:38:19 PST 2025


Author: Vasileios Porpodas
Date: 2025-01-20T09:37:33-08:00
New Revision: 0fbec1e1eedf7f6a758d3aba3dfc8d77a824d80e

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

LOG: [SandboxVec][BottomUpVec][NFC] Add comments

Added: 
    

Modified: 
    llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/BottomUpVec.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/BottomUpVec.h b/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/BottomUpVec.h
index ac051c3b6570ff..b463b8acf4c86e 100644
--- a/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/BottomUpVec.h
+++ b/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/BottomUpVec.h
@@ -26,6 +26,7 @@ namespace llvm::sandboxir {
 class BottomUpVec final : public FunctionPass {
   bool Change = false;
   std::unique_ptr<LegalityAnalysis> Legality;
+  /// The original instructions that are potentially dead after vectorization.
   DenseSet<Instruction *> DeadInstrCandidates;
   /// Maps scalars to vectors.
   std::unique_ptr<InstrMaps> IMaps;
@@ -40,6 +41,10 @@ class BottomUpVec final : public FunctionPass {
   Value *createShuffle(Value *VecOp, const ShuffleMask &Mask);
   /// Packs all elements of \p ToPack into a vector and returns that vector.
   Value *createPack(ArrayRef<Value *> ToPack);
+  /// After we create vectors for groups of instructions, the original
+  /// instructions are potentially dead and may need to be removed. This
+  /// function helps collect these instructions (along with the pointer operands
+  /// for loads/stores) so that they can be cleaned up later.
   void collectPotentiallyDeadInstrs(ArrayRef<Value *> Bndl);
   /// Recursively try to vectorize \p Bndl and its operands.
   Value *vectorizeRec(ArrayRef<Value *> Bndl, unsigned Depth);


        


More information about the llvm-commits mailing list