[PATCH] D42032: [LLVM][PASSES][InstCombine] Fix (a + a + ...) / a cases

Anton Bikineev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 19 14:17:48 PST 2018


AntonBikineev added a comment.

In https://reviews.llvm.org/D42032#981882, @spatel wrote:

> This looks right, but see inline comments for some small improvements. Do you have commit access?


No, unfortunately.

> No need to initialize this; we don't touch 'Y' if the matches fail.

Is this really a problem? I mean, anyway the optimizer will move the null pointer right into then statements, but IMHO it promotes a good code style by not accidentally using uninitialized data.

> Probably best not to speculatively create this constant. I think you can move this into the 'Create' lines below without violating the 80-column limit. :)

But then we would either need to duplicate this line in both statements or use an extra check... I don't know if it's better :)


https://reviews.llvm.org/D42032





More information about the llvm-commits mailing list