llvm-6502/test
David Majnemer 5cbd5a13a4 InstCombine: Properly optimize or'ing bittests together
CFE, with -03, would turn:
bool f(unsigned x) {
  bool a = x & 1;
  bool b = x & 2;
  return a | b;
}

into:
  %1 = lshr i32 %x, 1
  %2 = or i32 %1, %x
  %3 = and i32 %2, 1
  %4 = icmp ne i32 %3, 0

This sort of thing exposes a nasty pathology in GCC, ICC and LLVM.

Instead, we would rather want:
  %1 = and i32 %x, 3
  %2 = icmp ne i32 %1, 0

Things get a bit more interesting in the following case:
  %1 = lshr i32 %x, %y
  %2 = or i32 %1, %x
  %3 = and i32 %2, 1
  %4 = icmp ne i32 %3, 0

Replacing it with the following sequence is better:
  %1 = shl nuw i32 1, %y
  %2 = or i32 %1, 1
  %3 = and i32 %2, %x
  %4 = icmp ne i32 %3, 0

This sequence is preferable because %1 doesn't involve %x and could
potentially be hoisted out of loops if it is invariant; only perform
this transform in the non-constant case if we know we won't increase
register pressure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216343 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-24 09:10:57 +00:00
..
Analysis Add @llvm.assume, lowering, and some basic properties 2014-07-25 21:13:35 +00:00
Assembler IR: Implement uselistorder assembly directives 2014-08-19 21:30:15 +00:00
Bindings [OCaml] Add Llvm.{string_of_const,const_element}. 2014-08-03 23:54:22 +00:00
Bitcode verify-uselistorder: Force -preserve-bc-use-list-order 2014-08-19 21:08:27 +00:00
BugPoint llvm/test/BugPoint/compile-custom.ll: Use explicit %python to invoke a test script, compile-custom.ll.py, for shebang-incapable hosts. 2014-07-11 14:44:10 +00:00
CodeGen [PowerPC] Add support for dcbtst and icbt (prefetch) 2014-08-23 23:21:04 +00:00
DebugInfo Use DILexicalBlockFile, rather than DILexicalBlock, to track discriminator changes to ensure discriminator changes don't introduce new DWARF DW_TAG_lexical_blocks. 2014-08-21 22:45:21 +00:00
ExecutionEngine [MCJIT] Add an i386 RuntimeDyldMachO test case. 2014-08-19 21:26:36 +00:00
Feature Use "weak alias" instead of "alias weak" 2014-07-30 22:51:54 +00:00
FileCheck FileCheck: Add a flag to allow checking empty input 2014-08-07 18:40:37 +00:00
Instrumentation [dfsan] Fix non-determinism bug in non-zero label check annotator. 2014-08-22 01:18:18 +00:00
Integer
JitListener
Linker Set comdats when lazily linking functions. 2014-08-15 20:17:08 +00:00
LTO
MC [PowerPC] Add support for dcbtst and icbt (prefetch) 2014-08-23 23:21:04 +00:00
Object llvm-objdump: don't print relocations in non-relocatable files. 2014-08-17 19:09:37 +00:00
Other Don't internalize all but main by default. 2014-08-05 20:10:38 +00:00
TableGen llvm/test/TableGen/*Foreach*.td: Remove XFAIL:vg_leak. They have not been failing since r215176. 2014-08-12 14:06:21 +00:00
tools llvm-cov: test: add xfail for the big-endian buildbots 2014-08-23 00:47:24 +00:00
Transforms InstCombine: Properly optimize or'ing bittests together 2014-08-24 09:10:57 +00:00
Unit
Verifier Use "weak alias" instead of "alias weak" 2014-07-30 22:51:54 +00:00
YAMLParser
.clang-format
CMakeLists.txt Rename llvm-uselistorder => verify-uselistorder 2014-07-30 17:11:27 +00:00
lit.cfg Temporarily Revert "Nuke the old JIT." as it's not quite ready to 2014-08-07 22:02:54 +00:00
lit.site.cfg.in Add missing Interpreter intrinsic lowering for sin, cos and ceil 2014-08-08 15:00:12 +00:00
Makefile Delete support for AuroraUX. 2014-08-14 15:15:09 +00:00
Makefile.tests
TestRunner.sh