Issue |
117618
|
Summary |
Implement inline __security_check_cookie call pass for AArch64 Windows
|
Labels |
clang,
backend:AArch64
|
Assignees |
omjavaid
|
Reporter |
omjavaid
|
The __security_check_cookie function is inserted into functions to protect against stack buffer overflows. However, the function call incurs overhead as it is a runtime library call, even though it often performs a simple comparison and returns.
#95904 implements a pass for x86/Windows that addresses this by inlining the comparison and deferring the library call to a failure path, which reduces overhead in the common case. This issue proposes to implement similar pass for AArch64 that will inline the comparison of the __security_cookie value directly into the function.
I have conducted a SPEC 2017 benchmark run using clang-cl on Windows AArch64 comparing default behavior (/GS, with security checks enabled) with the security check cookie disabled (/GS-). Benchmarks with /GS- (No GS) typically performed slightly better than their /GS counterparts, but the differences are relatively small in most cases. However benchmarks like 511_povray_r and 641_leela_s demonstrate significantly better performance with /GS-, possibly due to the high frequency of stack operations in their workloads.
I am writing a patch for AArch64 Windows and will compare its impact on SPEC 2017 result and will share with audience here.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs