Skip to content

[SYCL][NFC] Code clean up revealed by self build. #2986

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions llvm/lib/SYCLLowerIR/LowerESIMD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ struct ESIMDIntrinDesc {

std::string GenXSpelling;
SmallVector<ArgRule, 16> ArgRules;
NameRule SuffixRule = {NO_RULE, 0};
NameRule SuffixRule = {NO_RULE, {0}};

int getNumGenXArgs() const {
auto NRules = ArgRules.size();
Expand All @@ -169,7 +169,7 @@ class ESIMDIntrinDescTable {

#define DEF_ARG_RULE(Nm, Kind) \
static constexpr ESIMDIntrinDesc::ArgRule Nm(int16_t N) { \
return ESIMDIntrinDesc::ArgRule{ESIMDIntrinDesc::Kind, N}; \
return ESIMDIntrinDesc::ArgRule{ESIMDIntrinDesc::Kind, {{N, {}}}}; \
}
DEF_ARG_RULE(l, SRC_CALL_ALL)
DEF_ARG_RULE(t, SRC_TMPL_ARG)
Expand All @@ -179,39 +179,39 @@ class ESIMDIntrinDescTable {
static constexpr ESIMDIntrinDesc::ArgRule a(int16_t N) {
return ESIMDIntrinDesc::ArgRule{
ESIMDIntrinDesc::SRC_CALL_ARG,
{N, ESIMDIntrinDesc::GenXArgConversion::NONE}};
{{N, ESIMDIntrinDesc::GenXArgConversion::NONE}}};
}

static constexpr ESIMDIntrinDesc::ArgRule ai1(int16_t N) {
return ESIMDIntrinDesc::ArgRule{
ESIMDIntrinDesc::SRC_CALL_ARG,
{N, ESIMDIntrinDesc::GenXArgConversion::TO_I1}};
{{N, ESIMDIntrinDesc::GenXArgConversion::TO_I1}}};
}

static constexpr ESIMDIntrinDesc::ArgRule aSI(int16_t N) {
return ESIMDIntrinDesc::ArgRule{
ESIMDIntrinDesc::SRC_CALL_ARG,
{N, ESIMDIntrinDesc::GenXArgConversion::TO_SI}};
{{N, ESIMDIntrinDesc::GenXArgConversion::TO_SI}}};
}

static constexpr ESIMDIntrinDesc::ArgRule c16(int16_t N) {
return ESIMDIntrinDesc::ArgRule{ESIMDIntrinDesc::CONST_INT16, N};
return ESIMDIntrinDesc::ArgRule{ESIMDIntrinDesc::CONST_INT16, {{N, {}}}};
}

static constexpr ESIMDIntrinDesc::ArgRule c32(int16_t N) {
return ESIMDIntrinDesc::ArgRule{ESIMDIntrinDesc::CONST_INT32, N};
return ESIMDIntrinDesc::ArgRule{ESIMDIntrinDesc::CONST_INT32, {{N, {}}}};
}

static constexpr ESIMDIntrinDesc::ArgRule c64(int16_t N) {
return ESIMDIntrinDesc::ArgRule{ESIMDIntrinDesc::CONST_INT64, N};
return ESIMDIntrinDesc::ArgRule{ESIMDIntrinDesc::CONST_INT64, {{N, {}}}};
}

static constexpr ESIMDIntrinDesc::NameRule bo(int16_t N) {
return ESIMDIntrinDesc::NameRule{ESIMDIntrinDesc::BIN_OP, N};
return ESIMDIntrinDesc::NameRule{ESIMDIntrinDesc::BIN_OP,{N}};
}

static constexpr ESIMDIntrinDesc::NameRule nk(int16_t N) {
return ESIMDIntrinDesc::NameRule{ESIMDIntrinDesc::NUM_KIND, N};
return ESIMDIntrinDesc::NameRule{ESIMDIntrinDesc::NUM_KIND, {N}};
}

public:
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Transforms/IPO/GlobalOpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1610,9 +1610,9 @@ optimizeOnceStoredGlobal(GlobalVariable *GV, Value *StoredOnceVal,
nullptr /* F */,
GV->getInitializer()->getType()->getPointerAddressSpace())) {
if (Constant *SOVC = dyn_cast<Constant>(StoredOnceVal)) {
if (GV->getInitializer()->getType() != SOVC->getType())
if (GV->getInitializer()->getType() != SOVC->getType()) {
SOVC = ConstantExpr::getBitCast(SOVC, GV->getInitializer()->getType());

}
// Optimize away any trapping uses of the loaded value.
if (OptimizeAwayTrappingUsesOfLoads(GV, SOVC, DL, GetTLI))
return true;
Expand Down