[llvm-dev] [llvm-reduce] Reduction to undef/poison/null?

Florian Hahn via llvm-dev llvm-dev at lists.llvm.org
Mon Aug 30 11:14:20 PDT 2021



> On 30 Aug 2021, at 19:59, David Blaikie via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> Nicer because it's less likely to introduce new UB? Or some other reason?
> 

Using undef/poison is problematic, because there are multiple ways this could cause new UB (e.g. branch on undef, passing poison/undef to a function with a noundef argument).

I’m not sure if using zero will work well in certain cases, because it can introduce UB as well (e.g. load from null, passing as nonnull argument). 

I think ideally we would have a way to materialise values we know nothing about, but are not undef. Perhaps we could add some oracle function, but that would come with its own drawbacks.

Cheers,
Florian



More information about the llvm-dev mailing list