[PATCH] [AArch64] Change default legalization behavior of v1i32 to be widen to v2i32 instead of scalarization

Tim Northover t.p.northover at gmail.com
Tue Jul 1 08:52:18 PDT 2014


Hi Hao, 

This seems to leave us with a rather ugly mess of callbacks that cover all possible actions, at least on vector types (Scalarize, Split, Widen, Promote). There must be a tidier way to express the logic, both in Targets and in TargetLoweringBase.

If the callback was TargetLowering::getVectorAction instead, we could almost use a switch like this, with fallthroughs (provided v1iN is set to scalarize by default):

    switch (getPreferredVectorAction()) {
    case TypeWidenVector:
      // ...
      // FALLTHROUGH
    case TypePromoteVector:
      // ...
      // FALLTHROUGH
    case TypeSplitVector:
      // ...
      break;
    case TypeScalarizeVector:
      // ...
      break;
    }

I'm not sure I like the asymmetry there, but something must be possible.

The special accommodation later in the function for non-pow2 MVTs also seems completely redundant, at least now: there aren't any.

Cheers.

Tim.

http://reviews.llvm.org/D4322






More information about the llvm-commits mailing list