[clang] [Clang][RISCV] Add vcreate intrinsics for RVV non-tuple types (PR #70355)
Yeting Kuo via cfe-commits
cfe-commits at lists.llvm.org
Mon Oct 30 23:19:42 PDT 2023
================
@@ -2429,15 +2455,32 @@ let HasMasked = false, HasVL = false, IRName = "" in {
SupportOverloading = false,
ManualCodegen = [{
{
- assert(isa<StructType>(ResultType));
- unsigned NF = cast<StructType>(ResultType)->getNumElements();
- llvm::Value *ReturnTuple = llvm::PoisonValue::get(ResultType);
- for (unsigned I = 0; I < NF; ++I) {
- ReturnTuple = Builder.CreateInsertValue(ReturnTuple, Ops[I], {I});
+ if (isa<StructType>(ResultType)) {
+ unsigned NF = cast<StructType>(ResultType)->getNumElements();
+ llvm::Value *ReturnTuple = llvm::PoisonValue::get(ResultType);
+ for (unsigned I = 0; I < NF; ++I) {
+ ReturnTuple = Builder.CreateInsertValue(ReturnTuple, Ops[I], {I});
+ }
+ return ReturnTuple;
+ } else {
----------------
yetingk wrote:
Looks like we don't need the else?
https://github.com/llvm/llvm-project/pull/70355
More information about the cfe-commits
mailing list