LLVMSwift icon indicating copy to clipboard operation
LLVMSwift copied to clipboard

Missing Functionality in LLVM C

Open CodaFi opened this issue 8 years ago • 15 comments

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.

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

CodaFi avatar Jan 26 '17 20:01 CodaFi

https://reviews.llvm.org/D44496

CodaFi avatar Mar 14 '18 22:03 CodaFi

https://reviews.llvm.org/rL323819

CodaFi avatar Mar 14 '18 22:03 CodaFi

https://reviews.llvm.org/D38485

CodaFi avatar Mar 14 '18 22:03 CodaFi

https://reviews.llvm.org/D43448

CodaFi avatar Mar 14 '18 22:03 CodaFi

https://reviews.llvm.org/D45346

CodaFi avatar Apr 06 '18 02:04 CodaFi

https://reviews.llvm.org/D45347

CodaFi avatar Apr 06 '18 02:04 CodaFi

https://reviews.llvm.org/D46808

CodaFi avatar May 13 '18 19:05 CodaFi

https://reviews.llvm.org/D46890

CodaFi avatar May 15 '18 16:05 CodaFi

https://reviews.llvm.org/D52659

CodaFi avatar Sep 28 '18 16:09 CodaFi

https://reviews.llvm.org/D53555

CodaFi avatar Oct 23 '18 04:10 CodaFi

https://reviews.llvm.org/D56177

CodaFi avatar Dec 31 '18 20:12 CodaFi

https://reviews.llvm.org/D56179

CodaFi avatar Dec 31 '18 20:12 CodaFi

https://reviews.llvm.org/D56279

CodaFi avatar Jan 03 '19 18:01 CodaFi

https://reviews.llvm.org/D56280

CodaFi avatar Jan 03 '19 18:01 CodaFi

https://reviews.llvm.org/D59658

CodaFi avatar Mar 21 '19 18:03 CodaFi