[PATCH] [InstCombine] Fold bitcasts into loads across PHINodes

Philip Pfaffe philip.pfaffe at gmail.com
Mon Jun 1 02:47:43 PDT 2015


I adopted Chandler's suggestion of combining the PHI instead of the Load and updated the patch accordingly. I also added a missing RUN line to the test case.

The idea here is to detect a PHI whose only user is a Noop CastInst and then fold the cast back through the phi if the phi only depends on loads and matching casts. This produces a new cast for an incoming load (which should be folded into the loop later on), and skips incoming casts.


http://reviews.llvm.org/D9500

Files:
  lib/Transforms/InstCombine/InstCombinePHI.cpp
  test/Transforms/InstCombine/fold-phi-cast-load.ll

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D9500.26881.patch
Type: text/x-patch
Size: 5545 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150601/bea9fadf/attachment.bin>


More information about the llvm-commits mailing list