1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00
llvm-mirror/include/llvm/IR
Nick Desaulniers e95a065d26 [IR] add fn attr for no_stack_protector; prevent inlining on mismatch
It's currently ambiguous in IR whether the source language explicitly
did not want a stack a stack protector (in C, via function attribute
no_stack_protector) or doesn't care for any given function.

It's common for code that manipulates the stack via inline assembly or
that has to set up its own stack canary (such as the Linux kernel) would
like to avoid stack protectors in certain functions. In this case, we've
been bitten by numerous bugs where a callee with a stack protector is
inlined into an __attribute__((__no_stack_protector__)) caller, which
generally breaks the caller's assumptions about not having a stack
protector. LTO exacerbates the issue.

While developers can avoid this by putting all no_stack_protector
functions in one translation unit together and compiling those with
-fno-stack-protector, it's generally not very ergonomic or as
ergonomic as a function attribute, and still doesn't work for LTO. See also:
https://lore.kernel.org/linux-pm/20200915172658.1432732-1-rkir@google.com/
https://lore.kernel.org/lkml/20200918201436.2932360-30-samitolvanen@google.com/T/#u

Typically, when inlining a callee into a caller, the caller will be
upgraded in its level of stack protection (see adjustCallerSSPLevel()).
By adding an explicit attribute in the IR when the function attribute is
used in the source language, we can now identify such cases and prevent
inlining.  Block inlining when the callee and caller differ in the case that one
contains `nossp` when the other has `ssp`, `sspstrong`, or `sspreq`.

Fixes pr/47479.

Reviewed By: void

Differential Revision: https://reviews.llvm.org/D87956
2020-10-23 11:55:39 -07:00
..
AbstractCallSite.h
Argument.h OpaquePtr: Add helpers for sret to mirror byval 2020-09-24 09:57:28 -04:00
AssemblyAnnotationWriter.h
Attributes.h Reapply "OpaquePtr: Add type to sret attribute" 2020-10-16 11:05:02 -04:00
Attributes.td [IR] add fn attr for no_stack_protector; prevent inlining on mismatch 2020-10-23 11:55:39 -07:00
AutoUpgrade.h
BasicBlock.h
CallingConv.h
CFG.h Introduce CfgTraits abstraction 2020-10-20 13:50:52 +02:00
CMakeLists.txt
Comdat.h
Constant.h [InstCombine] visitTrunc - pass through undefs for trunc(shift(trunc/ext(x),c)) patterns 2020-10-13 14:35:18 +01:00
ConstantFolder.h
ConstantRange.h [ConstantRange] Introduce getMinSignedBits() method 2020-09-22 21:37:30 +03:00
Constants.h [InstCombine] Remove accidental unnecessary ConstantExpr qualification added in rGb752daa26b64155 2020-10-11 10:39:51 +01:00
ConstrainedOps.def
DataLayout.h [SVE] Make ElementCount members private 2020-08-28 14:43:53 +01:00
DebugInfo.h
DebugInfoFlags.def
DebugInfoMetadata.h [DebugInfo] Support for DWARF attribute DW_AT_rank 2020-10-10 17:51:12 +05:30
DebugLoc.h
DerivedTypes.h [SVE] Replace / operator in TypeSize/ElementCount with divideCoefficientBy 2020-09-28 08:03:00 +01:00
DerivedUser.h
DiagnosticHandler.h
DiagnosticInfo.h [llvm][LV] Replace unsigned VF with ElementCount VF [NFCI] 2020-08-24 13:54:03 +00:00
DiagnosticPrinter.h
DIBuilder.h [DebugInfo][flang]Added support for representing Fortran assumed length strings 2020-08-22 10:13:40 +05:30
Dominators.h [DomTree] Accept Value as Def (NFC) 2020-10-22 18:32:03 +02:00
FixedMetadataKinds.def Add support for !noundef metatdata on loads 2020-10-17 13:50:10 +09:00
FixedPointBuilder.h [IR] Add FixedPointBuilder. 2020-08-20 10:29:57 +02:00
FPEnv.h
Function.h [IR] Adds mustprogress as a LLVM IR attribute 2020-10-20 03:09:57 -04:00
GetElementPtrTypeIterator.h [SVE] Remove calls to VectorType::getNumElements from IR 2020-08-27 11:16:10 -07:00
GlobalAlias.h
GlobalIFunc.h
GlobalIndirectSymbol.h
GlobalObject.h [IR] Merge metadata manipulation code into Value 2020-10-23 11:08:26 +07:00
GlobalValue.h
GlobalVariable.h
GVMaterializer.h
InlineAsm.h
InstIterator.h
InstrTypes.h Add validity assert on entry to CastInst::isNoopCast [NFC] 2020-10-07 14:05:45 -07:00
Instruction.def
Instruction.h [IR] Merge metadata manipulation code into Value 2020-10-23 11:08:26 +07:00
Instructions.h [SVE] Make ElementCount members private 2020-08-28 14:43:53 +01:00
InstVisitor.h
IntrinsicInst.h [IR][GVN] add/allow commutative intrinsics with >2 args 2020-09-03 10:14:53 -04:00
Intrinsics.h Fix build failure caused by c5ba0d33cc060cc06a28a5d9101060afd1c0ee9a 2020-10-12 09:05:39 +01:00
Intrinsics.td [IR] Make nosync, nofree and willreturn default for intrinsics. 2020-10-20 11:57:19 +02:00
IntrinsicsAArch64.td [MTE] Pin the tagged base pointer to one of the stack slots. 2020-10-15 12:50:16 -07:00
IntrinsicsAMDGPU.td [AMDGPU] Add new llvm.amdgcn.fma.legacy intrinsic 2020-10-16 17:10:21 +01:00
IntrinsicsARM.td [ARM][BFloat16] Change types of some Arm and AArch64 bf16 intrinsics 2020-08-27 18:43:16 +01:00
IntrinsicsBPF.td BPF: move AbstractMemberAccess and PreserveDIType passes to EP_EarlyAsPossible 2020-09-28 16:56:22 -07:00
IntrinsicsHexagon.td
IntrinsicsHexagonDep.td
IntrinsicsMips.td
IntrinsicsNVVM.td
IntrinsicsPowerPC.td [PowerPC] Add intrinsics for MMA 2020-10-23 13:16:02 -05:00
IntrinsicsRISCV.td
IntrinsicsSystemZ.td
IntrinsicsWebAssembly.td [WebAssembly] Prototype i8x16.popcnt 2020-10-15 21:18:22 +00:00
IntrinsicsX86.td [X86] Add User Interrupts(UINTR) instructions 2020-10-22 17:33:07 +08:00
IntrinsicsXCore.td
IRBuilder.h [RS4GC] NFC. Preparatory refactoring to make GC parseable memcpy 2020-10-21 12:38:20 -07:00
IRBuilderFolder.h
IRPrintingPasses.h [NewPM][optnone] Mark various passes as required 2020-08-14 15:51:59 -07:00
LegacyPassManager.h
LegacyPassManagers.h Remove unnecessary forward declarations. NFCI. 2020-09-17 13:31:52 +01:00
LegacyPassNameParser.h
LLVMContext.h
LLVMRemarkStreamer.h
Mangler.h
MatrixBuilder.h [SVE] Remove calls to VectorType::getNumElements from IR 2020-08-27 11:16:10 -07:00
MDBuilder.h
Metadata.def [DebugInfo][flang]Added support for representing Fortran assumed length strings 2020-08-22 10:13:40 +05:30
Metadata.h
Module.h
ModuleSlotTracker.h
ModuleSummaryIndex.h Fix some clang-tidy bugprone-argument-comment issues 2020-09-19 20:41:25 -07:00
ModuleSummaryIndexYAML.h
NoFolder.h
OperandTraits.h
Operator.h
OptBisect.h
PassInstrumentation.h [NewPM][PassInstrumentation] Add PreservedAnalyses parameter to AfterPass* callbacks 2020-08-21 16:10:42 +07:00
PassManager.h [NewPM] collapsing nested pass mangers of the same type 2020-10-04 15:57:13 -07:00
PassManagerImpl.h [NewPM] Don't print 'Invalidating all non-preserved analyses' 2020-07-30 19:40:29 -07:00
PassManagerInternal.h [NewPM] Allow passes to never be skipped 2020-07-18 22:28:46 -07:00
PassTimingInfo.h [NewPM][PassInstrument] Make PrintIR and TimePasses to use before-pass-run callback 2020-07-29 08:26:36 -07:00
PatternMatch.h [AMDGPU] Add simplification/combines for llvm.amdgcn.fmul.legacy 2020-10-23 09:31:00 +01:00
PredIteratorCache.h
ProfileSummary.h
RuntimeLibcalls.def [NFCI] Remove unnecessary trailing undef in RuntimeLibcalls.def 2020-10-04 15:57:13 -07:00
SafepointIRVerifier.h
Statepoint.h [Statepoint] Remove code related to inline operand bundles 2020-08-14 20:29:41 -07:00
StructuralHash.h (Expensive) Check for Loop, SCC and Region pass return status 2020-08-28 07:56:35 +02:00
SymbolTableListTraits.h
TrackingMDRef.h
Type.h [IR] Add Type::getFloatingPointTy. 2020-10-09 10:27:41 +02:00
TypeFinder.h
Use.h
UseListOrder.h
User.h
Value.def
Value.h [IR] Merge metadata manipulation code into Value 2020-10-23 11:08:26 +07:00
ValueHandle.h
ValueMap.h
ValueSymbolTable.h
Verifier.h [NewPM][optnone] Mark various passes as required 2020-08-14 15:51:59 -07:00
VPIntrinsics.def