From: Pekka Jääskeläinen Date: Fri, 4 May 2018 19:46:16 +0000 (+0000) Subject: [BRIGFE] Fix handling of NOPs. X-Git-Tag: upstream/12.2.0~32012 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=73def6eadc7a1f3e3465b972b774f26fcf8446bf;p=platform%2Fupstream%2Fgcc.git [BRIGFE] Fix handling of NOPs. From-SVN: r259958 --- diff --git a/gcc/brig/ChangeLog b/gcc/brig/ChangeLog index ce4aea6..0a2846d 100644 --- a/gcc/brig/ChangeLog +++ b/gcc/brig/ChangeLog @@ -1,5 +1,9 @@ 2018-05-04 Pekka Jääskeläinen + * brig/brigfrontend/brig-basic-inst-handler.cc: Fix handling of NOPs. + +2018-05-04 Pekka Jääskeläinen + Add flag -fassume-phsa that is on by default. If -fno-assume-phsa is given, these optimizations are disabled. With this flag, gccbrig can generate GENERIC that assumes we are targeting a phsa-runtime diff --git a/gcc/brig/brigfrontend/brig-basic-inst-handler.cc b/gcc/brig/brigfrontend/brig-basic-inst-handler.cc index c8224ae..75e1cfa 100644 --- a/gcc/brig/brigfrontend/brig-basic-inst-handler.cc +++ b/gcc/brig/brigfrontend/brig-basic-inst-handler.cc @@ -447,6 +447,8 @@ size_t brig_basic_inst_handler::operator () (const BrigBase *base) { const BrigInstBase *brig_inst = (const BrigInstBase *) base; + if (brig_inst->opcode == BRIG_OPCODE_NOP) + return base->byteCount; tree_stl_vec operands = build_operands (*brig_inst); @@ -466,11 +468,9 @@ brig_basic_inst_handler::operator () (const BrigBase *base) BrigType16_t brig_inst_type = brig_inst->type; - if (brig_inst->opcode == BRIG_OPCODE_NOP) - return base->byteCount; - else if (brig_inst->opcode == BRIG_OPCODE_FIRSTBIT - || brig_inst->opcode == BRIG_OPCODE_LASTBIT - || brig_inst->opcode == BRIG_OPCODE_SAD) + if (brig_inst->opcode == BRIG_OPCODE_FIRSTBIT + || brig_inst->opcode == BRIG_OPCODE_LASTBIT + || brig_inst->opcode == BRIG_OPCODE_SAD) /* These instructions are reported to be always 32b in HSAIL, but we want to treat them according to their input argument's type to select the correct instruction/builtin. */