<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jun 14, 2019, at 3:24 PM, Eli Friedman via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">See<span class="Apple-converted-space"> </span><a href="https://reviews.llvm.org/D63036" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">https://reviews.llvm.org/D63036</a><span class="Apple-converted-space"> </span>for the full patch and description. Essentially, the Constant::canTrap API is going away.  To make this work, the semantics of division and remainder constant expressions are changing slightly, so division by zero produces poison, not undefined behavior.  (The corresponding instructions still have undefined behavior.)  This change should make writing and understanding IR optimizations easier.</div></div></div></blockquote><br class=""></div><div>Is anyone interested and willing to make a more profound change to llvm’s constants?  We should really remove all the trapping operators.  The only reason they exist in the first place is to allow use of Constant::get() as a high level constant folding API.  We could replace that, eliminate the trapping operators, and thus eliminate a ton of complexity and bugs…</div><div><br class=""></div><div>-Chris</div><div><br class=""></div><br class=""></body></html>