[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-02-27 Thread Oren Ben Simhon via Phabricator via cfe-commits
oren_ben_simhon updated this revision to Diff 136235. oren_ben_simhon added a comment. Implemented commented posted by Aaron (Thanks) Repository: rL LLVM https://reviews.llvm.org/D41880 Files: include/clang/AST/Type.h include/clang/Basic/Attr.td include/clang/Basic/AttrDocs.td includ

[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-02-27 Thread Oren Ben Simhon via Phabricator via cfe-commits
oren_ben_simhon updated this revision to Diff 136053. oren_ben_simhon added a comment. Implemented comments posted until 02/27 (Thanks Aaron and Erich) Repository: rL LLVM https://reviews.llvm.org/D41880 Files: include/clang/AST/Type.h include/clang/Basic/Attr.td include/clang/Basic/At

[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-02-27 Thread Oren Ben Simhon via Phabricator via cfe-commits
oren_ben_simhon marked 3 inline comments as done. oren_ben_simhon added inline comments. Comment at: lib/Sema/SemaDeclAttr.cpp:1979-1980 +static void handleNoCfCheckAttr(Sema &S, Decl *D, const AttributeList &Attrs) { + if (!S.getLangOpts().CFProtectionBranch) +S.Diag(Attrs.

[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-02-26 Thread Oren Ben Simhon via Phabricator via cfe-commits
oren_ben_simhon updated this revision to Diff 135908. oren_ben_simhon added a comment. Implemented comments posted until 02/26 (Thanks Aaron) Repository: rL LLVM https://reviews.llvm.org/D41880 Files: include/clang/AST/Type.h include/clang/Basic/Attr.td include/clang/Basic/AttrDocs.td

[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-02-26 Thread Oren Ben Simhon via Phabricator via cfe-commits
oren_ben_simhon marked 7 inline comments as done. oren_ben_simhon added inline comments. Comment at: include/clang/CodeGen/CGFunctionInfo.h:519 + /// Whether this function has nocf_check attribute. + unsigned NoCfCheck : 1; + aaron.ballman wrote: > This is unfo

[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-02-22 Thread Oren Ben Simhon via Phabricator via cfe-commits
oren_ben_simhon marked 2 inline comments as done. oren_ben_simhon added a comment. I added a comment ignoring nocf_check attribute in case -fcf-protection is not set. Now LLVM is identical to GCC. Comment at: test/Sema/attr-nocf_check.c:18-20 + FuncPointerWithNoCfCheck fNoCfC

[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-02-22 Thread Oren Ben Simhon via Phabricator via cfe-commits
oren_ben_simhon updated this revision to Diff 135386. oren_ben_simhon added a comment. Implemented comments posted until 02/22 (Thanks Aaron). Repository: rL LLVM https://reviews.llvm.org/D41880 Files: include/clang/AST/Type.h include/clang/Basic/Attr.td include/clang/Basic/AttrDocs.td

[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-02-15 Thread Oren Ben Simhon via Phabricator via cfe-commits
oren_ben_simhon marked an inline comment as done. oren_ben_simhon added inline comments. Comment at: test/Sema/attr-nocf_check.c:18-20 + FuncPointerWithNoCfCheck fNoCfCheck = f; // no-warning + (*fNoCfCheck)(); // no-warning + f = fNoCfCheck;

[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-02-15 Thread Oren Ben Simhon via Phabricator via cfe-commits
oren_ben_simhon marked an inline comment as done. oren_ben_simhon added inline comments. Comment at: lib/Sema/SemaDeclAttr.cpp:1990 -bool Sema::CheckNoReturnAttr(const AttributeList &Attrs) { - if (!checkAttributeNumArgs(*this, Attrs, 0)) { -Attrs.setInvalid(); +static voi

[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-02-15 Thread Oren Ben Simhon via Phabricator via cfe-commits
oren_ben_simhon updated this revision to Diff 134407. oren_ben_simhon added a comment. Implemented comments posted until 02/15 (Thanks Aaron) Repository: rL LLVM https://reviews.llvm.org/D41880 Files: include/clang/AST/Type.h include/clang/Basic/Attr.td include/clang/Basic/AttrDocs.td

[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-02-15 Thread Oren Ben Simhon via Phabricator via cfe-commits
oren_ben_simhon marked 5 inline comments as done. oren_ben_simhon added inline comments. Comment at: lib/Sema/SemaDeclAttr.cpp:1990 -bool Sema::CheckNoReturnAttr(const AttributeList &Attrs) { - if (!checkAttributeNumArgs(*this, Attrs, 0)) { -Attrs.setInvalid(); +static voi

[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-02-14 Thread Oren Ben Simhon via Phabricator via cfe-commits
oren_ben_simhon updated this revision to Diff 134175. oren_ben_simhon added a comment. Implemented comments posted until 2/14 (Thanks Aaron and Craig) Repository: rL LLVM https://reviews.llvm.org/D41880 Files: include/clang/AST/Type.h include/clang/Basic/Attr.td include/clang/Basic/Att

[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-02-14 Thread Oren Ben Simhon via Phabricator via cfe-commits
oren_ben_simhon marked 6 inline comments as done. oren_ben_simhon added inline comments. Comment at: include/clang/Basic/Attr.td:2089 +def AnyX86NoCfCheck : InheritableAttr, TargetSpecificAttr{ + let Spellings = [GCC<"nocf_check">]; + let Documentation = [AnyX86NoCfCheckDocs];

[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-02-13 Thread Oren Ben Simhon via Phabricator via cfe-commits
oren_ben_simhon added a comment. ping Repository: rL LLVM https://reviews.llvm.org/D41880 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-01-09 Thread Oren Ben Simhon via Phabricator via cfe-commits
oren_ben_simhon created this revision. oren_ben_simhon added reviewers: erichkeane, craig.topper, AndreiGrischenko, aaboud. Herald added subscribers: llvm-commits, javed.absar. The patch adds nocf_check target independent attribute for disabling checks that were enabled by cf-protection flag. Th

[PATCH] D40478: Added control flow architecture protection Flag

2018-01-09 Thread Oren Ben Simhon via Phabricator via cfe-commits
oren_ben_simhon marked an inline comment as done. oren_ben_simhon added inline comments. Comment at: test/CodeGen/x86-cf-protection.c:1 +// RUN: not %clang_cc1 -fsyntax-only -S -emit-llvm -triple i386-unknown-unknown -fcf-protection=return %s 2>&1 | FileCheck %s --check-prefix=

[PATCH] D40478: Added control flow architecture protection Flag

2018-01-09 Thread Oren Ben Simhon via Phabricator via cfe-commits
oren_ben_simhon added inline comments. Comment at: test/CodeGen/x86-cf-protection.c:1 +// RUN: not %clang_cc1 -fsyntax-only -S -emit-llvm -triple i386-unknown-unknown -fcf-protection=return %s 2>&1 | FileCheck %s --check-prefix=RETURN +// RUN: not %clang_cc1 -fsyntax-only -S -e

[PATCH] D40478: Added control flow architecture protection Flag

2018-01-04 Thread Oren Ben Simhon via Phabricator via cfe-commits
oren_ben_simhon updated this revision to Diff 128601. oren_ben_simhon added a comment. Implemented comments posted until 01/04 (Thanks Craig) Repository: rL LLVM https://reviews.llvm.org/D40478 Files: include/clang/Basic/DiagnosticCommonKinds.td include/clang/Basic/TargetInfo.h include

[PATCH] D40478: Added control flow architecture protection Flag

2017-12-25 Thread Oren Ben Simhon via Phabricator via cfe-commits
oren_ben_simhon updated this revision to Diff 128143. oren_ben_simhon added a comment. Reverted clang-format whitespaces updates Repository: rL LLVM https://reviews.llvm.org/D40478 Files: include/clang/Basic/DiagnosticCommonKinds.td include/clang/Basic/TargetInfo.h include/clang/Driver

[PATCH] D40478: Added control flow architecture protection Flag

2017-12-25 Thread Oren Ben Simhon via Phabricator via cfe-commits
oren_ben_simhon updated this revision to Diff 128141. oren_ben_simhon added a comment. Implemented comments posted until 12/24 (Thanks Craig) Moved cf-protection attributes from function attributes to module attributes. Repository: rL LLVM https://reviews.llvm.org/D40478 Files: include/cla

[PATCH] D40478: Added control flow architecture protection Flag

2017-12-25 Thread Oren Ben Simhon via Phabricator via cfe-commits
oren_ben_simhon added a comment. In https://reviews.llvm.org/D40478#962348, @craig.topper wrote: > Are we sure we want a different command line option name from gcc? From our > internal conversations with the gcc folks I thought they were suggesting that > -fcf-protection could imply a software

[PATCH] D40478: Added control flow architecture protection Flag

2017-12-21 Thread Oren Ben Simhon via Phabricator via cfe-commits
oren_ben_simhon added a comment. ping Repository: rL LLVM https://reviews.llvm.org/D40478 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D40478: Added control flow architecture protection Flag

2017-12-19 Thread Oren Ben Simhon via Phabricator via cfe-commits
oren_ben_simhon updated this revision to Diff 127590. oren_ben_simhon added a reviewer: pcc. oren_ben_simhon added a comment. Implemented comments posted until 12/19 (Thanks Craig) Repository: rL LLVM https://reviews.llvm.org/D40478 Files: include/clang/Driver/Options.td include/clang/Fr

[PATCH] D40478: Added control flow architecture protection Flag

2017-12-19 Thread Oren Ben Simhon via Phabricator via cfe-commits
oren_ben_simhon marked an inline comment as done. oren_ben_simhon added inline comments. Comment at: lib/CodeGen/CodeGenFunction.cpp:876 // Apply xray attributes to the function (as a string, for now) - if (D && ShouldXRayInstrumentFunction()) { + bool InstrumentXray = Shoul

[PATCH] D40478: Added control flow architecture protection Flag

2017-12-17 Thread Oren Ben Simhon via Phabricator via cfe-commits
oren_ben_simhon added a comment. -mibt is currently in discussions with other compilers, any change will be uploaded to a different review. If you have more comments i will appreciate it. Repository: rL LLVM https://reviews.llvm.org/D40478 ___ c

[PATCH] D40478: Added Instrument Control Flow Flag

2017-12-14 Thread Oren Ben Simhon via Phabricator via cfe-commits
oren_ben_simhon updated this revision to Diff 127008. oren_ben_simhon added a comment. Implemented all comments posted until 12/14 (Thanks Peter) Repository: rL LLVM https://reviews.llvm.org/D40478 Files: include/clang/Driver/Options.td include/clang/Frontend/CodeGenOptions.def lib/Cod

[PATCH] D40224: [X86] Control-Flow Enforcement Technology - Shadow Stack and Indirect Branch Tracking support (Clang side)

2017-11-22 Thread Oren Ben Simhon via Phabricator via cfe-commits
oren_ben_simhon updated this revision to Diff 123937. oren_ben_simhon added a comment. Implemented comments posted until 11/21 (Thanks Craig) Repository: rL LLVM https://reviews.llvm.org/D40224 Files: include/clang/Basic/BuiltinsX86.def include/clang/Basic/BuiltinsX86_64.def include/cl

[PATCH] D40224: [X86] Control-Flow Enforcement Technology - Shadow Stack and Indirect Branch Tracking support (Clang side)

2017-11-21 Thread Oren Ben Simhon via Phabricator via cfe-commits
oren_ben_simhon updated this revision to Diff 123835. oren_ben_simhon marked an inline comment as done. oren_ben_simhon added a comment. Implemented comments posted until 11/20 (Thanks Craig and Erich). Repository: rL LLVM https://reviews.llvm.org/D40224 Files: include/clang/Basic/Builtins

[PATCH] D40224: [X86] Control-Flow Enforcement Technology - Shadow Stack and Indirect Branch Tracking support (Clang side)

2017-11-21 Thread Oren Ben Simhon via Phabricator via cfe-commits
oren_ben_simhon marked 8 inline comments as done. oren_ben_simhon added inline comments. Comment at: include/clang/Driver/Options.td:1801 def mno_stackrealign : Flag<["-"], "mno-stackrealign">, Group; +def mno_cet : Flag<["-"], "mno-cet">, Group; +def mno_shstk : Flag<["-"], "mn

[PATCH] D33170: [X86] Adding avx512_vpopcntdq feature set and its intrinsics

2017-05-21 Thread Oren Ben Simhon via Phabricator via cfe-commits
oren_ben_simhon added inline comments. Comment at: lib/CodeGen/CGBuiltin.cpp:7526 +llvm::Type *ResultType = ConvertType(E->getType()); +llvm::Function *F = CGM.getIntrinsic(Intrinsic::ctpop, ResultType); +return Builder.CreateCall(F, Ops); oren_ben_si

[PATCH] D33170: [X86] Adding avx512_vpopcntdq feature set and its intrinsics

2017-05-21 Thread Oren Ben Simhon via Phabricator via cfe-commits
oren_ben_simhon added inline comments. Comment at: lib/CodeGen/CGBuiltin.cpp:7527 +Value *X = EmitScalarExpr(E->getArg(0)); +llvm::Function *F = CGM.getIntrinsic(Intrinsic::ctpop, ResultType); +return Builder.CreateCall(F, X); craig.topper wrote: > I

[PATCH] D33170: [X86] Adding avx512_vpopcntdq feature set and its intrinsics

2017-05-21 Thread Oren Ben Simhon via Phabricator via cfe-commits
oren_ben_simhon updated this revision to Diff 99685. oren_ben_simhon marked an inline comment as done. oren_ben_simhon added a comment. Implemented comments posted until 05/20 (Thanks Craig) Repository: rL LLVM https://reviews.llvm.org/D33170 Files: include/clang/Basic/BuiltinsX86.def in

[PATCH] D33170: [X86] Adding avx512_vpopcntdq feature set and its intrinsics

2017-05-17 Thread Oren Ben Simhon via Phabricator via cfe-commits
oren_ben_simhon added inline comments. Comment at: lib/CodeGen/CGBuiltin.cpp:7526 +llvm::Type *ResultType = ConvertType(E->getType()); +Value *X = EmitScalarExpr(E->getArg(0)); +llvm::Function *F = CGM.getIntrinsic(Intrinsic::ctpop, ResultType); craig

[PATCH] D33170: [X86] Adding avx512_vpopcntdq feature set and its intrinsics

2017-05-17 Thread Oren Ben Simhon via Phabricator via cfe-commits
oren_ben_simhon updated this revision to Diff 99276. oren_ben_simhon marked an inline comment as done. oren_ben_simhon added a comment. Implemented comments posted until 05/16 (Thanks Craig) Repository: rL LLVM https://reviews.llvm.org/D33170 Files: include/clang/Basic/BuiltinsX86.def in