[InstSimplify] try constant folding intrinsics before general simplifications
authorSanjay Patel <spatel@rotateright.com>
Wed, 29 Jul 2020 17:12:51 +0000 (13:12 -0400)
committerSanjay Patel <spatel@rotateright.com>
Wed, 29 Jul 2020 17:18:40 +0000 (13:18 -0400)
commitee9617e96b05de04b2f189596b86c6149c807764
tree07960db96e0d7cd51f29778af63c14673ee1ab09
parentfdc902774e7ae0dae0833216500da047c7c4bec6
[InstSimplify] try constant folding intrinsics before general simplifications

This matches the behavior of simplify calls for regular opcodes -
rely on ConstantFolding before spending time on folds with variables.

I am not aware of any diffs from this re-ordering currently, but there was
potential for unintended behavior from the min/max intrinsics because that
code is implicitly assuming that only 1 of the input operands is constant.
llvm/lib/Analysis/InstructionSimplify.cpp