[PATCH] D30296: v2f32 ops

Jonas Paulsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 24 03:03:36 PST 2017


jonpa updated this revision to Diff 89633.
jonpa added a comment.

Thanks for help with the test regressions!

> That said, if you don't want to mess with other targets, maybe you could change the new check in DAGCombine to "if (LegalTypes && !TLI.isOperationLegalOrCustom(Opcode, VT))"?

I don't think that would work, becuase this problem arose as an infinite loop *before* type legalization (the point was to call DAG.UnrollVectorOp() before type legalization with only two elements).

> On platforms where the widened operation is legal or custom-lowered, we want to use that operation. (For example, if v4f32 uitofp is custom, we also want to use that lowering for v2f32.)

I tried this idea, by adding a check for also the widened VT, but that didn't work. In vdup.ll,
this optimization is needed to make a 'v4f32 = sint_to_fp' node. This is however marked for 'Expand', so TLI.isOperationLegalOrCustom() doesn't work.

Instead, I made my check  more precise, to handle only exactly the case where before type legalization, if the result is going to be widened, and both the narrow and wider ops are 'Expand', then don't vectorize it (return SDValue()). This seems to work better, with no regressions.

This seems even possibly even like a general DAG heuristic, to actually scalarize early in this case. Or is it not?

I also realized that I don't have to call setOperationAction(Op, MVT::v2f32, Expand) at all, since this is true already per default for all vector ops in SystemZ.


https://reviews.llvm.org/D30296

Files:
  lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  lib/Target/SystemZ/SystemZISelLowering.cpp
  test/CodeGen/SystemZ/fp32-vec-conv.ll
  test/CodeGen/SystemZ/fp32-vec-ops.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30296.89633.patch
Type: text/x-patch
Size: 5460 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170224/7ea188a7/attachment.bin>


More information about the llvm-commits mailing list