File tree 2 files changed +8
-6
lines changed
compiler/rustc_codegen_llvm/src/back
2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -35,19 +35,19 @@ cargo +enzyme test --examples
35
35
```
36
36
37
37
## Enzyme Config
38
- To help with debugging, Enzyme can be configured using four environment variables.
38
+ To help with debugging, Enzyme can be configured using environment variables.
39
39
``` bash
40
40
export ENZYME_PRINT_TA=1
41
41
export ENZYME_PRINT_AA=1
42
42
export ENZYME_PRINT=1
43
43
export ENZYME_PRINT_MOD=1
44
+ export ENZYME_PRINT_MOD_AFTER=1
44
45
```
45
46
The first three will print TypeAnalysis, ActivityAnalysis and the llvm-ir on a function basis, respectively.
46
- The last variable can be used to print the whole module directly before Enzyme starts
47
- differentiating functions.
47
+ The last two variables will print the whole module directly before and after Enzyme differented the functions.
48
48
49
- We want to make sure that we have EnzymeStrictAliasing=0 all the time to make sure
50
- that Enzyme handles enums correctly. Other flags might be enabled for debug purpose .
49
+ When experimenting with flags please make sure that EnzymeStrictAliasing=0
50
+ is not changed, since it is required for Enzyme to handle enums correctly .
51
51
52
52
53
53
Original file line number Diff line number Diff line change @@ -748,7 +748,6 @@ pub(crate) unsafe fn differentiate(
748
748
749
749
if std:: env:: var ( "ENZYME_PRINT_MOD" ) . is_ok ( ) {
750
750
unsafe { LLVMDumpModule ( llmod) ; }
751
-
752
751
}
753
752
for item in diff_items {
754
753
let res = enzyme_ad ( llmod, llcx, item) ;
@@ -772,6 +771,9 @@ pub(crate) unsafe fn differentiate(
772
771
break ;
773
772
}
774
773
}
774
+ if std:: env:: var ( "ENZYME_PRINT_MOD_AFTER" ) . is_ok ( ) {
775
+ unsafe { LLVMDumpModule ( llmod) ; }
776
+ }
775
777
776
778
Ok ( ( ) )
777
779
}
You can’t perform that action at this time.
0 commit comments