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

Remove new BitCastInst unless it's in a typed pointer context #50338

Merged
merged 3 commits into from
Jun 30, 2023

Conversation

pchintalapudi
Copy link
Member

We shouldn't be creating random bitcasts in opaque pointer mode since it's inefficient, so this either requires that typed pointers be present to use new BitCastInst or farms off that responsibility to an IRBuilder.

@@ -70,6 +70,7 @@ void LowerPTLS::set_pgcstack_attrs(CallInst *pgcstack) const

Instruction *LowerPTLS::emit_pgcstack_tp(Value *offset, Instruction *insertBefore) const
{
IRBuilder<> builder(insertBefore);
Value *tls;
if (TargetTriple.isX86() && insertBefore->getFunction()->callsFunctionThatReturnsTwice()) {
// Workaround LLVM bug by hiding the offset computation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to #17288 and https://bugs.llvm.org/show_bug.cgi?id=21183, maybe we don't need this workaround anymore? But I guess we can check that in a separate PR

@vtjnash vtjnash merged commit 734cafa into master Jun 30, 2023
@vtjnash vtjnash deleted the pc/new-bitcasts branch June 30, 2023 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants