[llvm] [DAG] Add freeze(assertext(x)) -> assertext(x) folds (PR #94491)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 5 12:10:31 PDT 2024


================
@@ -57,7 +57,10 @@ enum NodeType {
   /// been extended, and the second is a value type node indicating the width
   /// of the extension.
   /// NOTE: In case of the source value (or any vector element value) is
-  /// poisoned the assertion will not be true for that value.
+  /// poisoned the assertion will not be true for that value and the
+  /// corresponding result value will be poison. If a source value isn't
+  /// satisfying the condition being asserted (while not being poison), then
+  /// this is considered as immediate undefined behavior.
----------------
nikic wrote:

If we want to say that violating the assertion triggers IUB we also need to audit existing uses to comply with that. One obvious case that doesn't is fptoi legalization: https://github.com/llvm/llvm-project/blob/3ac6a646d40cb16aebb3467007efa2e499383a3d/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp#L811

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


More information about the llvm-commits mailing list