HomePhabricator

[SVE] Remove IITDescriptor::ScalableVecArgument

Authored by david-arm on May 15 2020, 6:31 AM.

Description

[SVE] Remove IITDescriptor::ScalableVecArgument

I have refactored the code so that we no longer need the
ScalableVecArgument descriptor - the scalable property of vectors is
now encoded using the ElementCount class in IITDescriptor. This means
that when matching intrinsics we know precisely how to match the
arguments and return values.

Differential Revision: https://reviews.llvm.org/D80107

Details

Event Timeline

dsanders added inline comments.
/llvm/lib/IR/Function.cpp
759–760

This appears to cause ubsan failures when Infos comes from IIT_LongEncodingTable as LastInfo can have values that aren't in IIT_Info. We hit it for iPTR with a large numbered address space but it looks like there's several ways for EncodeFixedType() to add some values that aren't in the enum. I think it's generally unsafe to read backwards like this as some types result in multiple elements being pushed into the long table and there's potential for coincidental matches with IIT_SCALABLE_VEC

david-arm marked an inline comment as done.May 31 2020, 10:57 PM
david-arm added inline comments.
/llvm/lib/IR/Function.cpp
759–760

OK I see. Well sorry about introducing this bug! I'll try to fix it. Would it be acceptable to change DecodeIITType to allow me to pass the last info as an additional parameter?

dsanders added inline comments.Jun 1 2020, 5:37 PM
/llvm/lib/IR/Function.cpp
759–760

No worries. Sure, that works for me.