[llvm-commits] [PATCH] Simplify ARM Neon vmull_n_* intrinsics.

Bob Wilson bob.wilson at apple.com
Wed Apr 25 09:02:08 PDT 2012


On Apr 23, 2012, at 11:18 PM, Lang Hames <lhames at gmail.com> wrote:

> Hi All,
> 
> Could someone who's more familiar with InstCombine please take a look at this patch for me? It's meant to enable simplification of ARM neon vmull_n_* intrinsics by zext/sexting (as appropriate) their arguments so that they can be analyzed with SimplifyMulInst.
> 
> It seems to fix my test case, but it has at least one issue: The sext/zext instructions hang around after InstSimplify if the vmull isn't simplified - I have to explicitly run DCE afterwards to get rid of them (see the output for the complex1 function in the test case for an example of this). Tips on the right way to solve this would be appreciated.

I think there may be a more fundamental problem.  We used to have clang emit IR for those operations without any intrinsics, just using zext/sext like your instcombine transformation is doing.  But, we had to go back to using intrinsics because sometimes the zext/sext would get separated from the multiply, e.g., by LICM, and when the extension is in a different basic block, we fail to select the desired instruction.  It seems like introducing this transformation in instcombine is going to bring back that same problem.



More information about the llvm-commits mailing list