[X86] Add constant folding for AVX512 versions of scalar floating point to integer...
authorCraig Topper <craig.topper@intel.com>
Sun, 12 Aug 2018 22:09:54 +0000 (22:09 +0000)
committerCraig Topper <craig.topper@intel.com>
Sun, 12 Aug 2018 22:09:54 +0000 (22:09 +0000)
commit484b342c68abd9af761efc361fb557f1af45de70
treefe932f5c638489628073e1ec12c688bf5521f4fd
parentf1e8e3b316dd3e434983f0a7c24e129cf57d6636
[X86] Add constant folding for AVX512 versions of scalar floating point to integer conversion intrinsics.

Summary:
We've supported constant folding for sse versions for many years. This patch adds support for the avx512 versions including unsigned with the default rounding mode. We could probably do more with other roundings modes and SAE in the future.

The test cases are largely based on the sse.ll test cases. But I did add some test cases to ensure the unsigned versions don't accept negative values. Also checked the bounds of f64->i32 conversions to make sure unsigned has a larger positive range than signed.

Reviewers: RKSimon, spatel, chandlerc

Reviewed By: RKSimon

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D50553

llvm-svn: 339529
llvm/lib/Analysis/ConstantFolding.cpp
llvm/test/Transforms/ConstProp/avx512.ll [new file with mode: 0644]