[llvm] [ValueTracking][NFC] Early exit when enumerating guaranteed well-defined/non-poison operands. (PR #82812)

via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 23 10:59:54 PST 2024


================
@@ -7211,84 +7211,108 @@ bool llvm::propagatesPoison(const Use &PoisonOp) {
   }
 }
 
-void llvm::getGuaranteedWellDefinedOps(
-    const Instruction *I, SmallVectorImpl<const Value *> &Operands) {
+/// Enumerates all operands of \p I that are guaranteed to not be undef or
+/// poison. If the callback \p Handle returns true, stop iterating and return
+/// true. Otherwise, return false.
+template <typename CallableT>
+bool foreachGuaranteedWellDefinedOps(const Instruction *I,
----------------
goldsteinn wrote:

is `foreach` the right name? There is no iteration. Maybe "handle..."?

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


More information about the llvm-commits mailing list