From: eopXD Date: Sun, 28 May 2023 08:29:36 +0000 (-0700) Subject: [Clang][RISCV] Reduce boilerplate under RVVEmitter::createHeader. NFC X-Git-Tag: upstream/17.0.6~6951 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9efa4cdb5169ef77e6250473574980e7438fcf42;p=platform%2Fupstream%2Fllvm.git [Clang][RISCV] Reduce boilerplate under RVVEmitter::createHeader. NFC Signed-off by: eop Chen --- diff --git a/clang/utils/TableGen/RISCVVEmitter.cpp b/clang/utils/TableGen/RISCVVEmitter.cpp index c9f454a..35b2203 100644 --- a/clang/utils/TableGen/RISCVVEmitter.cpp +++ b/clang/utils/TableGen/RISCVVEmitter.cpp @@ -377,25 +377,13 @@ void RVVEmitter::createHeader(raw_ostream &OS) { } } - for (int Log2LMUL : Log2LMULs) { - auto T = TypeCache.computeType(BasicType::Float16, Log2LMUL, - PrototypeDescriptor::Vector); - if (T) - printType(*T); - } - - for (int Log2LMUL : Log2LMULs) { - auto T = TypeCache.computeType(BasicType::Float32, Log2LMUL, - PrototypeDescriptor::Vector); - if (T) - printType(*T); - } - - for (int Log2LMUL : Log2LMULs) { - auto T = TypeCache.computeType(BasicType::Float64, Log2LMUL, - PrototypeDescriptor::Vector); - if (T) - printType(*T); + for (BasicType BT : + {BasicType::Float16, BasicType::Float32, BasicType::Float64}) { + for (int Log2LMUL : Log2LMULs) { + auto T = TypeCache.computeType(BT, Log2LMUL, PrototypeDescriptor::Vector); + if (T) + printType(*T); + } } OS << "#define __riscv_v_intrinsic_overloading 1\n";