aboutsummaryrefslogtreecommitdiffstats
path: root/src/amd/compiler/aco_optimizer.cpp
diff options
context:
space:
mode:
authorRhys Perry <[email protected]>2019-10-29 13:59:59 +0000
committerRhys Perry <[email protected]>2019-11-08 00:14:06 +0000
commit78e3ea9a0fa8b80760f0f23ef0315c9428a2c946 (patch)
treec01b5d666a1e7f3b53fdbbe687f12ef32a91e1eb /src/amd/compiler/aco_optimizer.cpp
parent76544f632d98c8d7462c863b783fbe9e9a2d885c (diff)
aco: add Instruction::usesModifiers() and add more checks in the optimizer
No pipeline-db changes. v2: use early-exit for VOP3 Reviewed-by: Daniel Schürmann <[email protected]> (v1)
Diffstat (limited to 'src/amd/compiler/aco_optimizer.cpp')
-rw-r--r--src/amd/compiler/aco_optimizer.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp
index 9501073debb..679f25b5dda 100644
--- a/src/amd/compiler/aco_optimizer.cpp
+++ b/src/amd/compiler/aco_optimizer.cpp
@@ -496,6 +496,9 @@ bool parse_base_offset(opt_ctx &ctx, Instruction* instr, unsigned op_index, Temp
return false;
}
+ if (add_instr->usesModifiers())
+ return false;
+
for (unsigned i = 0; i < 2; i++) {
if (add_instr->operands[i].isConstant()) {
*offset = add_instr->operands[i].constantValue();
@@ -799,13 +802,13 @@ void label_instruction(opt_ctx &ctx, aco_ptr<Instruction>& instr)
case aco_opcode::p_as_uniform:
if (instr->definitions[0].isFixed()) {
/* don't copy-propagate copies into fixed registers */
+ } else if (instr->usesModifiers()) {
+ // TODO
} else if (instr->operands[0].isConstant()) {
if (instr->operands[0].isLiteral())
ctx.info[instr->definitions[0].tempId()].set_literal(instr->operands[0].constantValue());
else
ctx.info[instr->definitions[0].tempId()].set_constant(instr->operands[0].constantValue());
- } else if (instr->isDPP()) {
- // TODO
} else if (instr->operands[0].isTemp()) {
ctx.info[instr->definitions[0].tempId()].set_temp(instr->operands[0].getTemp());
} else {
@@ -849,11 +852,8 @@ void label_instruction(opt_ctx &ctx, aco_ptr<Instruction>& instr)
}
case aco_opcode::v_mul_f32: { /* omod */
/* TODO: try to move the negate/abs modifier to the consumer instead */
- if (instr->isVOP3()) {
- VOP3A_instruction *vop3 = static_cast<VOP3A_instruction*>(instr.get());
- if (vop3->abs[0] || vop3->abs[1] || vop3->neg[0] || vop3->neg[1] || vop3->omod || vop3->clamp)
- break;
- }
+ if (instr->usesModifiers())
+ break;
for (unsigned i = 0; i < 2; i++) {
if (instr->operands[!i].isConstant() && instr->operands[i].isTemp()) {