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

Copy Elision code produces assertion failure for i1 parameters #31484

Closed
MatzeB opened this issue Mar 4, 2017 · 4 comments
Closed

Copy Elision code produces assertion failure for i1 parameters #31484

MatzeB opened this issue Mar 4, 2017 · 4 comments
Labels
bugzilla Issues migrated from bugzilla llvm:codegen

Comments

@MatzeB
Copy link
Contributor

MatzeB commented Mar 4, 2017

Bugzilla Link 32136
Resolution FIXED
Resolved on Mar 06, 2017 11:33
Version 4.0
OS All
CC @rnk

Extended Description

Swift triggers an assert in the copy elision code now. We believe this to be cause by i1 parameters. I was able to craft a small reproducer:

target triple = "x86_64-apple-macosx"

@​g = common global i8* null, align 8

define void @​foo(i32 %a0, i32 %a1, i32 %a2, i32 %a3, i32 %a4, i32 %a5, i1 %a6) {
%tmp = alloca i1, align 4
store i1 %a6, i1* %tmp, align 4
%ptr = bitcast i1* %tmp to i8*
store i8* %ptr, i8** @​g, align 8
ret void
}

@MatzeB
Copy link
Contributor Author

MatzeB commented Mar 4, 2017

I disabled the copy elision optimization for illegal types in r296950.

@rnk
Copy link
Collaborator

rnk commented Mar 6, 2017

I did this a different way in r297045, I think we just needed to use the store size instead of the bit size divided by 8. This also re-enables copy elision from i64s.

@rnk
Copy link
Collaborator

rnk commented Mar 6, 2017

Thanks for the quick workaround!

@MatzeB
Copy link
Contributor Author

MatzeB commented Mar 6, 2017

Thanks for the proper fix! :)

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

No branches or pull requests

2 participants