[all-commits] [llvm/llvm-project] 73dc2a: [Transforms] Use *Set::insert_range (NFC) (#132652)

Kazu Hirata via All-commits all-commits at lists.llvm.org
Sun Mar 23 19:43:15 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 73dc2afd2c334aac735caba94292052d63014c9d
      https://github.com/llvm/llvm-project/commit/73dc2afd2c334aac735caba94292052d63014c9d
  Author: Kazu Hirata <kazu at google.com>
  Date:   2025-03-23 (Sun, 23 Mar 2025)

  Changed paths:
    M llvm/lib/Transforms/IPO/FunctionAttrs.cpp
    M llvm/lib/Transforms/IPO/FunctionImport.cpp
    M llvm/lib/Transforms/IPO/LowerTypeTests.cpp
    M llvm/lib/Transforms/IPO/PartialInlining.cpp
    M llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp
    M llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
    M llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp
    M llvm/lib/Transforms/Scalar/DFAJumpThreading.cpp
    M llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
    M llvm/lib/Transforms/Scalar/GVNSink.cpp
    M llvm/lib/Transforms/Scalar/LICM.cpp
    M llvm/lib/Transforms/Scalar/Reassociate.cpp
    M llvm/lib/Transforms/Scalar/SROA.cpp
    M llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp
    M llvm/lib/Transforms/Utils/CloneFunction.cpp
    M llvm/lib/Transforms/Utils/InlineFunction.cpp
    M llvm/lib/Transforms/Utils/LoopPeel.cpp
    M llvm/lib/Transforms/Utils/LoopUnroll.cpp
    M llvm/lib/Transforms/Utils/SSAUpdaterBulk.cpp

  Log Message:
  -----------
  [Transforms] Use *Set::insert_range (NFC) (#132652)

We can use *Set::insert_range to collapse:

  for (auto Elem : Range)
    Set.insert(E);

down to:

  Set.insert_range(Range);

In some cases, we can further fold that into the set declaration.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list