mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 15:20:10 +01:00
nv50/ir/opt: swap VP inputs to first source where possible
This commit is contained in:
parent
97e2f625b8
commit
90b5301cea
1 changed files with 17 additions and 0 deletions
|
|
@ -123,6 +123,7 @@ private:
|
|||
|
||||
bool isCSpaceLoad(Instruction *);
|
||||
bool isImmd32Load(Instruction *);
|
||||
bool isAttribOrSharedLoad(Instruction *);
|
||||
};
|
||||
|
||||
bool
|
||||
|
|
@ -139,6 +140,16 @@ LoadPropagation::isImmd32Load(Instruction *ld)
|
|||
return ld->src(0).getFile() == FILE_IMMEDIATE;
|
||||
}
|
||||
|
||||
bool
|
||||
LoadPropagation::isAttribOrSharedLoad(Instruction *ld)
|
||||
{
|
||||
return ld &&
|
||||
(ld->op == OP_VFETCH ||
|
||||
(ld->op == OP_LOAD &&
|
||||
(ld->src(0).getFile() == FILE_SHADER_INPUT ||
|
||||
ld->src(0).getFile() == FILE_MEMORY_SHARED)));
|
||||
}
|
||||
|
||||
void
|
||||
LoadPropagation::checkSwapSrc01(Instruction *insn)
|
||||
{
|
||||
|
|
@ -162,6 +173,12 @@ LoadPropagation::checkSwapSrc01(Instruction *insn)
|
|||
insn->swapSources(0, 1);
|
||||
else
|
||||
return;
|
||||
} else
|
||||
if (isAttribOrSharedLoad(i1)) {
|
||||
if (!isAttribOrSharedLoad(i0))
|
||||
insn->swapSources(0, 1);
|
||||
else
|
||||
return;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue