[PATCH] D33774: [CodeGen] Make __attribute__(const) calls speculatable

2022-03-29 Thread Michael Kruse via Phabricator via cfe-commits
Meinersbur requested changes to this revision. Meinersbur added a comment. This revision now requires changes to proceed. Herald added a project: All. `speculable` implies no undefined behavior (so it can even be speculatively executed with arguments when the source code would not, but its

[PATCH] D33774: [CodeGen] Make __attribute__(const) calls speculatable

2017-06-01 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added a comment. Consider something like this: define i32 @div(i32 %x, i32 %y) { entry: %div = sdiv i32 %x, %y ret i32 %div } We can mark this function readnone, but not speculatable: it doesn't read or write memory, but could exhibit undefined behavior. Consider

[PATCH] D33774: [CodeGen] Make __attribute__(const) calls speculatable

2017-06-01 Thread Michael Kruse via Phabricator via cfe-commits
Meinersbur added a comment. Definition of `__attibute__((const))` from https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#Common-Function-Attributes > Many functions do not examine any values except their arguments, and have no > effects except the return value. Basically this

[PATCH] D33774: [CodeGen] Make __attribute__(const) calls speculatable

2017-06-01 Thread Tobias Grosser via Phabricator via cfe-commits
grosser created this revision. Herald added subscribers: javed.absar, wdng. Today 'const' functions are only marked 'readnone' and 'nounwind', but lack the 'speculatable' attribute for historic reasons. As 'const' functions are known to not have any side effects and are intended to enable loop