[clang] [llvm] [BPF] introduce `__attribute__((bpf_fastcall))` (PR #101228)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 2 11:59:13 PDT 2024
================
@@ -596,6 +600,90 @@ bool BPFMIPreEmitPeephole::adjustBranch() {
return Changed;
}
+static const unsigned CallerSavedRegs[] = {BPF::R0, BPF::R1, BPF::R2,
+ BPF::R3, BPF::R4, BPF::R5};
+
+struct BPFFastCall {
+ MachineInstr *MI;
+ unsigned LiveCallerSavedRegs;
+};
+
+static void collectBPFFastCalls(const TargetRegisterInfo *TRI,
+ LivePhysRegs &LiveRegs, MachineBasicBlock &BB,
+ SmallVectorImpl<BPFFastCall> &Calls) {
+ LiveRegs.init(*TRI);
+ LiveRegs.addLiveOuts(BB);
+ Calls.clear();
+ for (MachineInstr &MI : llvm::reverse(BB)) {
+ unsigned LiveCallerSavedRegs;
+ if (!MI.isCall())
+ goto NextInsn;
+ LiveCallerSavedRegs = 0;
----------------
eddyz87 wrote:
Ok
https://github.com/llvm/llvm-project/pull/101228
More information about the llvm-commits
mailing list