Skip to content

Commit 8e61557

Browse files
authored
new flag (#101)
1 parent 683aa31 commit 8e61557

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

compiler/rustc_codegen_llvm/src/back/write.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,6 +1089,12 @@ pub(crate) unsafe fn differentiate(
10891089
LLVMDumpModule(llmod);
10901090
}
10911091
}
1092+
1093+
if std::env::var("ENZYME_INLINE").is_ok() {
1094+
dbg!("Setting inline to true");
1095+
llvm::set_inline(true);
1096+
}
1097+
10921098
if std::env::var("ENZYME_TT_DEPTH").is_ok() {
10931099
let depth = std::env::var("ENZYME_TT_DEPTH").unwrap();
10941100
let depth = depth.parse::<u64>().unwrap();

compiler/rustc_codegen_llvm/src/llvm/ffi.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2657,6 +2657,7 @@ pub mod Fallback_AD {
26572657
pub fn EnzymeSetCLBool(arg1: *mut ::std::os::raw::c_void, arg2: u8) { unimplemented!() }
26582658
pub fn EnzymeSetCLInteger(arg1: *mut ::std::os::raw::c_void, arg2: i64) { unimplemented!() }
26592659

2660+
pub fn set_inline(val: bool) { unimplemented!() }
26602661
pub fn set_runtime_activity_check(check: bool) { unimplemented!() }
26612662
pub fn set_max_int_offset(offset: u64) { unimplemented!() }
26622663
pub fn set_max_type_offset(offset: u64) { unimplemented!() }
@@ -3017,6 +3018,7 @@ extern "C" {
30173018
static mut EnzymePrint: c_void;
30183019
static mut EnzymeStrictAliasing: c_void;
30193020
static mut looseTypeAnalysis: c_void;
3021+
static mut EnzymeInline: c_void;
30203022
}
30213023
pub fn set_runtime_activity_check(check: bool) {
30223024
unsafe {
@@ -3071,6 +3073,11 @@ pub fn set_loose_types(loose: bool) {
30713073
EnzymeSetCLBool(std::ptr::addr_of_mut!(looseTypeAnalysis), loose as u8);
30723074
}
30733075
}
3076+
pub fn set_inline(val: bool) {
3077+
unsafe {
3078+
EnzymeSetCLBool(std::ptr::addr_of_mut!(EnzymeInline), val as u8);
3079+
}
3080+
}
30743081

30753082
extern "C" {
30763083
pub fn EnzymeCreatePrimalAndGradient<'a>(

0 commit comments

Comments
 (0)