[PATCH] D20897: [AVX512/AVX][Intrinsics] Fix Variable Bit Shift Right Arithmetic intrinsic lowering.

Elena Demikhovsky via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 5 00:40:58 PDT 2016


delena added a comment.

In http://reviews.llvm.org/D20897#447281, @RKSimon wrote:

> I just think we're better off handling simplification of intrinsics as early as possible - in this case in InstCombiner::visitCallInst instead of waiting until lowering.


I agree. But today we are going towards generation IR from clang whenever it is possible. As far as this specific intrinsic (SAR), LLVM-IR specification and Intel intrinsic specification are different for out-of-range constants. You can generate a constant if the both arguments are constants, but replacing intrinsic with generic IR instruction is incorrect in this case.

> Also, should we be adding constant folding (or other optimizations) to LowerINTRINSIC_WO_CHAIN ? I understood that is for cleanup + canonicalization only.


We should generate an optimal code, if we can. So, we, probably,  should fold constants whenever it is possible.

IMO, once we are visiting SAR intrinsic in LowerINTRINSIC_WO_CHAIN, we should try to fold constants there. And it is actual for all intrinsics where IR and architecture specification does not match.


Repository:
  rL LLVM

http://reviews.llvm.org/D20897





More information about the llvm-commits mailing list