|
|
|
|
|
by foltik
169 days ago
|
|
From the LLVM docs [0]: > Undef values aren't exactly constants ... they can appear to have different bit patterns at each use. My claim is simple and narrow: compilers should internally model such values as unspecified, not actively choose convenient constants. The comment I replied to cited an example where an undef is constant folded into the value required for a conditional to be true. Can you point to any case where that produces a real optimization benefit, as opposed to being a degenerate interaction between UB and value propagation passes? And to be explicit: “if you don’t like it, don’t use it” is just refusing to engage, not a constructive response to this critique. These semantics aren't set in stone. [0] https://llvm.org/doxygen/classllvm_1_1UndefValue.html#detail... |
|
An assertion you have provided no utility or justification for.
> The comment I replied to cited an example where an undef is constant folded into the value required for a conditional to be true.
The comment you replied to did in fact not do that and it’s incredible that you misread it such.
> Can you point to any case where that produces a real optimization benefit, as opposed to being a degenerate interaction between UB and value propagation passes?
The original snippet literally folds a branch and two stores into a single store, saving CPU resources and generating tighter code.
> this critique
Critique is not what you have engaged in at any point.