llvm-6502/test
Chris Lattner 61c77449c7 fix a fairly serious oversight with switch formation from
or'd conditions.  Previously we'd compile something like this:

int crud (unsigned char c) {
   return c == 62 || c == 34 || c == 92;
}

into:

  switch i8 %c, label %lor.rhs [
    i8 62, label %lor.end
    i8 34, label %lor.end
  ]

lor.rhs:                                          ; preds = %entry
  %cmp8 = icmp eq i8 %c, 92
  br label %lor.end

lor.end:                                          ; preds = %entry, %entry, %lor.rhs
  %0 = phi i1 [ true, %entry ], [ %cmp8, %lor.rhs ], [ true, %entry ]
  %lor.ext = zext i1 %0 to i32
  ret i32 %lor.ext

which failed to merge the compare-with-92 into the switch.  With this patch
we simplify this all the way to:

  switch i8 %c, label %lor.rhs [
    i8 62, label %lor.end
    i8 34, label %lor.end
    i8 92, label %lor.end
  ]

lor.rhs:                                          ; preds = %entry
  br label %lor.end

lor.end:                                          ; preds = %entry, %entry, %entry, %lor.rhs
  %0 = phi i1 [ true, %entry ], [ false, %lor.rhs ], [ true, %entry ], [ true, %entry ]
  %lor.ext = zext i1 %0 to i32
  ret i32 %lor.ext

which is much better for codegen's switch lowering stuff.  This kicks in 33 times
on 176.gcc (for example) cutting 103 instructions off the generated code.





git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121671 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-13 03:18:54 +00:00
..
Analysis Revert r121520, which may have introduced miscompilations. 2010-12-10 21:48:28 +00:00
Archive Revert test/Archive/check_binary_output.ll". It fails on a buildbot. 2010-12-07 05:57:02 +00:00
Assembler
Bindings/Ocaml
Bitcode
BugPoint
CodeGen Missed some ADDI <-> ADDIK conversions in 121649. 2010-12-12 22:53:14 +00:00
DebugInfo
ExecutionEngine
Feature
FrontendAda
FrontendC
FrontendC++
FrontendFortran
FrontendObjC
FrontendObjC++
Integer
lib
Linker
LLVMC
MC Fixed version of 121434 with no new memory leaks. 2010-12-10 07:39:47 +00:00
Other
Scripts macho-dump: Switch to C++ macho-dump tool. 2010-12-10 06:19:45 +00:00
TableGen Add support for using the `!if' operator when initializing variables: 2010-12-13 01:46:19 +00:00
Transforms fix a fairly serious oversight with switch formation from 2010-12-13 03:18:54 +00:00
Unit
Verifier
CMakeLists.txt macho-dump: Fix CMake build, following up to r121466. 2010-12-10 09:18:26 +00:00
lit.cfg
lit.site.cfg.in
Makefile
Makefile.tests
site.exp.in
TestRunner.sh