nv50/ir: Fix unused var warnings in release build
authorRhys Kidd <rhyskidd@gmail.com>
Sat, 2 Dec 2017 18:14:25 +0000 (13:14 -0500)
committerRhys Kidd <rhyskidd@gmail.com>
Sat, 30 Dec 2017 04:04:42 +0000 (23:04 -0500)
v2: Add preventative comment (Ilia Mirkin)

Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Pierre Moreau <pierre.morrow@free.fr>
Signed-off-by: Rhys Kidd <rhyskidd@gmail.com>
src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp

index cc2a88eb40a67fd45a42eb549f69663bc666a0a2..139ff4a31dc9ef1b37bdd87d34d5ae8504bc82f8 100644 (file)
@@ -621,7 +621,7 @@ void
 CodeEmitterNV50::emitLOAD(const Instruction *i)
 {
    DataFile sf = i->src(0).getFile();
-   int32_t offset = i->getSrc(0)->reg.data.offset;
+   MAYBE_UNUSED int32_t offset = i->getSrc(0)->reg.data.offset;
 
    switch (sf) {
    case FILE_SHADER_INPUT:
index 61d4e6a2d0ba93c8cafb4e6dd82f026ebd5ca984..0bbf21312fe8992b2513255d0846b6929975ac61 100644 (file)
@@ -3308,7 +3308,9 @@ PostRaLoadPropagation::handleMADforNV50(Instruction *i)
          i->setSrc(1, def->getSrc(0));
       } else {
          ImmediateValue val;
-         bool ret = def->src(0).getImmediate(val);
+         // getImmediate() has side-effects on the argument so this *shouldn't*
+         // be folded into the assert()
+         MAYBE_UNUSED bool ret = def->src(0).getImmediate(val);
          assert(ret);
          if (i->getSrc(1)->reg.data.id & 1)
             val.reg.data.u32 >>= 16;