llvm-6502/test/Transforms
Evan Cheng de62192843 Throttle back "fold select into operand" transformation. InstCombine should not generate selects of two constants unless they are selects of 0 and 1.
e.g.
define i32 @t1(i32 %c, i32 %x) nounwind {
       %t1 = icmp eq i32 %c, 0
       %t2 = lshr i32 %x, 18
       %t3 = select i1 %t1, i32 %t2, i32 %x
       ret i32 %t3
}

was turned into

define i32 @t2(i32 %c, i32 %x) nounwind {
       %t1 = icmp eq i32 %c, 0
       %t2 = select i1 %t1, i32 18, i32 0
       %t3 = lshr i32 %x, %t2
       ret i32 %t3
}

For most targets, that means materializing two constants and then a select. e.g. On x86-64

movl    %esi, %eax
shrl    $18, %eax
testl   %edi, %edi
cmovne  %esi, %eax
ret

=>

xorl    %eax, %eax
testl   %edi, %edi
movl    $18, %ecx
cmovne  %eax, %ecx
movl    %esi, %eax
shrl    %cl, %eax
ret

Also, the optimizer and codegen can reason about shl / and / add, etc. by a constant. This optimization will hinder optimizations using ComputeMaskedBits.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68142 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-31 20:42:45 +00:00
..
ADCE
ArgumentPromotion
BlockPlacement
BranchFolding
CodeExtractor
CodeGenPrepare
CondProp Ignore dbg intrinsics while propagating conditional expression info. Take 2. 2009-02-05 23:32:52 +00:00
ConstantMerge
ConstProp
DeadArgElim aha, DAE does have to think about PHI nodes. Many thanks to "Dr Evil" (aka Duncan) 2009-03-18 16:48:45 +00:00
DeadStoreElimination
FunctionAttrs
GlobalDCE If an alias is dead and so is its aliasee, then globaldce would 2009-02-17 23:05:26 +00:00
GlobalOpt Ignore debug info while evaluating function. 2009-03-09 23:04:12 +00:00
GVN Do not attempt to do parial redundancy elimination on void values. 2009-03-10 15:04:53 +00:00
GVNPRE
IndMemRem
IndVarSimplify Back out the change in 64918 that used sign-extensions when promoting 2009-02-23 23:20:35 +00:00
Inline If a function is marked alwaysinline, it must be inlined (possibly for correctness). Do so even if the callee has dynamic alloca and the caller doesn't. 2009-03-10 07:57:50 +00:00
InstCombine Throttle back "fold select into operand" transformation. InstCombine should not generate selects of two constants unless they are selects of 0 and 1. 2009-03-31 20:42:45 +00:00
Internalize
IPConstantProp
JumpThreading
LCSSA
LICM Before deleting a basic block, give other loop passes a chance cleanup analysis values, related to the instructions in the basic block. 2009-03-25 23:57:48 +00:00
LoopDeletion
LoopIndexSplit Loop Index Split can eliminate a loop if it can determin if loop body is executed only once. There was a bug in determining IV based value of the iteration for which the loop body is executed. Fix it. 2009-03-30 22:24:10 +00:00
LoopRotate
LoopSimplify
LoopStrengthReduce Implement "superhero" strength reduction, or full strength 2009-02-20 04:17:46 +00:00
LoopUnroll remove a test that depends on -debug. 2009-03-13 20:31:48 +00:00
LoopUnswitch
LowerInvoke
LowerSetJmp
LowerSwitch
Mem2Reg
MemCpyOpt
MergeFunc
PredicateSimplifier
PruneEH
RaiseAllocations
Reassociate
ScalarRepl Fix a bug. 2009-03-18 07:56:13 +00:00
SCCP adjust for asmprinter change. 2009-03-01 00:25:46 +00:00
SimplifyCFG While hoisting instruction to speculatively execute simple bb, ignore dbg intrinsics. 2009-03-06 06:00:17 +00:00
SimplifyLibCalls Mark strto* as readonly when the endptr is null. 2009-02-13 17:08:33 +00:00
SRETPromotion
StripSymbols
TailCallElim
TailDup