From 91a7d0e05e7a00fdde407326d390dd66cc672f89 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Mon, 11 Feb 2019 16:02:15 -0800 Subject: intel/compiler: Avoid propagating inequality cmods if types are different Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109404 --- src/intel/compiler/brw_fs_cmod_propagation.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/intel/compiler/brw_fs_cmod_propagation.cpp b/src/intel/compiler/brw_fs_cmod_propagation.cpp index 5fb522f810f..7686b8800ed 100644 --- a/src/intel/compiler/brw_fs_cmod_propagation.cpp +++ b/src/intel/compiler/brw_fs_cmod_propagation.cpp @@ -255,6 +255,13 @@ opt_cmod_propagation_local(const gen_device_info *devinfo, bblock_t *block) if (inst->opcode == BRW_OPCODE_AND) break; + /* Not safe to use inequality operators if the types are different + */ + if (scan_inst->dst.type != inst->src[0].type && + (inst->conditional_mod != BRW_CONDITIONAL_Z || + inst->conditional_mod != BRW_CONDITIONAL_NZ)) + break; + /* Comparisons operate differently for ints and floats */ if (scan_inst->dst.type != inst->dst.type && (scan_inst->dst.type == BRW_REGISTER_TYPE_F || -- cgit v1.2.3