-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[RISCV][VLOPT] Add getOperandInfo for Vector Store Whole Register Instructions #119570
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 all commits
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 |
|---|---|---|
|
|
@@ -247,6 +247,25 @@ static OperandInfo getOperandInfo(const MachineInstr &MI, | |
| llvm_unreachable("Configuration setting instructions do not read or write " | ||
| "vector registers"); | ||
|
|
||
| // Vector Store Whole Register Instructions | ||
| // EMUL=nr. EEW=eew. Since in-register byte layouts are idential to in-memory | ||
| // byte layouts, the same data is writen to destination register regardless | ||
| // of EEW. eew is just a hint to the hardware and has not functional impact. | ||
| // Therefore, it is be okay if we ignore eew and always use the same EEW to | ||
| // create more optimization opportunities. | ||
| // FIXME: Instead of using any SEW, we really should return the SEW in the | ||
| // instruction and add a field to OperandInfo that says the SEW is just a hint | ||
| // so that this optimization can use any sew to construct a ratio. | ||
| case RISCV::VS1R_V: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These instructions don't have an SEW or VL operand so I think we would fail this check before we get here |
||
| return OperandInfo(RISCVII::VLMUL::LMUL_1, 0); | ||
| case RISCV::VS2R_V: | ||
| return OperandInfo(RISCVII::VLMUL::LMUL_2, 0); | ||
| case RISCV::VS4R_V: | ||
| return OperandInfo(RISCVII::VLMUL::LMUL_4, 0); | ||
| case RISCV::VS8R_V: | ||
| return OperandInfo(RISCVII::VLMUL::LMUL_8, 0); | ||
|
|
||
|
|
||
| // Vector Integer Arithmetic Instructions | ||
| // Vector Single-Width Integer Add and Subtract | ||
| case RISCV::VADD_VI: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -483,3 +483,34 @@ body: | | |
| %x:vr = PseudoVADD_VV_MF4 $noreg, $noreg, $noreg, -1, 3 /* e8 */, 0 | ||
| %y:vr = PseudoVNSRL_WV_MF2 $noreg, $noreg, %x, 1, 3 /* e8 */, 0 | ||
| ... | ||
| --- | ||
| name: vsNr_v | ||
| body: | | ||
| bb.0: | ||
| ; CHECK-LABEL: name: vsNr_v | ||
| ; CHECK: %x:vr = PseudoVADD_VV_M1 $noreg, $noreg, $noreg, -1, 3 /* e8 */, 0 /* tu, mu */ | ||
| ; CHECK-NEXT: VS1R_V %x, $noreg | ||
| %x:vr = PseudoVADD_VV_M1 $noreg, $noreg, $noreg, -1, 3 /* e8 */, 0 | ||
| VS1R_V %x, $noreg | ||
| ... | ||
| # FIXME: We can optimize this | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What would the optimization be? We didn't optimize the vsNr_v case. |
||
| --- | ||
| name: vsNr_v_eew | ||
| body: | | ||
| bb.0: | ||
| ; CHECK-LABEL: name: vsNr_v_eew | ||
| ; CHECK: %x:vr = PseudoVADD_VV_M1 $noreg, $noreg, $noreg, -1, 3 /* e8 */, 0 /* tu, mu */ | ||
| ; CHECK-NEXT: VS1R_V %x, $noreg | ||
| %x:vr = PseudoVADD_VV_M1 $noreg, $noreg, $noreg, -1, 3 /* e8 */, 0 | ||
| VS1R_V %x, $noreg | ||
| ... | ||
| --- | ||
| name: vsNr_v_incompatible_emul | ||
| body: | | ||
| bb.0: | ||
| ; CHECK-LABEL: name: vsNr_v_incompatible_emul | ||
| ; CHECK: %x:vr = PseudoVADD_VV_MF2 $noreg, $noreg, $noreg, -1, 3 /* e8 */, 0 /* tu, mu */ | ||
| ; CHECK-NEXT: VS1R_V %x, $noreg | ||
| %x:vr = PseudoVADD_VV_MF2 $noreg, $noreg, $noreg, -1, 3 /* e8 */, 0 | ||
| VS1R_V %x, $noreg | ||
| ... | ||
Uh oh!
There was an error while loading. Please reload this page.