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 Feb 16, 2024
1 parent d0a1b4c commit d16db80
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 @@ -864,6 +864,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 d16db80

Please sign in to comment.