Skip to content

Missing Functionality in LLVM C #53

Open
@CodaFi

Description

@CodaFi

This is a formatted list of APIs that cannot be wrapped or have been wrapped incorrectly in LLVM-C.
There is necessarily overlap between this and #51.

API

  • Everything in the C API that takes/returns raw C strings without taking/returning a length is wrong.
  • LLVMCallFrameAlignmentOfType is redundant.
  • LLVMThreadLocalMode should be called LLVMThreadLocalModel to match its cases (and the general usage of the term).
  • LLVMGetRelocationValueString should do... something. Returning the empty string is probably not the right behavior.
  • LLVMSetParamAlignment needs a getter
  • LLVMSetInstrParamAlignment needs a getter
  • (LLVMGetCurrentFunction?): A way to query the IRBuilder about the function it is currently building.
  • Support for the sanitizers needs to be moved out of the Go bindings and into the general bindings
  • LLVMAddAlias has a bizarre user model that requires the user pass a PointerType to the type they want just so the C bindings can strip off the pointer and the C++ API can put it back.
  • A wrapper type for defining an optimizer pass entirely in C is sorely needed.

Proposed API

Passes

There are ~140 passes defined by LLVM 4.0. Of those, we and LLVM-C wrap about 50.

  • AggressiveDCE
  • BitTrackingDCE
  • ArgumentPromotion
  • AlignmentFromAssumptions
  • BasicAAWrapper
  • SCEVAAWrapper
  • TypeBasedAAWrapper
  • ScopedNoAliasAAWrapper
  • BreakCriticalEdges
  • CFGSimplification
  • CFLAndersAAWrapper
  • CFLSteensAAWrapper
  • StructurizeCFG
  • ConstantMerge
  • ConstantPropagation
  • DeadArgElimination
  • DeadInstElimination
  • DeadStoreElimination
  • FunctionInlining
  • GlobalDCE
  • GlobalOptimizer
  • GlobalsAAWrapper
  • IPConstantPropagation
  • IPSCCP
  • IndVarSimplify
  • InstructionCombining
  • Internalize
  • LCSSA
  • LICM
  • LoopExtractor
  • LoopInterchange
  • LoopStrengthReduce
  • LoopReroll
  • LoopUnroll
  • LoopUnrollAndJam
  • LoopUnswitch
  • LoopVersioningLICM
  • LoopIdiom
  • LoopRotate
  • LowerExpectIntrinsic
  • LowerSwitch
  • PromoteMemoryToRegister
  • DemoteRegisterToMemory
  • PruneEH
  • Reassociate
  • SROA
  • StripSymbols
  • StripNonDebugSymbols
  • StripDeadDebugInfo
  • StripDeadPrototypes
  • TailCallElimination
  • JumpThreading
  • EarlyCSE
  • GVN
  • NewGVN
  • LoopDeletion
  • InstructionNamer
  • MetaRenamer
  • MergeFunctions
  • CorrelatedValuePropagation
  • LoopVectorize
  • SLPVectorizer
  • BBVectorize
  • PartiallyInlineLibCalls
  • Scalarizer
  • SeparateConstOffsetFromGEP
  • StraightLineStrengthReduce

Function Passes

  • ObjCARCAAWrapper
  • ObjCARCAPElim
  • ObjCARCExpand
  • ObjCARCContract
  • ObjCARCOpt

Legacy Passes

  • BoundsChecking
  • LibCallsShrinkWrap
  • PGOInstrumentationGenLegacy
  • PGOInstrumentationUseLegacy
  • PGOIndirectCallPromotionLegacy
  • InstructionSimplifier
  • NaryReassociate
  • EliminateAvailableExternally
  • LoadStoreVectorizer
  • SpeculativeExecution
  • SpeculativeExecutionIfHasBranchDivergence
  • GVNHoist
  • SCCP
  • Sinking
  • LowerInvoke
  • InductiveRangeCheckElimination
  • MergedLoadStoreMotion
  • LoopSink
  • GuardWidening
  • DeadCodeElimination
  • LoopPredication
  • AlwaysInlinerLegacy
  • InstrProfilingLegacy
  • FunctionImport
  • DivergenceAnalysis
  • ConstantHoisting
  • PostOrderFunctionAttrsLegacy
  • ReversePostOrderFunctionAttrs
  • CostModelAnalysis
  • DependenceAnalysisWrapper
  • Float2Int
  • RewriteSymbols
  • PartialInlining
  • MemCpyOpt
  • CodeGenPrepare

Future Passes

  • UnifyFunctionExitNodes
  • SafeStack
  • LowerAtomic
  • LoopSimplify
  • LoopSimplifyCFG
  • AAEval

Printers/Informative Passes

  • DomOnlyPrinter
  • DomPrinter
  • DomOnlyViewer
  • DomViewer
  • MemDerefPrinter
  • MemDepPrinter
  • PostDomOnlyPrinter
  • PostDomPrinter
  • PostDomOnlyViewer
  • PostDomViewer
  • RegionOnlyPrinter
  • RegionOnlyViewer
  • RegionPrinter
  • RegionViewer
  • Lint
  • ModuleDebugInfoPrinter
  • CallGraphDOTPrinter
  • CallGraphViewer
  • PrintModulePass(os)
  • PrintFunctionPass(os)
  • PrintBasicBlockPass(os)
  • GCOVProfiler
  • RegionInfo
  • SingleLoopExtractor
  • PostDomTree
  • InstCount
  • LazyValueInfo
  • PAEval

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions