Remove allocations with alignment assume.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
Can this be generalized to all assumes? nor just the code pattern that checks alignment?
This is really a temporary workaround until bundle representation of assumptions is used.
It might be better to work on that instead
See also D75462.
This is the right fix for alignment: D71739
For all assumes (and later other stuff, think lifetime markers or annotations) you can check if the User::isDroppable, and eventually drop via Value::dropDroppableUses if you cannot update them properly.
@lebedev.ri, @jdoerfert: I acknowledge D71739. What's the status of it? Are you open to having this patch as a temporary measure until that's checked in?
I pinged the other patch. It is basically ready, minor changes only. Let's wait a day or so and see if @Tyker responds.
Thanks. This is still necessary for this particular alloc removal case, but D71739 made it much simpler.
llvm/test/Transforms/PhaseOrdering/inlining-alignment-assumptions.ll | ||
---|---|---|
101 ↗ | (On Diff #274180) | what is this change about? |
llvm/test/Transforms/PhaseOrdering/inlining-alignment-assumptions.ll | ||
---|---|---|
101 ↗ | (On Diff #274180) | This is another example that this patch improves (fixing a problem that an assume was preventing the removal of an alloca). |
llvm/test/Transforms/PhaseOrdering/inlining-alignment-assumptions.ll | ||
---|---|---|
88 ↗ | (On Diff #274180) | This comment is out of date then |
Address comment.
llvm/test/Transforms/PhaseOrdering/inlining-alignment-assumptions.ll | ||
---|---|---|
88 ↗ | (On Diff #274180) | Updated. |