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

Can't remove insertelement undef #44826

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

Can't remove insertelement undef #44826

nunoplopes opened this issue Apr 9, 2020 · 2 comments
Labels
bugzilla Issues migrated from bugzilla miscompilation

Comments

@nunoplopes
Copy link
Member

Bugzilla Link 45481
Resolution FIXED
Resolved on Dec 02, 2020 06:43
Version trunk
OS All
CC @LebedevRI,@RKSimon,@mikaelholmen,@regehr,@rotateright
Fixed by commit(s) 5486e00, 57f0eed

Extended Description

Test: Transforms/InstSimplify/insertelement.ll
Summary: We can't remove insertelement undef to a vector, since it may be replacing a poison value.

define <4 x i32> @​#1286 (<4 x i32> %A) {
%B = insertelement <4 x i32> %A, i32 undef, i32 1
ret <4 x i32> %B
}
=>
define <4 x i32> @​#1286 (<4 x i32> %A) {
ret <4 x i32> %A
}
Transformation doesn't verify!
ERROR: Target is more poisonous than source

Example:
<4 x i32> %A = < poison, poison, poison, poison >

Source:
<4 x i32> %B = < poison, undef, poison, poison >

Target:
Source value: < poison, undef, poison, poison >
Target value: < poison, poison, poison, poison >

Report: https://web.ist.utl.pt/nuno.lopes/alive2/index.php?hash=ed3ac07d4817b221&test=Transforms%2FInstSimplify%2Finsertelement.ll

@rotateright
Copy link
Contributor

Removed the unsafe fold:
5486e00

And added back a safe version:
57f0eed

@mikaelholmen
Copy link
Collaborator

Removed the unsafe fold:
https://github.com/llvm/llvm-project/commit/
5486e00

And added back a safe version:
https://github.com/llvm/llvm-project/commit/
57f0eed

I just wrote an issue about jump-threading not terminating after the above fixes:
llvm/llvm-bugzilla-archive#48362

@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 miscompilation
Projects
None yet
Development

No branches or pull requests

3 participants