HomePhabricator

[InstCombine] Pre-commit of test case showing miscompile bug in…

Description

[InstCombine] Pre-commit of test case showing miscompile bug in canEvaluateShuffled

Adding the reproducer from https://bugs.llvm.org/show_bug.cgi?id=43689,
showing that instcombine is doing a bad transform. It transforms

%0 = insertelement <2 x i16> undef, i16 %a, i32 0
%1 = srem <2 x i16> %0, <i16 2, i16 1>
%2 = shufflevector <2 x i16> %1, <2 x i16> undef, <2 x i32> <i32 undef, i32 0>

into

%1 = insertelement <2 x i16> undef, i16 %a, i32 1
%2 = srem <2 x i16> %1, <i16 undef, i16 2>

The undef denominator makes the whole srem undefined.

Details

Committed
bjopeOct 18 2019, 12:41 AM
Parents
rL375206: Update release notes
Branches
Unknown
Tags
Unknown