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

memset/memcpy analysis/optimizations need improving #824

Closed
llvmbot opened this issue Oct 20, 2004 · 6 comments
Closed

memset/memcpy analysis/optimizations need improving #824

llvmbot opened this issue Oct 20, 2004 · 6 comments
Labels
bugzilla Issues migrated from bugzilla code-quality ipo Interprocedural optimizations

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Oct 20, 2004

Bugzilla Link 452
Resolution FIXED
Resolved on Apr 22, 2009 04:37
Version trunk
OS All
Depends On llvm/llvm-bugzilla-archive#2058 llvm/llvm-bugzilla-archive#1226 llvm/llvm-bugzilla-archive#1952 llvm/llvm-bugzilla-archive#2059
Reporter LLVM Bugzilla Contributor

Extended Description

Just so this doesn't get lost, I'm filing a "wishlist" item for this.

Date: Wed, 6 Oct 2004 14:25:30 -0500 (CDT)
From: Chris Lattner sabre@nondot.org
Subject: memset optimizations

memset currently inhibits multiple optimizations, e.g. memset/load doesn't
get copy-propagated, memset doesn't cause dead stores to die, and memset
inhibits SRA. This should be fixed!

Also: memset(&X, 4) -> store int 0, X iff X is aligned

Also, memset should not kill unaliased loads/stores.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Apr 5, 2007

Edits a hard-coded string in an unrolled loop
I was told in the IRC channel that the non optimized LLVM code I was getting of
the attached C++ code was related to this issue.
It becomes optimized when the string 's' becomes small, like "this".

@lattner
Copy link
Collaborator

lattner commented Apr 9, 2007

Bug 1309 is also related to this.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Jan 29, 2008

example with poor memcpy optimization
In the last line
return r + x.A;
the value of x.A is zero, but LLVM doesn't understand this.
Presumably this is because it thinks memcpy has modified x,
even though it copies from x and not to it.

@lattner
Copy link
Collaborator

lattner commented Jan 29, 2008

Bug 1952 is one specific optimization that we can do, relating it.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Apr 9, 2008

This has gotten a lot better recently, with work Chris and I have done which is now in the MemCpyOpt pass. There's still a lot to do, though.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Apr 22, 2009

I'm closing this open-ended bug, as we'll never catch EVERY case. If you still have specific cases that you'd like to see addressed, please file individual PRs for them.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
kwk pushed a commit to kwk/llvm-project that referenced this issue Feb 1, 2022
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 code-quality ipo Interprocedural optimizations
Projects
None yet
Development

No branches or pull requests

2 participants