summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-emit.cpp
diff options
context:
space:
mode:
authorSai Praveen Bangaru <31557731+saipraveenb25@users.noreply.github.com>2024-08-27 21:13:00 -0400
committerGitHub <noreply@github.com>2024-08-27 18:13:00 -0700
commit6bb32aa976494466bd6303f8ae6e348b297edb44 (patch)
tree54765fd5168e1d6590f403c6df04b30404ee6346 /source/slang/slang-emit.cpp
parenta9882c648c58e6f2821df11c7ee6ac77d9f09473 (diff)
Adds a warning for using `[PreferRecompute]` on methods that may contain side effects (#4707)
* Adds a warning for using prefer-recompute on methods that contain side effects * Rename `SideEffects` -> `SideEffectBehavior` --------- Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'source/slang/slang-emit.cpp')
-rw-r--r--source/slang/slang-emit.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/slang/slang-emit.cpp b/source/slang/slang-emit.cpp
index e91209108..103cd15ab 100644
--- a/source/slang/slang-emit.cpp
+++ b/source/slang/slang-emit.cpp
@@ -637,6 +637,13 @@ Result linkAndOptimizeIR(
default:
break;
}
+
+ if (requiredLoweringPassSet.autodiff)
+ {
+ // Generate warnings for potentially incorrect or badly-performing autodiff patterns.
+ checkAutodiffPatterns(targetProgram, irModule, sink);
+ }
+
// Next, we need to ensure that the code we emit for
// the target doesn't contain any operations that would
// be illegal on the target platform. For example,