[PATCH] D142388: [clang] Add builtin_nondeterministic_value

Manuel Brito via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 1 07:13:48 PST 2023


ManuelJBrito added inline comments.


================
Comment at: clang/lib/CodeGen/CGBuiltin.cpp:3070
+
+    if(Ty->isStructTy()){
+      Address StructAddr = ReturnValue.getValue();
----------------
erichkeane wrote:
> This gets REALLY complicated, you can't just create a store, this might end up hitting conversion operators/etc, and is subject to triviality/etc, and also probably needs to go through a constructor.  I suspect you're going to prefer to just decide this isn't a valid builtin for structs instead of getting bogged down in that mess.
The motivation for this builtin was to match intel's definition of undefined in the lowering of intrinsics such as  https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_castsi128_si256&expand=628&ig_expand=755,  so struct support isn't critical.
So if everyone else agrees i'll drop struct support, do as you suggest and if there are use cases for nondeterministic values of other types add support for them later?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142388



More information about the cfe-commits mailing list