Systemz v2f32 ops

Jonas Paulsson via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 20 00:21:41 PST 2017


Hi,

I found that on SystemZ, for v2f32, four and not two scalar operations 
are emitted. This is because the v2f32 type is widened, which is good in 
cases of memory-only operations for instance. There is however no fp32 
vector support on z13, so these will always be scalarized. If this is 
done after type-legalization, four and not two operations are produced, 
which is particularly bad in case of fp32 divide inside a vectorized loop.

In order to fix this, my patch unrolls these operations before type 
legalization (with a target DAG combine). They must also have the 
operation action of 'Expand', since otherwise other DAGCombiner methods 
may re-vectorized them again. This happened in 
reduceBuildVecConvertToConvertBuildVec(), where I also needed to add a 
call to TLI.isOperationLegalOrCustom(Opcode, VT), to check on the 
*result* type, which would in this case be v2f32. It would not work to
mark all the operand VT's of SINT_TO_FP as 'Expand', because this is 
only true for the v2f32 result case.

I do get some failing regression tests, which I am not sure about:

Failing Tests (3):
     LLVM :: CodeGen/ARM/vdup.ll
     LLVM :: CodeGen/X86/2009-02-26-MachineLICMBug.ll
     LLVM :: CodeGen/X86/cvtv2f32.ll

Is it ok to add the check for the result type per what I did?

/Jonas


-------------- next part --------------
A non-text attachment was scrubbed...
Name: fp32_combine.patch
Type: text/x-patch
Size: 5573 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170220/36d65cf2/attachment.bin>


More information about the llvm-commits mailing list