[llvm-commits] [PATCH] Expand VSELECT on ARM/NEON

Jim Grosbach grosbach at apple.com
Fri Oct 12 11:59:50 PDT 2012


Very cool. Thanks!

A bit of minor cleanup for the test case:

+; RUN: llc -march=arm -mattr=+neon < %s
+; Make sure that ARM backend with NEON handles vselect.
+
+define arm_aapcscc void  @vmax_v4i32(<4 x i32>* %m, <4 x i32> %a, <4 x i32> %b) {
+    %cmpres = icmp sgt <4 x i32> %a, %b
+    %maxres = select <4 x i1> %cmpres, <4 x i32> %a,  <4 x i32> %b
+    store <4 x i32> %maxres, <4 x i32>* %m
+    ret void
+}

No need for an explicit calling convention. Just use a full target-triple in the RUN line instead.

The test should have CHECK lines that we're generating the expected code, not just that we don't crash. In particular for this case, we should be checking for the vbsl and vcgt.s32 and that their operands align properly (see some of the other test cases and the FileCheck docs for regex support to avoid dependencies on regalloc order if you're not already familiar with that).

On Oct 12, 2012, at 9:17 AM, Peter Couperus <peter.couperus at st.com> wrote:

> Hello,
> 
> Following this discussion:
> http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-October/054345.html
> 
> Here is a patch which marks VSELECT with appropriate vector types as Expand on ARM targets with NEON.
> Previously, VSELECT was unhandled in the ARM backend.
> This addresses the following PRs:
> 
> http://llvm.org/bugs/show_bug.cgi?id=13831
> http://llvm.org/bugs/show_bug.cgi?id=13961
> 
> Thanks!
> 
> Pete
> 
> <arm_vselect_expand.diff>_______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list