[PATCH] Added inst combine transforms for single bit tests from Chris's note

Dinesh Dwivedi dinesh.d at samsung.com
Sun May 11 04:42:33 PDT 2014


Hi rafael, bkramer,

This patch adds transforms for
--- Single bit tests [http://nondot.org/sabre/LLVMNotes/InstCombine.txt]:
 if ((x & C) == 0) x |= C	becomes		x |= C
 if ((x & C) != 0) x ^= C	becomes		x &= ~C
 if ((x & C) == 0) x ^= C	becomes		x |= C
 if ((x & C) != 0) x &= ~C	becomes		x &= ~C
 if ((x & C) == 0) x &= ~C	becomes		nothing

Z3 Verifications code for above transform
 http://rise4fun.com/Z3/Pmsh

http://reviews.llvm.org/D3717

Files:
  lib/Transforms/InstCombine/InstCombineSelect.cpp
  test/Transforms/InstCombine/select.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D3717.9290.patch
Type: text/x-patch
Size: 4448 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140511/0eea9bc4/attachment.bin>


More information about the llvm-commits mailing list