Mesa (master): nir: Add a nop intrinsic

Jason Ekstrand jekstrand at kemper.freedesktop.org
Mon Oct 3 23:37:31 UTC 2016


Module: Mesa
Branch: master
Commit: 7697b4b98b155c818811709becdb408772371538
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7697b4b98b155c818811709becdb408772371538

Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date:   Thu Sep 15 21:02:37 2016 -0700

nir: Add a nop intrinsic

This intrinsic has no destination, no sources, no variables, and can be
eliminated.  In other words, it does nothing and will always get deleted by
dead code elimination.  However, it does provide a quick-and-easy way to
temporarily tag a particular location in a NIR shader.

Signed-off-by: Jason Ekstrand <jason at jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Cc: "12.0" <mesa-stable at lists.freedesktop.org>

---

 src/compiler/nir/nir_intrinsics.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/compiler/nir/nir_intrinsics.h b/src/compiler/nir/nir_intrinsics.h
index b27a148..f24d894 100644
--- a/src/compiler/nir/nir_intrinsics.h
+++ b/src/compiler/nir/nir_intrinsics.h
@@ -41,6 +41,9 @@
 
 #define ARR(...) { __VA_ARGS__ }
 
+INTRINSIC(nop, 0, ARR(0), false, 0, 0, 0, xx, xx, xx,
+          NIR_INTRINSIC_CAN_ELIMINATE)
+
 INTRINSIC(load_var, 0, ARR(0), true, 0, 1, 0, xx, xx, xx, NIR_INTRINSIC_CAN_ELIMINATE)
 INTRINSIC(store_var, 1, ARR(0), false, 0, 1, 1, WRMASK, xx, xx, 0)
 INTRINSIC(copy_var, 0, ARR(0), false, 0, 2, 0, xx, xx, xx, 0)




More information about the mesa-commit mailing list