[llvm] c07c1c4 - [VPlan] Remove redundant cast (NFCI).

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 18 01:58:41 PDT 2024


Author: Florian Hahn
Date: 2024-03-18T08:58:23Z
New Revision: c07c1c47d31c437f3ac7b82ed65eb88bb57ba5e6

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

LOG: [VPlan] Remove redundant cast (NFCI).

SinkCandidate is a VPSingleDefRecipe now, so no cast is needed to access
getUnderlyingInstr directly.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp b/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
index 3b19db9f0d30df..0fc98fb69791d4 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
@@ -156,8 +156,7 @@ static bool sinkScalarOperands(VPlan &Plan) {
     if (NeedsDuplicating) {
       if (ScalarVFOnly)
         continue;
-      Instruction *I = cast<Instruction>(
-          cast<VPReplicateRecipe>(SinkCandidate)->getUnderlyingValue());
+      Instruction *I = SinkCandidate->getUnderlyingInstr();
       auto *Clone = new VPReplicateRecipe(I, SinkCandidate->operands(), true);
       // TODO: add ".cloned" suffix to name of Clone's VPValue.
 


        


More information about the llvm-commits mailing list