[llvm] [SCEVExpander] Expand UDiv avoiding UB when in seq_min/max. (PR #92177)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 2 03:57:26 PDT 2024
================
@@ -510,9 +510,12 @@ class SCEVUMinExpr : public SCEVMinMaxExpr {
/// This node is the base class for sequential/in-order min/max selections.
/// Note that their fundamental difference from SCEVMinMaxExpr's is that they
-/// are early-returning upon reaching saturation point.
-/// I.e. given `0 umin_seq poison`, the result will be `0`,
-/// while the result of `0 umin poison` is `poison`.
+/// are early-returning
+/// * upon reaching saturation point
+/// I.e. given `0 umin_seq poison`, the result will be `0`,
+/// while the result of `0 umin poison` is `poison`.
+/// * if any operand may trigger UB, e.g. if there is an UDiv operand that may
+/// divide by 0.
----------------
fhahn wrote:
Thanks, should be updated in https://github.com/llvm/llvm-project/pull/110824
https://github.com/llvm/llvm-project/pull/92177
More information about the llvm-commits
mailing list