Mesa (master): aco: Make sure not to mistakenly propagate 64-bit constants.
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Nov 14 17:12:07 UTC 2019
Module: Mesa
Branch: master
Commit: 94e355148f689c86f17cc6dbcb14acc28078fd8e
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=94e355148f689c86f17cc6dbcb14acc28078fd8e
Author: Timur Kristóf <timur.kristof at gmail.com>
Date: Wed Nov 6 17:42:32 2019 +0100
aco: Make sure not to mistakenly propagate 64-bit constants.
ACO's optimizer would try to propagate 64-bit constants, but
does so in such a way that wouldn't work due to how the 64-bit
constants are handled in the IR.
Signed-off-by: Timur Kristóf <timur.kristof at gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02 at gmail.com>
Reviewed-by: Daniel Schürmann <daniel at schuermann.dev>
---
src/amd/compiler/aco_optimizer.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp
index 68f17569e32..9b4f007b62a 100644
--- a/src/amd/compiler/aco_optimizer.cpp
+++ b/src/amd/compiler/aco_optimizer.cpp
@@ -765,7 +765,7 @@ void label_instruction(opt_ctx &ctx, aco_ptr<Instruction>& instr)
if (vec_op.isConstant()) {
if (vec_op.isLiteral())
ctx.info[instr->definitions[i].tempId()].set_literal(vec_op.constantValue());
- else
+ else if (vec_op.size() == 1)
ctx.info[instr->definitions[i].tempId()].set_constant(vec_op.constantValue());
} else {
assert(vec_op.isTemp());
@@ -794,7 +794,7 @@ void label_instruction(opt_ctx &ctx, aco_ptr<Instruction>& instr)
if (vec_op.isConstant()) {
if (vec_op.isLiteral())
ctx.info[instr->definitions[0].tempId()].set_literal(vec_op.constantValue());
- else
+ else if (vec_op.size() == 1)
ctx.info[instr->definitions[0].tempId()].set_constant(vec_op.constantValue());
} else {
assert(vec_op.isTemp());
@@ -814,7 +814,7 @@ void label_instruction(opt_ctx &ctx, aco_ptr<Instruction>& instr)
} else if (instr->operands[0].isConstant()) {
if (instr->operands[0].isLiteral())
ctx.info[instr->definitions[0].tempId()].set_literal(instr->operands[0].constantValue());
- else
+ else if (instr->operands[0].size() == 1)
ctx.info[instr->definitions[0].tempId()].set_constant(instr->operands[0].constantValue());
} else if (instr->operands[0].isTemp()) {
ctx.info[instr->definitions[0].tempId()].set_temp(instr->operands[0].getTemp());
More information about the mesa-commit
mailing list