-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[SelectionDAG][RISCV] Avoid store merging across function calls #130430
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
Changes from 23 commits
3e7e708
5b1fc65
be40ec2
c3298ff
b56d1b1
82420c7
96c8e53
3574370
f9393d5
d86ec01
04bca6d
f27092f
9faa629
b326da1
c858020
b6b1521
18e68ea
3bc2b22
816a235
904641f
a255f16
75f4caa
de96633
69c361c
0dfd354
e73c49d
a88e73b
d6c848d
0189f30
99e11ae
67b3b65
ed8a5fd
21ba7b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1070,6 +1070,13 @@ class RISCVTargetLowering : public TargetLowering { | |
| return false; | ||
| } | ||
|
|
||
| /// Disables storing and loading vectors by default when there are function | ||
| /// calls between the load and store, since these are more expensive than just | ||
| /// using scalars | ||
| bool shouldMergeStoreOfLoadsOverCall(EVT SrcVT, EVT MergedVT) const override { | ||
| return SrcVT.isScalarInteger() == MergedVT.isScalarInteger(); | ||
|
||
| } | ||
|
|
||
| /// For available scheduling models FDIV + two independent FMULs are much | ||
| /// faster than two FDIVs. | ||
| unsigned combineRepeatedFPDivisors() const override; | ||
|
|
||
mikhailramalho marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this return false be removed? Otherwise we never check anything but the first load/store pair
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, thinking about it, not sure we need to check any of the others. (As in, we don't need the loop, and can only check the first pair.) My reasoning is that for a call to be before LD2 and ST2, but not LD1 and ST2, then the call has to be between either LD1 and LD2 or ST1 and ST2. In either case, either the call aliases the memory operation (preventing the merging entirely), or we can insert the merged LD or ST on whichever side of the call we prefer avoiding the issue.
I haven't glanced at the code to see if it actually takes advantage of that rescheduling. A couple of additional test cases coming...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See ca0fe95, doesn't look like we do any of the aliasing/reordering games.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just quickly checked with an assert, I think it's as you describe, i.e. we can't have one load/store pair with a call and another without. We should probably change this then to just check the first pair