Skip to content

Commit

Permalink
[SOL] Allow selectively disable compiler builtins for BPF target (#4)
Browse files Browse the repository at this point in the history
* [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
  • Loading branch information
dmakarov authored and LucasSte committed Aug 19, 2024
1 parent bb306b8 commit 55b756d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions llvm/lib/Analysis/TargetLibraryInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,12 @@ static void initialize(TargetLibraryInfoImpl &TLI, const Triple &T,
TLI.setUnavailable(LibFunc_vec_free);
}

if (T.isBPF()) {
TLI.setUnavailable(LibFunc_rust_alloc);
TLI.setUnavailable(LibFunc_rust_dealloc);
TLI.setUnavailable(LibFunc_rust_realloc);
}

TLI.addVectorizableFunctionsFromVecLib(ClVectorLibrary, T);
}

Expand Down

0 comments on commit 55b756d

Please sign in to comment.