[PATCH] D48754: [InstCombine] canonicalize abs pattern

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 16 08:39:46 PDT 2018


spatel added a comment.

In https://reviews.llvm.org/D48754#1163584, @shchenz wrote:

> > We can not just replace operands without considering the order of the instructions. It would be better to create a new instruction with the IRBuilder, so we don't have to worry about this problem.
>
> @spatel  Hi Sanjay, Sorry about this. Seems this is a big mistake. I will do some study about IRBuilder and upload a new patch later. Thanks for your help.


It's not too bad - see the code just above here in canonicalizeMinMaxWithConstant() for an example.


https://reviews.llvm.org/D48754





More information about the llvm-commits mailing list