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

DivRemPairs is incorrect in the presence of undef #41964

Closed
nunoplopes opened this issue Jul 14, 2019 · 3 comments
Closed

DivRemPairs is incorrect in the presence of undef #41964

nunoplopes opened this issue Jul 14, 2019 · 3 comments
Labels
bugzilla Issues migrated from bugzilla

Comments

@nunoplopes
Copy link
Member

Bugzilla Link 42619
Resolution FIXED
Resolved on Oct 22, 2020 09:41
Version trunk
OS All
Blocks #47292
CC @aqjune,@regehr,@rotateright

Extended Description

See, for example:

$ opt -div-rem-pairs Transforms/DivRemPairs/X86/div-rem-pairs.ll

define void @​decompose_illegal_srem_same_block(i32 %a, i32 %b) {
%rem = srem i32 %a, %b
%div = sdiv i32 %a, %b
call void @​foo(i32 %rem, i32 %div)
ret void
}
=>
define void @​decompose_illegal_srem_same_block(i32 %a, i32 %b) {
%div = sdiv i32 %a, %b
%1 = mul i32 %div, %b
%2 = sub i32 %a, %1
call void @​foo(i32 %2, i32 %div)
ret void
}
Transformation doesn't verify!
ERROR: Source is more defined than target

Example:
i32 %a = undef
i32 %b = #x00000001 (1)

Source:
i32 %rem = #x00000000 (0)
i32 %div = undef

Target:
i32 %div = #x7fffffff (2147483647)
i32 %1 = undef
i32 %2 = undef

@rotateright
Copy link
Contributor

Fix proposed here:
https://reviews.llvm.org/D76483

@mikaelholmen
Copy link
Collaborator

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

@aqjune
Copy link
Contributor

aqjune commented Nov 27, 2021

mentioned in issue #47292

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

No branches or pull requests

4 participants