[PATCH] D15392: [InstCombine] fold trunc ([lshr] (bitcast vector) ) --> extractelement (PR25543)

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 9 13:12:21 PST 2015


spatel created this revision.
spatel added reviewers: hfinkel, kuhar, majnemer.
spatel added a subscriber: llvm-commits.

This is a fix for PR25543:
https://llvm.org/bugs/show_bug.cgi?id=25543

The idea is to take the existing fold of:
bitcast ( trunc ( lshr ( bitcast X))) --> extractelement (bitcast X) 
( http://reviews.llvm.org/rL112232 )

And break it into 2 less specific transforms so we'll catch more cases such as the example in the bug report:
bitcast ( trunc ( lshr ( bitcast X))) --> bitcast ( extractelement (bitcast X)) --> extractelement (bitcast X)

D14879 handles the 2nd transform: folding of bitcasts around the extractelement.

http://reviews.llvm.org/D15392

Files:
  lib/Transforms/InstCombine/InstCombineCasts.cpp
  test/Transforms/InstCombine/bitcast-bigendian.ll
  test/Transforms/InstCombine/bitcast.ll
  test/Transforms/InstCombine/trunc.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15392.42329.patch
Type: text/x-patch
Size: 8236 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151209/83beda7c/attachment.bin>


More information about the llvm-commits mailing list