llvm-6502/test/Transforms
Benjamin Kramer 7d6eb5a018 InstCombine: Turn (zext A) udiv (zext B) into (zext (A udiv B)). Same for urem or constant B.
This obviously helps a lot if the division would be turned into a libcall
(think i64 udiv on i386), but div is also one of the few remaining instructions
on modern CPUs that become more expensive when the bitwidth gets bigger.

This also helps register pressure on i386 when dividing chars, divb needs
two 8-bit parts of a 16 bit register as input where divl uses two registers.

int foo(unsigned char a) { return a/10; }
int bar(unsigned char a, unsigned char b) { return a/b; }

compiles into (x86_64)
_foo:
  imull $205, %edi, %eax
  shrl  $11, %eax
  ret
_bar:
  movzbl        %dil, %eax
  divb  %sil, %al
  movzbl        %al, %eax
  ret

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130615 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-30 18:16:07 +00:00
..
ADCE
ArgumentPromotion
BlockPlacement
BranchFolding
CodeExtractor
CodeGenPrepare
ConstantMerge
ConstProp Fix a ton of comment typos found by codespell. Patch by 2011-04-15 05:18:47 +00:00
CorrelatedValuePropagation
DeadArgElim
DeadStoreElimination
EarlyCSE
FunctionAttrs
GlobalDCE
GlobalOpt Add back a couple checks removed by r129128; the fact that an intitializer 2011-04-09 09:11:09 +00:00
GVN final step needed to resolve PR6627, which allows us to flatten the code down to 2011-04-28 18:15:47 +00:00
IndVarSimplify Fixes PR9730: indvars: An asserting value handle still pointed to this value 2011-04-27 23:00:03 +00:00
Inline
InstCombine InstCombine: Turn (zext A) udiv (zext B) into (zext (A udiv B)). Same for urem or constant B. 2011-04-30 18:16:07 +00:00
InstSimplify
Internalize
IPConstantProp
JumpThreading Fix an infinite alternation in JumpThreading where two transforms would repeatedly undo each other. The solution is to perform more aggressive constant folding to make one of the edges just folded away rather than trying to thread it. 2011-04-14 21:35:50 +00:00
LCSSA
LICM PR9604; try to deal with RAUW updates correctly in the AST. I'm not convinced 2011-04-09 06:55:46 +00:00
LoopDeletion
LoopIdiom
LoopRotate fix PR9523, a crash in looprotate on a non-canonical loop made out of indirectbr. 2011-04-09 07:25:58 +00:00
LoopSimplify
LoopStrengthReduce
LoopUnroll
LoopUnswitch
LowerAtomic
LowerInvoke
LowerSetJmp
LowerSwitch
Mem2Reg
MemCpyOpt
MergeFunc
PhaseOrdering final step needed to resolve PR6627, which allows us to flatten the code down to 2011-04-28 18:15:47 +00:00
PruneEH
Reassociate Fix reassociate to use a worklist instead of recursing when new 2011-04-12 00:11:56 +00:00
ScalarRepl make a couple of changes to the standard pass pipeline: 2011-04-26 20:45:33 +00:00
SCCP Fix a ton of comment typos found by codespell. Patch by 2011-04-15 05:18:47 +00:00
SimplifyCFG SimplifyCFG: Expose phi node folding cost threshold as command line parameter 2011-04-29 18:47:38 +00:00
SimplifyLibCalls
Sink
StripSymbols
TailCallElim
TailDup