Skip to content

Commit d16db80

Browse files
dmakarovLucasSte
authored andcommitted
[SOL] Allow selectively disable compiler builtins for BPF target (#4)
* [BPF] Make rust allocation builtins unavailable for BPF target - the calls to rust alloc/dealloc routines need to be preserved and not replaced by compiler generated builtin inlined code
1 parent d0a1b4c commit d16db80

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

llvm/lib/Analysis/TargetLibraryInfo.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -864,6 +864,12 @@ static void initialize(TargetLibraryInfoImpl &TLI, const Triple &T,
864864
TLI.setUnavailable(LibFunc_vec_free);
865865
}
866866

867+
if (T.isBPF()) {
868+
TLI.setUnavailable(LibFunc_rust_alloc);
869+
TLI.setUnavailable(LibFunc_rust_dealloc);
870+
TLI.setUnavailable(LibFunc_rust_realloc);
871+
}
872+
867873
TLI.addVectorizableFunctionsFromVecLib(ClVectorLibrary, T);
868874
}
869875

0 commit comments

Comments
 (0)