[llvm] [VectorCombine] Avoid push_back in range-for (PR #196741)

Hongyu Chen via llvm-commits llvm-commits at lists.llvm.org
Sat May 9 22:28:59 PDT 2026


================

----------------
XChy wrote:

`ShuffleVectorInst *SV : make_range(Shuffles.begin(), Shuffles.end())` should be equivalent to `ShuffleVectorInst *SV : Shuffles`? Both compute the iterators before the loop, which will be invalidated by `push_back`.

https://github.com/llvm/llvm-project/pull/196741


More information about the llvm-commits mailing list