1
をインライン化しません。 #0 がalwaysinline言葉が含まれている属性:LLVMオプト-always-インラインパスは、私が(読める人間)LLVMのビットコードファイルInput.ll内部SyS_sendtoの以下の関数定義を持って
attributes #0 = { alwaysinline noredzone nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
はオプトパスで をインライン化する必要があることをSyS_sendtoへの呼び出しがありInput.llで
どこか-alwaysは、インライン:
; Function Attrs: noredzone nounwind
define i64 @GO(i64 %fd, i64 %buff, i64 %len, i64 %flags) #0 {
%1 = trunc i64 %fd to i32
%2 = inttoptr i64 %buff to i8*
%3 = trunc i64 %flags to i32
%4 = tail call i64 bitcast
(i64 (i64, i64, i64, i64, i64, i64)*
@SyS_sendto to i64
(i32, i8*, i64, i32, %struct.sockaddr*, i32)*)
(i32 %1,
i8* %2,
i64 %len,
i32 %3,
%struct.sockaddr* null,
i32 0) #0
ret i64 %4
}
私が実行します。
llvm-as -o=Input.bc Input.ll
opt -always-inline Input.bc -o InlinedInput.bc
llvm-dis -o=InlinedInput.ll InlinedInput.bc
しかし、GOはは変更されていない、と私はInputInlined.llでSyS_sendtoへの呼び出しを参照してくださいあまりにも...それはがインライン化されませんでした。
; Function Attrs: noredzone nounwind
define i64 @GO(i64 %fd, i64 %buff, i64 %len, i64 %flags) #0 {
%1 = trunc i64 %fd to i32
%2 = inttoptr i64 %buff to i8*
%3 = trunc i64 %flags to i32
%4 = tail call i64 bitcast
(i64 (i64, i64, i64, i64, i64, i64)*
@SyS_sendto to i64
(i32, i8*, i64, i32, %struct.sockaddr*, i32)*)
(i32 %1,
i8* %2,
i64 %len,
i32 %3,
%struct.sockaddr* null,
i32 0) #0
ret i64 %4
}
ご協力いただきありがとうございます。ありがとう!