-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[RISCV] Use vleff's AVL when output VL doesn't dominate in RISCVVLOptimizer #156618
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 2 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 |
|---|---|---|
|
|
@@ -1464,6 +1464,15 @@ bool RISCVVLOptimizer::tryReduceVL(MachineInstr &MI) const { | |
| assert((CommonVL->isImm() || CommonVL->getReg().isVirtual()) && | ||
| "Expected VL to be an Imm or virtual Reg"); | ||
|
|
||
| // If the VL is defined by a vleff that doesn't dominate MI, try using the | ||
| // vleff's AVL. It will be greater than or equal to the output VL. | ||
| if (CommonVL->isReg()) { | ||
| const MachineInstr *VLMI = MRI->getVRegDef(CommonVL->getReg()); | ||
| if (RISCVInstrInfo::isFaultOnlyFirstLoad(*VLMI) && | ||
| !MDT->dominates(VLMI, &MI)) | ||
| CommonVL = VLMI->getOperand(4); | ||
|
||
| } | ||
|
|
||
| if (!RISCV::isVLKnownLE(*CommonVL, VLOp)) { | ||
| LLVM_DEBUG(dbgs() << " Abort due to CommonVL not <= VLOp.\n"); | ||
| return false; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.