[llvm] 1e4e1ce - [Target] Avoid repeated hash lookups (NFC) (#108677)

via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 14 07:39:12 PDT 2024


Author: Kazu Hirata
Date: 2024-09-14T07:39:09-07:00
New Revision: 1e4e1ceeebb82dd86d0dc95eb1074b7326b50db3

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

LOG: [Target] Avoid repeated hash lookups (NFC) (#108677)

Added: 
    

Modified: 
    llvm/lib/Target/ARM/ARMISelLowering.cpp
    llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp
index 67653a17512d2c..db564d7e841aa9 100644
--- a/llvm/lib/Target/ARM/ARMISelLowering.cpp
+++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp
@@ -8017,7 +8017,6 @@ SDValue ARMTargetLowering::LowerBUILD_VECTOR(SDValue Op, SelectionDAG &DAG,
     if (!isa<ConstantFPSDNode>(V) && !isa<ConstantSDNode>(V))
       isConstant = false;
 
-    ValueCounts.insert(std::make_pair(V, 0));
     unsigned &Count = ValueCounts[V];
 
     // Is this value dominant? (takes up more than half of the lanes)

diff  --git a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
index ab49315c12d685..7d2a7b20ba2508 100644
--- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
@@ -3679,7 +3679,6 @@ static SDValue lowerBuildVectorViaDominantValues(SDValue Op, SelectionDAG &DAG,
     if (V.isUndef())
       continue;
 
-    ValueCounts.insert(std::make_pair(V, 0));
     unsigned &Count = ValueCounts[V];
     if (0 == Count)
       if (auto *CFP = dyn_cast<ConstantFPSDNode>(V))


        


More information about the llvm-commits mailing list