You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
voidf(intx, inta, intb) {
ext(__builtin_nondeterministic_value(5), a, b);
}
gets optimized to ext(0, a, b);, thus ending up with an unnecessary zeroing of a register. IR-wise, a freeze i32 poison becomes 0 during instcombine. https://godbolt.org/z/6rxsdr634
This means that __builtin_nondeterministic_value is unsuitable for efficiently calling a function where the caller knows that the callee won't use some argument(s). The only option that roughly works that I've found is to read an uninitialized variable, but that produces a warning and breaks under memorysanitizer.
voidf(intx, inta, intb) {
ext(__builtin_nondeterministic_value(5), a, b);
}
gets optimized to ext(0, a, b);, thus ending up with an unnecessary zeroing of a register. IR-wise, a freeze i32 poison becomes 0 during instcombine. https://godbolt.org/z/6rxsdr634
This means that __builtin_nondeterministic_value is unsuitable for efficiently calling a function where the caller knows that the callee won't use some argument(s). The only option that roughly works that I've found is to read an uninitialized variable, but that produces a warning and breaks under memorysanitizer.
The code:
gets optimized to
ext(0, a, b);
, thus ending up with an unnecessary zeroing of a register. IR-wise, afreeze i32 poison
becomes0
during instcombine. https://godbolt.org/z/6rxsdr634This means that
__builtin_nondeterministic_value
is unsuitable for efficiently calling a function where the caller knows that the callee won't use some argument(s). The only option that roughly works that I've found is to read an uninitialized variable, but that produces a warning and breaks under memorysanitizer.Passing the pre-instcombine IR directly to the backend generates the desired assembly: https://godbolt.org/z/on6W17ex4
The text was updated successfully, but these errors were encountered: