{"opt", SfnLog::opt, "Log optimization" },
{"steps", SfnLog::steps, "Log shaders at transformation steps" },
{"noopt", SfnLog::noopt, "Don't run backend optimizations" },
+ {"noaddrsplit", SfnLog::noaddrsplit, "Don't split address loads early" },
DEBUG_NAMED_VALUE_END
};
#include "sfn_ra.h"
#include "sfn_scheduler.h"
#include "sfn_shader.h"
+#include "sfn_split_address_loads.h"
#include "util/u_prim.h"
#include <vector>
}
}
+ if (!r600::sfn_log.has_debug_flag(r600::SfnLog::noaddrsplit))
+ split_address_loads(*shader);
+
+ if (r600::sfn_log.has_debug_flag(r600::SfnLog::steps)) {
+ std::cerr << "Shader after splitting address loads\n";
+ shader->print(std::cerr);
+ }
+
+ if (!r600::sfn_log.has_debug_flag(r600::SfnLog::noopt)) {
+ optimize(*shader);
+
+ if (r600::sfn_log.has_debug_flag(r600::SfnLog::steps)) {
+ std::cerr << "Shader after optimization\n";
+ shader->print(std::cerr);
+ }
+ }
+
auto scheduled_shader = r600::schedule(shader);
if (r600::sfn_log.has_debug_flag(r600::SfnLog::steps)) {
std::cerr << "Shader after scheduling\n";
/* We already schedule the code with this in mind, no need to handle this
* in the backend assembler */
- pipeshader->shader.bc.ar_handling = AR_HANDLE_NORMAL;
- pipeshader->shader.bc.r6xx_nop_after_rel_dst = 0;
-
+ if (!r600::sfn_log.has_debug_flag(r600::SfnLog::noaddrsplit)) {
+ pipeshader->shader.bc.ar_handling = AR_HANDLE_NORMAL;
+ pipeshader->shader.bc.r6xx_nop_after_rel_dst = 0;
+ }
r600::sfn_log << r600::SfnLog::shader_info << "pipeshader->shader.processor_type = "
<< pipeshader->shader.processor_type << "\n";