Skip to content

Commit

Permalink
llvm2alive: improve check for implicit splats
Browse files Browse the repository at this point in the history
  • Loading branch information
nunoplopes committed Oct 11, 2024
1 parent f900171 commit 135991e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions llvm_util/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,7 @@ Value* get_operand(llvm::Value *v,

// automatic splat of constant values
if (auto vty = dyn_cast<llvm::FixedVectorType>(v->getType());
vty && !isa<llvm::ConstantAggregate, llvm::ConstantAggregateZero,
llvm::ConstantDataSequential>(v)) {
vty && isa<llvm::ConstantInt, llvm::ConstantFP>(v)) {
llvm::Value *llvm_splat = nullptr;
if (auto cnst = dyn_cast<llvm::ConstantInt>(v)) {
llvm_splat
Expand All @@ -298,7 +297,7 @@ Value* get_operand(llvm::Value *v,
llvm_splat
= llvm::ConstantFP::get(vty->getElementType(), cnst->getValue());
} else
return nullptr;
UNREACHABLE();

auto splat = get_operand(llvm_splat, constexpr_conv, copy_inserter,
register_fn_decl);
Expand Down

0 comments on commit 135991e

Please sign in to comment.