Skip to content

Commit

Permalink
Added missing scalar and ipo transformation passes.
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswailes committed Jun 3, 2011
1 parent 43080be commit 253e11f
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 14 deletions.
21 changes: 18 additions & 3 deletions lib/llvm/bindings.rb
Expand Up @@ -656,31 +656,46 @@ module C
attach_function :LLVMAddTargetData, [:pointer, :pointer], :void

# Inter-procedural Optimizations
attach_function :LLVMAddGlobalDCEPass, [:pointer], :void
attach_function :LLVMAddFunctionAttrsPass, [:pointer], :void
attach_function :LLVMAddFunctionInliningPass, [:pointer], :void
attach_function :LLVMAddGlobalDCEPass, [:pointer], :void
attach_function :LLVMAddIPConstantPropagationPass, [:pointer], :void
attach_function :LLVMAddIPSCCPPass, [:pointer], :void
attach_function :LLVMAddPruneEHPass, [:pointer], :void

# Scalar Optimizations
attach_function :LLVMAddAggressiveDCEPass, [:pointer], :void
attach_function :LLVMAddArgumentPromotionPass, [:pointer], :void
attach_function :LLVMAddCFGSimplificationPass, [:pointer], :void
attach_function :LLVMAddConstantMergePass, [:pointer], :void
attach_function :LLVMAddConstantPropagationPass, [:pointer], :void
attach_function :LLVMAddDeadArgEliminationPass, [:pointer], :void
attach_function :LLVMAddDeadStoreEliminationPass, [:pointer], :void
attach_function :LLVMAddDeadTypeEliminationPass, [:pointer], :void
attach_function :LLVMAddDemoteMemoryToRegisterPass, [:pointer], :void
attach_function :LLVMAddGlobalOptimizerPass, [:pointer], :void
attach_function :LLVMAddGVNPass, [:pointer], :void
attach_function :LLVMAddIndVarSimplifyPass, [:pointer], :void
attach_function :LLVMAddInstructionCombiningPass, [:pointer], :void
attach_function :LLVMAddInternalizePass, [:pointer], :void
attach_function :LLVMAddJumpThreadingPass, [:pointer], :void
attach_function :LLVMAddLICMPass, [:pointer], :void
attach_function :LLVMAddLoopDeletionPass, [:pointer], :void
attach_function :LLVMAddLoopRotatePass, [:pointer], :void
attach_function :LLVMAddLoopUnrollPass, [:pointer], :void
attach_function :LLVMAddLoopUnswitchPass, [:pointer], :void
attach_function :LLVMAddLowerSetJmpPass, [:pointer], :void
attach_function :LLVMAddMemCpyOptPass, [:pointer], :void
attach_function :LLVMAddPromoteMemoryToRegisterPass, [:pointer], :void
attach_function :LLVMAddRaiseAllocationsPass, [:pointer], :void
attach_function :LLVMAddReassociatePass, [:pointer], :void
attach_function :LLVMAddSCCPPass, [:pointer], :void
attach_function :LLVMAddScalarReplAggregatesPass, [:pointer], :void
attach_function :LLVMAddSimplifyLibCallsPass, [:pointer], :void
attach_function :LLVMAddStripDeadPrototypesPass, [:pointer], :void
attach_function :LLVMAddStripSymbolsPass, [:pointer], :void
attach_function :LLVMAddTailCallEliminationPass, [:pointer], :void
attach_function :LLVMAddConstantPropagationPass, [:pointer], :void
attach_function :LLVMAddDemoteMemoryToRegisterPass, [:pointer], :void
attach_function :LLVMAddVerifierPass, [:pointer], :void

# Bitcode
attach_function :LLVMParseBitcode, [:pointer, :buffer_out, :buffer_out], :int
Expand Down
26 changes: 23 additions & 3 deletions lib/llvm/transforms/ipo.rb
Expand Up @@ -4,14 +4,34 @@

module LLVM
class PassManager
# @LLVMpass gdce
def gdce!
C.LLVMAddGlobalDCEPass(self)
# @LLVMpass function_attrs
def fun_attrs!
C.LLVMAddFunctionAttersPass(self)
end

# @LLVMpass inline
def inline!
C.LLVMAddFunctionInliningPass(self)
end

# @LLVMpass gdce
def gdce!
C.LLVMAddGlobalDCEPass(self)
end

# @LLVMpass ipcp
def ipcp!
C.LLVMAddIPConstantPropagationPass(self)
end

# @LLVMpass ipsccp
def ipsccp!
C.LLVMAddIPSCCPPass(self)
end

# @LLVMpass prune_eh
def prune_eh!
C.LLVMAddPruneEHPass(self)
end
end
end
71 changes: 63 additions & 8 deletions lib/llvm/transforms/scalar.rb
Expand Up @@ -8,16 +8,51 @@ def adce!
C.LLVMAddAggressiveDCEPass(self)
end

# @LLVMpass arg_promotion
def arg_promote!
C.LLVMAddArgumentPromotionPass(self)
end

# @LLVMpass simplifycfg
def simplifycfg!
C.LLVMAddCFGSimplificationPass(self)
end

# @LLVMpass const_merge
def const_merge!
C.LLVMAddConstantMergePass(self)
end

# @LLVMpass constprop
def constprop!
C.LLVMAddConstantPropagationPass(self)
end

# @LLVMpass dae
def dae!
C.LLVMAddDeadArgEliminationPass(self)
end

# @LLVMpass dse
def dse!
C.LLVMAddDeadStoreEliminationPass(self)
end

# @LLVMpass dte
def dte!
C.LLVMAddDeadTypeEliminationPass(self)
end

# @LLVMpass reg2mem
def reg2mem!
C.LLVMAddDemoteMemoryToRegisterPass(self)
end

# @LLVMpass global_opt
def global_opt!
C.LLVMAddGlobalOptimizerPass(self)
end

# @LLVMpass gvn
def gvn!
C.LLVMAddGVNPass(self)
Expand All @@ -33,6 +68,11 @@ def instcombine!
C.LLVMAddInstructionCombiningPass(self)
end

# @LLVMpass init
def init!
C.LLVMAddInternalizePass(self)
end

# @LLVMpass jump-threading
def jump_threading!
C.LLVMAddJumpThreadingPass(self)
Expand Down Expand Up @@ -63,6 +103,11 @@ def loop_unswitch!
C.LLVMAddLoopUnswitchPass(self)
end

# @LLVMpass lsj
def lsj!
C.LLVMAddLowerSetJmpPass(self)
end

# @LLVMpass memcpyopt
def memcpyopt!
C.LLVMAddMemCpyOptPass(self)
Expand All @@ -73,6 +118,11 @@ def mem2reg!
C.LLVMAddPromoteMemoryToRegisterPass(self)
end

# @LLVMpass raise_alloc
def raise_alloc!
C.LLVMAddRaiseAllocationsPass(self)
end

# @LLVMpass reassociate
def reassociate!
C.LLVMAddReassociatePass(self)
Expand All @@ -93,19 +143,24 @@ def simplify_libcalls!
C.LLVMAddSimplifyLibCallsPass(self)
end

# @LLVMpass sdp
def sdp!
C.LLVMAddStripDeadPrototypesPass(self)
end

# @LLVMpass sds
def sds!
C.LLVMAddStripSymbolsPass(self)
end

# @LLVMpass tailcallelim
def tailcallelim!
C.LLVMAddTailCallEliminationPass(self)
end

# @LLVMpass constprop
def constprop!
C.LLVMAddConstantPropagationPass(self)
end

# @LLVMpass reg2mem
def reg2mem!
C.LLVMAddDemoteMemoryToRegisterPass(self)
# @LLVMpass verifier
def verifier!
C.LLVMAddVerifierPass(self)
end
end
end

0 comments on commit 253e11f

Please sign in to comment.