[llvm] [SelectOpt] Add handling for Select-like operations. (PR #77284)

Sotiris Apostolakis via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 16 15:02:48 PST 2024


================
@@ -1023,8 +1176,8 @@ SmallPtrSet<const Instruction *, 2>
 SelectOptimizeImpl::getSIset(const SelectGroups &SIGroups) {
   SmallPtrSet<const Instruction *, 2> SIset;
   for (const SelectGroup &ASI : SIGroups)
-    for (const SelectInst *SI : ASI)
-      SIset.insert(SI);
+    for (SelectLike SI : ASI)
----------------
sapostolakis wrote:

nit: const SelectLike &SI to avoid copies and keep const whenever possible.
ditto in a few other places (in some without the const)

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


More information about the llvm-commits mailing list