Jim Grosbach
f4e104f5eb
AArch64: Constant fold converting vector setcc results to float.
...
Since the result of a SETCC for AArch64 is 0 or -1 in each lane, we can
move unary operations, in this case [su]int_to_fp through the mask
operation and constant fold the operation away. Generally speaking:
UNARYOP(AND(VECTOR_CMP(x,y), constant))
--> AND(VECTOR_CMP(x,y), constant2)
where constant2 is UNARYOP(constant).
This implements the transform where UNARYOP is [su]int_to_fp.
For example, consider the simple function:
define <4 x float> @foo(<4 x float> %val, <4 x float> %test) nounwind {
%cmp = fcmp oeq <4 x float> %val, %test
%ext = zext <4 x i1> %cmp to <4 x i32>
%result = sitofp <4 x i32> %ext to <4 x float>
ret <4 x float> %result
}
Before this change, the code is generated as:
fcmeq.4s v0, v0, v1
movi.4s v1, #0x1 // Integer splat value.
and.16b v0, v0, v1 // Mask lanes based on the comparison.
scvtf.4s v0, v0 // Convert each lane to f32.
ret
After, the code is improved to:
fcmeq.4s v0, v0, v1
fmov.4s v1, #1.00000000 // f32 splat value.
and.16b v0, v0, v1 // Mask lanes based on the comparison.
ret
The svvtf.4s has been constant folded away and the floating point 1.0f
vector lanes are materialized directly via fmov.4s.
Rather than do the folding manually in the target code, teach getNode()
in the generic SelectionDAG to handle folding constant operands of
vector [su]int_to_fp nodes. It is reasonable (as noted in a FIXME) to do
additional constant folding there as well, but I don't have test cases
for those operations, so leaving them for another time when it becomes
appropriate.
rdar://17693791
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213341 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-18 00:40:52 +00:00
..
2014-05-24 12:50:23 +00:00
2014-07-02 18:17:40 +00:00
2014-07-02 18:17:40 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:42:26 +00:00
2014-05-30 10:09:59 +00:00
2014-05-24 12:42:26 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-30 08:59:55 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-07-11 13:33:46 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-06-03 13:54:53 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-30 10:09:59 +00:00
2014-05-30 05:58:19 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-06-09 01:25:51 +00:00
2014-05-24 12:50:23 +00:00
2014-07-07 09:06:35 +00:00
2014-07-07 09:06:35 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-07-10 03:41:50 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-06-18 17:20:49 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-30 10:09:59 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-28 15:33:19 +00:00
2014-05-30 08:59:55 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-30 10:09:59 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-30 05:58:19 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-06-10 09:52:44 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-30 10:09:59 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-30 10:09:59 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-07-02 16:46:08 +00:00
2014-06-11 21:06:56 +00:00
2014-06-09 01:54:00 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-07-03 00:23:43 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-07-03 00:23:43 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-26 17:21:53 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-07-18 00:40:52 +00:00
2014-05-24 12:50:23 +00:00
2014-05-30 05:58:19 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-30 05:58:19 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-07-17 10:51:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-30 08:59:55 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-06-16 10:39:21 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-30 10:09:59 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-27 16:50:03 +00:00
2014-05-24 12:42:26 +00:00
2014-05-24 12:50:23 +00:00
2014-06-13 14:24:07 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-30 10:09:59 +00:00
2014-05-24 12:50:23 +00:00
2014-06-17 11:31:42 +00:00
2014-05-30 10:09:59 +00:00
2014-05-24 12:50:23 +00:00
2014-06-13 14:24:07 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-06-10 14:32:08 +00:00
2014-05-24 12:50:23 +00:00
2014-06-15 09:27:15 +00:00
2014-06-15 09:27:06 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:42:26 +00:00
2014-05-30 10:09:59 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:42:26 +00:00
2014-05-24 12:42:26 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:42:26 +00:00
2014-07-17 10:51:23 +00:00
2014-07-10 14:18:46 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:42:26 +00:00
2014-05-30 10:09:59 +00:00
2014-05-24 12:42:26 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:42:26 +00:00
2014-05-24 12:42:26 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-06-30 15:03:00 +00:00
2014-05-24 12:50:23 +00:00
2014-06-13 22:57:59 +00:00
2014-06-13 22:57:59 +00:00
2014-06-13 22:57:59 +00:00
2014-06-13 22:57:59 +00:00
2014-06-11 06:44:53 +00:00
2014-05-24 12:50:23 +00:00
2014-07-12 21:20:49 +00:00
2014-05-26 17:22:07 +00:00
2014-05-24 12:42:26 +00:00
2014-07-07 21:37:51 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:42:26 +00:00
2014-05-24 12:42:26 +00:00
2014-06-24 16:21:38 +00:00
2014-07-17 10:50:20 +00:00
2014-05-30 10:09:59 +00:00
2014-05-24 12:50:23 +00:00
2014-06-03 16:03:00 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-06-09 22:42:55 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:42:26 +00:00
2014-05-24 12:50:23 +00:00
2014-06-27 21:05:09 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-06-30 14:51:14 +00:00
2014-05-24 12:42:26 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-07-15 10:00:26 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-27 16:50:09 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:42:26 +00:00
2014-05-24 12:42:26 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-06-10 10:50:24 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:42:26 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-05-24 12:50:23 +00:00
2014-07-03 02:12:26 +00:00
2014-05-30 10:09:59 +00:00
2014-05-24 12:50:23 +00:00