Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid undef splat in instcombine #44800

Closed
nunoplopes opened this issue Apr 7, 2020 · 2 comments
Closed

Invalid undef splat in instcombine #44800

nunoplopes opened this issue Apr 7, 2020 · 2 comments
Labels
bugzilla Issues migrated from bugzilla duplicate Resolved as duplicate miscompilation

Comments

@nunoplopes
Copy link
Member

Bugzilla Link 45455
Resolution DUPLICATE
Resolved on May 20, 2020 07:26
Version trunk
OS All
CC @LebedevRI,@RKSimon,@regehr,@rotateright

Extended Description

Test: Transforms/InstCombine/unfold-masked-merge-with-const-mask-vector.ll

define <3 x i4> @​splat_undef(<3 x i4> %x, <3 x i4> %y) {
%n0 = xor <3 x i4> %x, %y
%n1 = and <3 x i4> %n0, { 14, undef, 14 }
%r = xor <3 x i4> %n1, %y
ret <3 x i4> %r
}
=>
define <3 x i4> @​splat_undef(<3 x i4> %x, <3 x i4> %y) {
%1 = and <3 x i4> %x, { 14, undef, 14 }
%2 = and <3 x i4> %y, { 1, undef, 1 }
%r = or <3 x i4> %1, %2
ret <3 x i4> %r
}
Transformation doesn't verify!
ERROR: Value mismatch

Example:
<3 x i4> %x = < #x0 (0), #xd (13, -3), #x0 (0) >
<3 x i4> %y = < undef, #x8 (8, -8), #x0 (0) >

Source:
<3 x i4> %n0 = < #x0 (0), #x5 (5), #x0 (0) >
<3 x i4> %n1 = < #x0 (0), #x0 (0) [based on undef value], #x0 (0) >
<3 x i4> %r = < #x0 (0), #x8 (8, -8), #x0 (0) >

Target:
<3 x i4> %1 = < #x0 (0), #x1 (1), #x0 (0) >
<3 x i4> %2 = < #x0 (0), #x0 (0), #x0 (0) >
<3 x i4> %r = < #x0 (0), #x1 (1), #x0 (0) >
Source value: < #x0 (0), #x8 (8, -8), #x0 (0) >
Target value: < #x0 (0), #x1 (1), #x0 (0) >

https://web.ist.utl.pt/nuno.lopes/alive2/index.php?hash=2009353267698970&test=Transforms%2FInstCombine%2Funfold-masked-merge-with-const-mask-vector.ll

@rotateright
Copy link
Contributor

*** This bug has been marked as a duplicate of bug llvm/llvm-bugzilla-archive#45955 ***

@rotateright
Copy link
Contributor

mentioned in issue llvm/llvm-bugzilla-archive#45955

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla duplicate Resolved as duplicate miscompilation
Projects
None yet
Development

No branches or pull requests

2 participants