[llvm-commits] [RFC] Additions to TargetTransform for operation legality
hfinkel at anl.gov
Fri Oct 12 10:05:51 PDT 2012
Nadav, et al.,
I'd like to start using the new TargetTransform interface in BBVectorize. The first step is to enable BBVectorize to understand what operations are likely to be efficiently supported by the target. While that's a difficult question to answer generally, I think a reasonable proxy will be: operations that won't be expanded during legalization are probably supported efficiently.
I've attached a patch which implements two functions: allowsUnalignedMemoryAccesses (which is straightforward), and isPromotedOperationLegalOrCustom, and I'd like some feedback on whether this seems like the right way to go. I've not really tested this function, but I'd like to know if you think this is the right kind of interface for this, and if the approach is about right. Quickly, isPromotedOperationLegalOrCustom first promotes the type as would be required during type legalization, converts the IR instruction opcode or intrinsic identifier into an ISD opcode, promotes the type based on operation-specific promotion, and then checks whether the resulting operation/type combination is marked Legal or Custom.
Thanks in advance,
Leadership Computing Facility
Argonne National Laboratory
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 10426 bytes
Desc: not available
More information about the llvm-commits