[InstCombine] freeze operand in urem expansion
authorSanjay Patel <spatel@rotateright.com>
Wed, 11 May 2022 16:09:47 +0000 (12:09 -0400)
committerSanjay Patel <spatel@rotateright.com>
Wed, 11 May 2022 16:47:26 +0000 (12:47 -0400)
commitd428f09b2c9d49f6a328ef636c02305a8be4ab61
tree5d00723fb0ce687e4288699e82c1fde91dd8e7c7
parent8cb7a873ab8568acfbfd6c27a927d924cc994017
[InstCombine] freeze operand in urem expansion

As discussed in issue #37809, this transform is not safe
if the input is an undefined value.

There is no difference in codegen on the basic examples,
but this could lead to regressions. We may need to
improve freeze analysis or lowering if that happens.
llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
llvm/test/Transforms/InstCombine/rem.ll
llvm/test/Transforms/InstCombine/vector-urem.ll