This introduces a new "ptrauth" operand bundle to be used in call/invoke. At the IR level, it's semantically equivalent to an @llvm.ptrauth.auth followed by an indirect call, but it additionally provides additional hardening, by preventing the intermediate raw pointer from being exposed. This mostly adds the IR definition, verifier checks, and support in a couple of general helper functions. Clang IRGen and backend support will come separately. Note that we'll eventually want to support this bundle in indirectbr as well, for similar reasons. indirectbr currently doesn't support bundles at all, and the IR data structures need to be updated to allow that. Differential Revision: https://reviews.llvm.org/D113685
11 lines
347 B
LLVM
11 lines
347 B
LLVM
; RUN: opt < %s -tailcallelim -verify-dom-info -S | FileCheck %s
|
|
; Check that the "ptrauth" operand bundle doesn't prevent tail calls.
|
|
|
|
define i64 @f_1(i64 %x, i64(i64)* %f_0) {
|
|
; CHECK-LABEL: @f_1(
|
|
entry:
|
|
; CHECK: tail call i64 %f_0(i64 %x) [ "ptrauth"(i32 42, i64 %x) ]
|
|
%tmp = call i64 %f_0(i64 %x) [ "ptrauth"(i32 42, i64 %x) ]
|
|
ret i64 0
|
|
}
|