[PATCH] D139314: ValueTracking: Teach canCreateUndefOrPoison about FP ops

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 5 07:23:48 PST 2022


aqjune added a subscriber: aaron.ballman.
aqjune added inline comments.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:5239
+      case Intrinsic::llrint:
+        // If the value doesn't fit an unspecified value is returned.
+        break;
----------------
Actually this part is slightly tricky, I think.
In C++ an unspecified value is a well-defined value meaning that its usage does not introduce UB unless the operation is supposed to do so.
This is different from undefined value or poison value because their usage may introduce UB.
Therefore, I think we can say that `canCreateUndefOrPoison` can return `false` for these ops.
I would like to cross-check my understanding with clang - @aaron.ballman May I ask whether my understanding is correct please?


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

https://reviews.llvm.org/D139314



More information about the llvm-commits mailing list