Skip to content

Commit ff2db93

Browse files
committed
SIL/IRGen: analysis of runtime effects for an instruction
Define the possible runtime effects of an instruction in an enum `RuntimeEffect`. Add a new utility `swift:getRuntimeEffect` to estimate the runtime effects of an instruction. Also, add a mechanism to validate the correctness of the analysis in IRGen: annotate all runtime functions in RuntimeFunctions.def with the actual effect what the runtime function has or can have. Then check if the effects of emitted runtime functions for an instruction match what `getRuntimeEffect` predicts. This check is only enabled on demand by defining the CHECK_RUNTIME_EFFECT_ANALYSIS macro in RuntimeEffect.h
1 parent 4e6c543 commit ff2db93

File tree

8 files changed

+1093
-236
lines changed

8 files changed

+1093
-236
lines changed

include/swift/Runtime/RuntimeFnWrappersGen.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#ifndef SWIFT_RUNTIME_RUNTIMEFNWRAPPERSGEN_H
1717
#define SWIFT_RUNTIME_RUNTIMEFNWRAPPERSGEN_H
1818

19+
#include "swift/SIL/RuntimeEffect.h"
1920
#include "llvm/IR/Module.h"
2021
#include "llvm/ADT/ArrayRef.h"
2122

0 commit comments

Comments
 (0)