From b9a81fde3da7dddecd2d99537673e5e9abbe2d0f Mon Sep 17 00:00:00 2001 From: Ramkumar Ramachandra Date: Thu, 28 Nov 2024 13:08:03 +0000 Subject: [PATCH] llvm_util: strip redundant splat-handling code (NFC) The splat-handling code in llvm_util's getOperand is a special case of the code that handles aggregates, calling fillAggregateValues. Hence, strip the code, with no functional changes. --- llvm_util/utils.cpp | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/llvm_util/utils.cpp b/llvm_util/utils.cpp index a359edea0..cbb74c093 100644 --- a/llvm_util/utils.cpp +++ b/llvm_util/utils.cpp @@ -287,31 +287,6 @@ Value* get_operand(llvm::Value *v, if (!ty) return nullptr; - // automatic splat of constant values - if (auto vty = dyn_cast(v->getType()); - vty && isa(v)) { - llvm::Value *llvm_splat = nullptr; - if (auto cnst = dyn_cast(v)) { - llvm_splat - = llvm::ConstantInt::get(vty->getElementType(), cnst->getValue()); - } else if (auto cnst = dyn_cast(v)) { - llvm_splat - = llvm::ConstantFP::get(vty->getElementType(), cnst->getValue()); - } else - UNREACHABLE(); - - auto splat = get_operand(llvm_splat, constexpr_conv, copy_inserter, - register_fn_decl); - if (!splat) - return nullptr; - - vector vals(vty->getNumElements(), splat); - auto val = make_unique(*ty, std::move(vals)); - auto ret = val.get(); - current_fn->addConstant(std::move(val)); - RETURN_CACHE(ret); - } - if (auto cnst = dyn_cast(v)) { RETURN_CACHE(make_intconst(cnst->getValue())); }