[PATCH] D22449: Enable folding of (logic (cast icmp), (cast icmp)) to (cast (logic (icmp), (icmp)))

Matthias J. Reisinger via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 17 06:17:46 PDT 2016


mreisinger created this revision.
mreisinger added reviewers: grosser, vtjnash.
mreisinger added a subscriber: llvm-commits.

So far, instcombine has already been able to transform expressions of the form (logic (cast A), (cast B)) to a simpler form (cast (logic A, B)) where "logic" designates the bitwise operators and/or/xor. However, this simplification has been avoided in case A and B are icmp instructions in order to facilitate the optimization of (zext icmp) occurrences. We now loosen this restriction to also allow the folding of (logic (cast icmp), (cast icmp)) without hindering this (zext icmp) optimization.

https://reviews.llvm.org/D22449

Files:
  lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
  lib/Transforms/InstCombine/InstCombineCasts.cpp
  lib/Transforms/InstCombine/InstCombineInternal.h
  test/Transforms/InstCombine/fold-casts-of-icmps.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22449.64252.patch
Type: text/x-patch
Size: 12600 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160717/0cbaed5a/attachment.bin>


More information about the llvm-commits mailing list