summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrzej Janik <[email protected]>2020-09-23 00:40:26 +0200
committerAndrzej Janik <[email protected]>2020-09-23 00:40:26 +0200
commit03005140dde6c45a47d1fe03a183d76af38b7a12 (patch)
treec55498b9195fb5fa04b3c11f5f7e925884b81738
parent5a7860d9f17abe50cd424a3a523d561658b087fa (diff)
downloadZLUDA-03005140dde6c45a47d1fe03a183d76af38b7a12.tar.gz
ZLUDA-03005140dde6c45a47d1fe03a183d76af38b7a12.zip
Add a workaround for IGC bug
-rw-r--r--ptx/src/translate.rs14
1 files changed, 12 insertions, 2 deletions
diff --git a/ptx/src/translate.rs b/ptx/src/translate.rs
index 22e16ff..5b03f0b 100644
--- a/ptx/src/translate.rs
+++ b/ptx/src/translate.rs
@@ -299,7 +299,6 @@ fn emit_function_header<'a>(
pub fn to_spirv<'a>(ast: ast::Module<'a>) -> Result<Vec<u32>, TranslateError> {
let module = to_spirv_module(ast)?;
- eprintln!("{}", module.disassemble());
Ok(module.assemble())
}
@@ -1305,7 +1304,18 @@ fn emit_function_body_ops(
let result_id = Some(a.dst);
let operand = a.src;
match t {
- ast::NotType::Pred => builder.logical_not(result_type, result_id, operand),
+ ast::NotType::Pred => {
+ // HACK ALERT
+ // Temporary workaround until IGC gets its shit together
+ // Currently IGC carries two copies of SPIRV-LLVM translator
+ // a new one in /llvm-spirv/ and old one in /IGC/AdaptorOCL/SPIRV/.
+ // Obviously, old and buggy one is used for compiling L0 SPIRV
+ // https://github.com/intel/intel-graphics-compiler/issues/148
+ let type_pred = map.get_or_add_scalar(builder, ast::ScalarType::Pred);
+ let const_true = builder.constant_true(type_pred);
+ let const_false = builder.constant_false(type_pred);
+ builder.select(result_type, result_id, operand, const_false, const_true)
+ },
_ => builder.not(result_type, result_id, operand),
}?;
}