[PATCH] D142687: [Local] Don't keep K's range even if K dominates J

luxufan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 23 03:13:16 PDT 2023


StephenFan added inline comments.


================
Comment at: llvm/test/Transforms/GVN/range.ll:121
+
+define i32 @load_load_noundef(ptr %p) {
+; CHECK-LABEL: define i32 @load_load_noundef
----------------
@nikic Why do we need to use the generic range here?

1. Both are satisfied. Return a well-defined value.
2. Both are violated, IUB
3. !0 is satisified, !1 is violated. IUB.
4. !0 is violated, !1 is satisified. return a poison value.
If we retain `!0`:
1. Both are satisfied. Return a well-defined value.
2. Both are violated. Return a poison value.
3. !0 is satisfied, !1 is violated. Return a well-defined value
4. !0 is violated, !1 is satisfied. Return a poison value.

The differences are in case 2 and case 3. In case 2, transforming from IUB to return a poison value is safe. In case 3, transforming from IUB to return a poison value is also safe. Or do I misunderstand something?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142687/new/

https://reviews.llvm.org/D142687



More information about the llvm-commits mailing list