Try to remove each flag from instructions. It may make more
sense to introduce these flags instead.
Details
- Reviewers
regehr aeubanks lebedev.ri
Diff Detail
Event Timeline
LGTM.
there's a simple test that we can apply to determine whether we add or remove any given flag: we should do whatever reduces the amount of undefined behavior. so, for example, nsw is one that we definitely to eliminate because this makes code more defined and hence (in general) easier to understand.
My idea of simpler to understand is codegens to fewer instructions. Things that introduce undefined behavior are more likely to enable optimizations and different lowerings that reduce instructions emitted
right, adding UB enables more optimizations -- making the compiler execution harder to understand. I'll absolutely die on this hill but if you feel strongly enough in the other direction we should just add flags controlling this sort of thing. but my way is a better default.
I'm still of the opinion that llvm-reduce should reduce textual IR as much as possible to provide as reduced of a test case as possible by default, but flags to control less text vs less codegen vs less UB of course would be good