[PATCH] [AArch64] Change default legalization behavior of v1i32 to be widen to v2i32 instead of scalarization
Hao Liu
Hao.Liu at arm.com
Fri Jun 27 02:19:29 PDT 2014
Hi t.p.northover,
Hi Tim and other reviewers,
Recently we found an assertion failure caused by scalarizing node like "v1i32 trunc v1i64". As v1i64 is legal, it will fail to scalarize v1i32.
This patch adds two hooks (like the existing hook shouldSplitVectorType()) to change the scalarization behavior:
(1) avoid scalarize v1i32 by shouldScalarizeVectorType().
(2) If avoid scalarization, the default behavior is changed to be promoted from v1i32 to v1i64, which may introduce extra operations like extend, truncate... Hook preferWidenVectorType() can change it to be widen from v1i32 to v2i32.
v1i8 and v1i16 are similar to v1i32. This patch can also have benefit on reducing FMOV.
BTW, I also think it's better to widen v2i8, v4i8, v2i16 to v8i8, v8i8, v4i16 than the default behavior of promote. But such change will cause several regression test case failures. Some of the test cases result in better code, but some of the test cases result in worse code. If we can improve the worse case, we will also have benefit.
Code review. Please.
Thanks,
-Hao
http://reviews.llvm.org/D4322
Files:
include/llvm/Target/TargetLowering.h
lib/CodeGen/TargetLoweringBase.cpp
lib/Target/AArch64/AArch64ISelLowering.cpp
lib/Target/AArch64/AArch64ISelLowering.h
test/CodeGen/AArch64/arm64-neon-copy.ll
test/CodeGen/AArch64/arm64-neon-select_cc.ll
test/CodeGen/AArch64/trunc-v1i64.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4322.10918.patch
Type: text/x-patch
Size: 10776 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140627/fcfc1009/attachment.bin>
More information about the llvm-commits
mailing list