llvm-project/llvm/lib
Bill Wendling f2c78f344e Restrict this transformation to equality conditions.
This transformation is not correct for not-equal conditions:

(trunc x) != C1 & (and x, CA) != C2 -> (and x, CA|CMAX) != C1|C2

Let
  C1 == 0
  C2 == 0
  CA == 0xFF0000
  CMAX == 0xFF
and truncating to i8.

The original truth table:

    x   | A: trunc x != 0 | B: x & 0xFF0000 != 0 | A & B != 0
--------------------------------------------------------------
0x00000 |        0        |          0           |     0
0x00001 |        1        |          0           |     0
0x10000 |        0        |          1           |     0
0x10001 |        1        |          1           |     1

The truth table of the replacement:

    x   | x & 0xFF00FF != 0
----------------------------
0x00000 |        0
0x00001 |        1
0x10000 |        1
0x10001 |        1

So they are different.

llvm-svn: 151691
2012-02-29 01:46:50 +00:00
..
Analysis Duncan pointed out that if the alignment isn't explicitly specified, it defaults to the ABI alignment. Given that, make this code a bit more aggressive in such cases. 2012-02-27 23:16:46 +00:00
Archive Avoid using an invalidated iterator. 2012-01-23 05:07:16 +00:00
AsmParser Convert assert(0) to llvm_unreachable 2012-02-07 05:05:23 +00:00
Bitcode Fix PR12080 by ensuring that MaterializeModule actually reads all the bitcode 2012-02-29 00:07:09 +00:00
CodeGen Add an analyzeVirtReg() function. 2012-02-29 01:40:37 +00:00
DebugInfo More dead code removal (using -Wunreachable-code) 2012-01-20 21:51:11 +00:00
ExecutionEngine EE/Interpreter/ExternalFunctions.cpp: Staticize lle_X_() entries. They can be mapped in FuncNames[] at the initialization. 2012-02-24 00:20:08 +00:00
Linker Oops...Don't commit the other stuff.. 2012-02-28 04:01:21 +00:00
MC Make MemoryObject accessor members const again 2012-02-29 01:09:06 +00:00
Object In the ObjectFile interface, replace isInternal(), isAbsolute(), isGlobal(), and isWeak(), with a bitset of flags. 2012-02-28 23:47:53 +00:00
Support Make MemoryObject accessor members const again 2012-02-29 01:09:06 +00:00
TableGen Remove stray semi-colon. 2012-02-28 15:35:52 +00:00
Target Make MemoryObject accessor members const again 2012-02-29 01:09:06 +00:00
Transforms Restrict this transformation to equality conditions. 2012-02-29 01:46:50 +00:00
VMCore Use the DT dominates function in the verifier. 2012-02-26 02:23:37 +00:00
CMakeLists.txt Move TableGen's parser and entry point into a library 2011-10-01 16:41:13 +00:00
LLVMBuild.txt LLVMBuild: Introduce a common section which currently has a list of the 2011-12-12 22:45:54 +00:00
Makefile Remove more of llvmc and dependencies. 2011-09-20 00:34:27 +00:00