diff options
| author | Yong He <yonghe@outlook.com> | 2023-07-12 16:00:05 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-12 16:00:05 -0700 |
| commit | 261b2f1f2bc13ccf7db5ec68c825ffc7b0781f7f (patch) | |
| tree | 4953e376e705a8110cb8164dda5b239c04f2768b /source/slang/slang-ir-util.h | |
| parent | bbd9c2e6d7b57f5acc3238083ab2f7c7b140df5e (diff) | |
Use scratchData on `IRInst` to replace HashSets. (#2978)
* Use scratchData on `IRInst` to replace HashSets.
* Update test results.
* Initialize scratchData.
* Update autodiff documentation.
* Use enum instead of bool.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-ir-util.h')
| -rw-r--r-- | source/slang/slang-ir-util.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/slang/slang-ir-util.h b/source/slang/slang-ir-util.h index c12f0b62b..98c3996a2 100644 --- a/source/slang/slang-ir-util.h +++ b/source/slang/slang-ir-util.h @@ -173,12 +173,12 @@ String dumpIRToString(IRInst* root); // Returns whether a call insts can be treated as a pure functional inst, and thus can be // DCE'd and deduplicated. // (no writes to memory, no reads from unknown memory, no side effects). -bool isPureFunctionalCall(IRCall* callInst); +bool isPureFunctionalCall(IRCall* callInst, SideEffectAnalysisOptions options = SideEffectAnalysisOptions::None); // Returns whether a call insts can be treated as a pure functional inst, and thus can be // DCE'd (but not necessarily deduplicated). // (no side effects). -bool isSideEffectFreeFunctionalCall(IRCall* call); +bool isSideEffectFreeFunctionalCall(IRCall* call, SideEffectAnalysisOptions options = SideEffectAnalysisOptions::None); bool doesCalleeHaveSideEffect(IRInst* callee); @@ -221,6 +221,9 @@ bool isGlobalOrUnknownMutableAddress(IRGlobalValueWithCode* parentFunc, IRInst* bool isZero(IRInst* inst); bool isOne(IRInst* inst); + +void initializeScratchData(IRInst* inst); +void resetScratchDataBit(IRInst* inst, int bitIndex); } #endif |
