[RISCV] Refactor RVV Policy by structure
commit0d4c6506100b339311283c10d841d7693287666a
authorPiyou Chen <piyou.chen@sifive.com>
Tue, 20 Dec 2022 09:12:57 +0000 (20 01:12 -0800)
committerPiyou Chen <piyou.chen@sifive.com>
Tue, 20 Dec 2022 09:13:13 +0000 (20 01:13 -0800)
tree5943cdb2c3224efccd6edd1d19151827b03c9c21
parent74cca964a653190d37101116c80d38907228021a
[RISCV] Refactor RVV Policy by structure

RVV intrinsic function has several policy variants.

Include TU, TA, TAMU, TAMA, TUMU, TUMA, MU, MA, TUM, TAM

Currently, the clang side enumerates these policies, but it's hard to add a new policy.

This patch use structure to replace the origin policy enumeration, and enhance some policy transform logic.

This is a clean-up job that will not affect the RVV intrinsic functionality and make sure riscv_vector_builtin_cg.inc is the same as the original one.

Reviewed By: kito-cheng

Differential Revision: https://reviews.llvm.org/D139995
clang/include/clang/Support/RISCVVIntrinsicUtils.h
clang/lib/Sema/SemaRISCVVectorLookup.cpp
clang/lib/Support/RISCVVIntrinsicUtils.cpp
clang/utils/TableGen/RISCVVEmitter.cpp