[llvm] [SelectOpt] Add support for AShr/LShr operands (PR #118495)

David Green via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 9 00:15:25 PST 2024


================
@@ -763,11 +772,19 @@ void SelectOptimizeImpl::collectSelectGroups(BasicBlock &BB,
   };
 
   DenseMap<Value *, SelectLikeInfo> SelectInfo;
+  // Keeps visited comparisons to help identify AShr/LShr variants of auxiliary
+  // instructions.
+  SmallPtrSet<CmpInst *, 2> SeenCmp;
----------------
davemgreen wrote:

It might be worth making this a SetVector to make sure the order is deterministic.

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


More information about the llvm-commits mailing list