-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Replace successive "ldr" and "str" instructions with "ldp" and "stp" #77540
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 1 commit
b88ff31
f0c918c
f1b236e
c0533bd
372ee97
12fc291
0b377ed
46b85f8
e4741f9
2822f64
10a4510
d80a69a
f6a49bf
ed4d070
4b0e51e
2997a8e
f0907cc
c5c4234
bb8fdea
65eed90
e03b375
2cef6fc
41a9828
ba89fd3
1fbf423
ca9a325
e66ad66
8b44843
2e7aaf6
fe76782
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7684,6 +7684,12 @@ void emitter::emitIns_R_S(instruction ins, emitAttr attr, regNumber reg1, int va | |
| // Try to optimize a load/store with an alternative instruction. | ||
| if (isLdrStr && emitComp->opts.OptimizationEnabled() && OptimizeLdrStr(ins, attr, reg1, reg2, imm, size, fmt)) | ||
| { | ||
| // Ensure local variables are tracked. | ||
| emitLastIns->idAddr()->iiaLclVar.initLclVarAddr(varx, offs); | ||
| emitLastIns->idSetIsLclVar(); | ||
| #ifdef DEBUG | ||
| emitLastIns->idDebugOnlyInfo()->idVarRefOffs = emitVarRefOffs; | ||
| #endif | ||
|
||
| return; | ||
| } | ||
|
|
||
|
|
@@ -7917,6 +7923,12 @@ void emitter::emitIns_S_R(instruction ins, emitAttr attr, regNumber reg1, int va | |
| // Try to optimize a store with an alternative instruction. | ||
| if (isStr && emitComp->opts.OptimizationEnabled() && OptimizeLdrStr(ins, attr, reg1, reg2, imm, size, fmt)) | ||
| { | ||
| // Ensure local variables are tracked. | ||
| emitLastIns->idAddr()->iiaLclVar.initLclVarAddr(varx, offs); | ||
| emitLastIns->idSetIsLclVar(); | ||
| #ifdef DEBUG | ||
| emitLastIns->idDebugOnlyInfo()->idVarRefOffs = emitVarRefOffs; | ||
| #endif | ||
| return; | ||
| } | ||
|
|
||
|
|
||
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 am wondering
emitLastInswould already have this set while processing the previousldr, right?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.
For the
IsRedundantLdStrcase, yes, I think it's essentially the same information in both instructions.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.
Correct, so wondering how this would help? What extra information would we track with this that was not already present in
emitLastIns?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.
OptimizeLdrStr()is attempting bothIsRedundantLdStr()andReplaceLdrStrWithPairInstr().For the
IsRedundantLdStr()it's redundant.For the
ReplaceLdrStrWithPairInstr()case (where we are merging twostrs into anstp), then the local variable in the first str has already been tracked, but the local variable in the second str needs tracking.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.
That makes sense.