llvm-6502/test/Transforms
Benjamin Kramer 1db071f0da Teach instcombine to transform
(X >s -1) ? C1 : C2 and (X <s  0) ? C2 : C1
into ((X >>s 31) & (C2 - C1)) + C1, avoiding the conditional.

This optimization could be extended to take non-const C1 and C2 but we better
stay conservative to avoid code size bloat for now.

for
int sel(int n) {
     return n >= 0 ? 60 : 100;
}

we now generate
  sarl  $31, %edi
  andl  $40, %edi
  leal  60(%rdi), %eax

instead of
  testl %edi, %edi
  movl  $60, %ecx
  movl  $100, %eax
  cmovnsl %ecx, %eax


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107866 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-08 11:39:10 +00:00
..
ABCD Revert my previous patch to ABCD and fix things the right way. There are two problems addressed 2009-11-09 00:44:44 +00:00
ADCE Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
ArgumentPromotion Fix rdar://7879828 - crash in CallGraph, a self host issue. 2010-04-20 00:46:50 +00:00
BlockPlacement Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
BranchFolding Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
CodeExtractor Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
CodeGenPrepare Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
ConstantMerge 1. modernize the constantmerge pass, using densemap/smallvector. 2010-02-12 18:17:23 +00:00
ConstProp fix PR6197 - infinite recursion in ipsccp due to block addresses 2010-02-01 19:35:08 +00:00
DeadArgElim Preserve debug info attached with call instruction while eliminating dead argument. 2010-04-30 20:23:54 +00:00
DeadStoreElimination add newlines at the end of files. 2010-04-07 22:53:17 +00:00
FunctionAttrs Fix a README item: have functionattrs look through selects and 2010-01-06 15:37:47 +00:00
GlobalDCE Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
GlobalOpt Use llvm.foo as the intrinsic, rather than llvm.dbg.value. Since the 2010-05-04 20:09:25 +00:00
GVN Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
IndVarSimplify Fix ScalarEvolution's tripcount computation for chains of loops 2010-06-29 23:43:06 +00:00
Inline Fix PR7272: when inlining through a callsite with byval arguments, 2010-05-31 21:00:26 +00:00
InstCombine Teach instcombine to transform 2010-07-08 11:39:10 +00:00
Internalize Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
IPConstantProp Delete useless trailing semicolons. 2010-01-05 17:55:26 +00:00
JumpThreading jump threading can't split a critical edge from an indirectbr. This 2010-06-14 19:45:43 +00:00
LCSSA Make isLCSSA ignore uses in blocks not reachable from the entry block, 2010-03-09 01:53:33 +00:00
LICM Remove dead debug info intrinsics. 2010-01-05 01:10:40 +00:00
LoopDeletion Make LoopSimplify change conditional branches in loop exiting blocks 2010-02-25 06:57:05 +00:00
LoopIndexSplit Check for side effects before splitting loop. 2010-05-03 18:06:58 +00:00
LoopRotate Fix some tests that didn't test anything. 2010-06-26 20:05:06 +00:00
LoopSimplify Make Loop::getLoopLatch() work on loops which don't have preheaders, as 2009-11-20 20:51:18 +00:00
LoopStrengthReduce When determining a canonical insert position, don't climb deeper 2010-04-09 22:07:05 +00:00
LoopUnroll Teach getSmallConstantTripMultiple about Shl operators. 2009-11-20 01:09:34 +00:00
LoopUnswitch Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
LowerInvoke Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
LowerSetJmp Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
LowerSwitch Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
Mem2Reg Copy location info for current function argument from dbg.declare if respective store instruction does not have any location info. 2010-06-04 22:27:30 +00:00
MemCpyOpt Reapply address space patch after fixing an issue in MemCopyOptimizer. 2010-04-04 03:10:48 +00:00
MergeFunc Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
PartialSpecialize this test is failing nondeterministically and blaming me, just disable 2010-06-26 22:08:30 +00:00
PruneEH fix some failures my callgraph dump format change broke. 2010-04-23 18:38:40 +00:00
Reassociate fix a nice subtle reassociate bug which would only occur 2010-03-05 07:18:54 +00:00
ScalarRepl Fix the second half of PR7437: scalarrepl wasn't preserving 2010-07-08 00:27:05 +00:00
SCCP fix PR6940: sitofp(undef) folds to 0.0, not undef. 2010-04-26 18:21:23 +00:00
SimplifyCFG Test case for r105914. 2010-06-13 16:16:54 +00:00
SimplifyLibCalls Make sure that simplify libcalls does not replace a call with one calling 2010-06-16 19:34:01 +00:00
Sink Add an LLVM IR version of code sinking. This uses the same simple algorithm 2010-05-07 15:40:13 +00:00
SRETPromotion Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
SSI Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
StripSymbols Prevent test from hanging waiting for input. 2010-07-01 22:57:11 +00:00
TailCallElim Fix PR7328: when turning a tail recursion into a loop, need to preserve 2010-06-26 12:53:31 +00:00
TailDup Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00