Silence compilation warnings when release build.
authorYang Rong <rong.r.yang@intel.com>
Wed, 28 May 2014 07:37:49 +0000 (15:37 +0800)
committerZhigang Gong <zhigang.gong@intel.com>
Wed, 28 May 2014 08:05:52 +0000 (16:05 +0800)
Also silence warnings in 32bit system.

Signed-off-by: Yang Rong <rong.r.yang@intel.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
backend/src/backend/gen_encoder.cpp
backend/src/backend/gen_insn_selection.cpp
backend/src/backend/program.cpp
src/performance.c

index eadd94f..038d14b 100644 (file)
@@ -1101,6 +1101,7 @@ namespace gbe
 
   void GenEncoder::patchJMPI(uint32_t insnID, int32_t jumpDistance) {
     GenNativeInstruction &insn = *(GenNativeInstruction *)&this->store[insnID];
+    GenNativeInstruction &insn2 = *(GenNativeInstruction *)&this->store[insnID+2];
     GBE_ASSERT(insnID < this->store.size());
     GBE_ASSERT(insn.header.opcode == GEN_OPCODE_JMPI ||
                insn.header.opcode == GEN_OPCODE_BRD  ||
@@ -1129,7 +1130,6 @@ namespace gbe
       // for all the branching instruction. And need to adjust the distance
       // for those branch instruction's start point and end point contains
       // this instruction.
-      GenNativeInstruction &insn2 = *(GenNativeInstruction *)&this->store[insnID+2];
       GBE_ASSERT(insn2.header.opcode == GEN_OPCODE_NOP);
       insn.header.opcode = GEN_OPCODE_ADD;
       this->setDst(&insn, GenRegister::ip());
@@ -1138,7 +1138,6 @@ namespace gbe
     } else {
       insn.header.predicate_inverse ^= 1;
       this->setSrc1(&insn, GenRegister::immd(2));
-      GenNativeInstruction &insn2 = *(GenNativeInstruction *)&this->store[insnID+2];
       GBE_ASSERT(insn2.header.opcode == GEN_OPCODE_NOP);
       GBE_ASSERT(insnID < this->store.size());
       insn2.header.predicate_control = GEN_PREDICATE_NONE;
index cb86e34..cf0af9d 100644 (file)
@@ -2702,9 +2702,8 @@ namespace gbe
                          uint32_t bti) const
     {
       using namespace ir;
-      const uint32_t valueNum = insn.getValueNum();
       const uint32_t simdWidth = sel.isScalarReg(insn.getValue(0)) ? 1 : sel.ctx.getSimdWidth();
-      GBE_ASSERT(valueNum == 1);
+      GBE_ASSERT(insn.getValueNum() == 1);
       GenRegister dst = GenRegister::retype(sel.selReg(insn.getValue(0)), GEN_TYPE_F);
       // get dword based address
       GenRegister addrDW = GenRegister::udxgrf(simdWidth, sel.reg(FAMILY_DWORD, simdWidth == 1));
index 121e237..ea36f28 100644 (file)
@@ -643,7 +643,7 @@ namespace gbe {
 
     while (getline(idirs, pcmFileName, ':')) {
       if(access(pcmFileName.c_str(), R_OK) == 0) {
-        findPcm = true;
+        findPcm |= true;
         break;
       }
     }
index 5248bb7..a785460 100644 (file)
@@ -20,7 +20,7 @@ typedef struct kernel_storage_node
 
 typedef struct context_storage_node
 {
-  uint64_t context_id;
+  uintptr_t context_id;
   kernel_storage_node *kernels_storage;
   char max_time_kernel_name[MAX_KERNEL_NAME_LENGTH];
   float kernel_max_time;
@@ -46,14 +46,14 @@ static context_storage_node * find_context(cl_context context)
 {
   if(NULL != prev_context_pointer )
   {
-    if(prev_context_pointer->context_id == (uint64_t)context)
+    if(prev_context_pointer->context_id == (uintptr_t)context)
       return prev_context_pointer;
   }
 
   if(NULL == record.context_storage)
   {
     record.context_storage = (context_storage_node *) malloc(sizeof(context_storage_node));
-    record.context_storage->context_id = (uint64_t)context;
+    record.context_storage->context_id = (uintptr_t)context;
     record.context_storage->kernels_storage = NULL;
     record.context_storage->kernel_max_time = 0.0f;
     record.context_storage->next = NULL;
@@ -63,7 +63,7 @@ static context_storage_node * find_context(cl_context context)
 
   context_storage_node *pre = record.context_storage;
   context_storage_node *cur = record.context_storage;
-  while(NULL !=cur && (uint64_t)context != cur->context_id )
+  while(NULL !=cur && (uintptr_t)context != cur->context_id )
   {
     pre = cur;
     cur = cur->next;
@@ -73,7 +73,7 @@ static context_storage_node * find_context(cl_context context)
 
   pre->next = (context_storage_node *)malloc(sizeof(context_storage_node));
   pre = pre->next;
-  pre->context_id = (uint64_t)context;
+  pre->context_id = (uintptr_t)context;
   pre->kernels_storage = NULL;
   pre->kernel_max_time = 0.0f;
   pre->next = NULL;