From bd6306cdaa4a49344658bd026721b6532e103d09 Mon Sep 17 00:00:00 2001 From: Yong He Date: Fri, 24 Feb 2023 10:01:47 -0800 Subject: More control flow simplifications. (#2673) * More control flow and Phi param simplifications. * Fix. * Fix gcc error. * Fix. * More IR cleanup. * Fix bug in phi param dce + ifelse simplify. * Propagate and DCE side-effect-free functions. * Enhance CFG simplifcation to remove loops with no side effects. * Fix. * Fixes. * Fix tests. Add [__AlwaysFoldIntoUseSite] for rayPayloadLocation. * More cleanup. * Fixes. * Fix. --------- Co-authored-by: Yong He --- source/slang/core.meta.slang | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/slang/core.meta.slang') diff --git a/source/slang/core.meta.slang b/source/slang/core.meta.slang index 6357d58bd..9da33c755 100644 --- a/source/slang/core.meta.slang +++ b/source/slang/core.meta.slang @@ -2525,21 +2525,25 @@ int __SyntaxError(); __generic __target_intrinsic(cuda, "sizeof($G0)") __target_intrinsic(cpp, "sizeof($G0)") +[__readNone] int __sizeOf(); __generic __target_intrinsic(cuda, "sizeof($T0)") __target_intrinsic(cpp, "sizeof($T0)") +[__readNone] int __sizeOf(T v); __generic __target_intrinsic(cuda, "SLANG_ALIGN_OF($G0)") __target_intrinsic(cpp, "SLANG_ALIGN_OF($G0)") +[__readNone] int __alignOf(); __generic __target_intrinsic(cuda, "SLANG_ALIGN_OF($T0)") __target_intrinsic(cpp, "SLANG_ALIGN_OF($T0)") +[__readNone] int __alignOf(T v); // It would be nice to have offsetof equivalent, but it's not clear how that would work in terms of the Slang language. @@ -2547,6 +2551,7 @@ int __alignOf(T v); __generic __target_intrinsic(cuda, "int(((char*)&($1)) - ((char*)&($0)))") __target_intrinsic(cpp, "int(((char*)&($1)) - ((char*)&($0))") +[__readNone] int __offsetOf(in T t, in F field); /// Mark beginning of "interlocked" operations in a fragment shader. @@ -2960,6 +2965,9 @@ attribute_syntax [builtin] : BuiltinAttribute; __attributeTarget(DeclBase) attribute_syntax [__requiresNVAPI] : RequiresNVAPIAttribute; +__attributeTarget(DeclBase) +attribute_syntax [__AlwaysFoldIntoUseSiteAttribute] : AlwaysFoldIntoUseSiteAttribute; + __attributeTarget(FunctionDeclBase) attribute_syntax [noinline] : NoInlineAttribute; -- cgit v1.2.3