diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2017-12-28 09:35:35 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2017-12-28 09:35:35 +0000 |
commit | 979270929dfaa675026962c0a07d0e043c62c73b (patch) | |
tree | 86c1ca3ad0b0c30371a4a972e35954df35b9722e /test/Transforms | |
parent | 1e7ad1c95ade6d20d3e0544772e55e45d2e6edb9 (diff) |
[InstCombine] Check for isa<Instruction> before using cast<>
Protects against casts from constexpr etc.
Reduced from oss-fuzz #4788 test case
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321515 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r-- | test/Transforms/InstCombine/X86/X86FsubCmpCombine.ll | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/X86/X86FsubCmpCombine.ll b/test/Transforms/InstCombine/X86/X86FsubCmpCombine.ll index fde0692d00a..b05b27f533b 100644 --- a/test/Transforms/InstCombine/X86/X86FsubCmpCombine.ll +++ b/test/Transforms/InstCombine/X86/X86FsubCmpCombine.ll @@ -122,6 +122,19 @@ entry: } +define i8 @sub_compare_folding_swapPD256_undef(<4 x double> %a, <4 x double> %b) { +; CHECK-LABEL: @sub_compare_folding_swapPD256_undef( +; CHECK-NEXT: entry: +; CHECK-NEXT: [[TMP:%.*]] = tail call i8 @llvm.x86.avx512.mask.cmp.pd.256(<4 x double> fsub (<4 x double> undef, <4 x double> undef), <4 x double> zeroinitializer, i32 5, i8 -1) +; CHECK-NEXT: ret i8 [[TMP]] +; +entry: + %sub.i1 = fsub ninf <4 x double> undef, undef + %tmp = tail call i8 @llvm.x86.avx512.mask.cmp.pd.256(<4 x double> %sub.i1, <4 x double> zeroinitializer, i32 5, i8 -1) + ret i8 %tmp +} + + define i8 @sub_compare_folding_swapPD512(<8 x double> %a, <8 x double> %b){ ; CHECK-LABEL: @sub_compare_folding_swapPD512( ; CHECK-NEXT: entry: |