[PATCH] D142388: [clang] Add builtin_nondeterministic_value
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 1 07:21:18 PST 2023
aaron.ballman added inline comments.
================
Comment at: clang/lib/CodeGen/CGBuiltin.cpp:3070
+
+ if(Ty->isStructTy()){
+ Address StructAddr = ReturnValue.getValue();
----------------
erichkeane wrote:
> ManuelJBrito wrote:
> > 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?
> I suspect I speak for all with my suggestion. I don't think Aaron/Shafik are concerned with struct support here.
If we reject the code, we can relax that restriction in the future without breaking code, so I think it's fine to not support structures. We can add support for them later if we have a need to do so.
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