@@ -101,16 +101,16 @@ static Value getLaneId(RewriterBase &rewriter, Location loc) {
101
101
auto int32Type = IntegerType::get (rewriter.getContext (), 32 );
102
102
Value zero = arith::ConstantIntOp::create (rewriter, loc, 0 , 32 );
103
103
Value minus1 = arith::ConstantIntOp::create (rewriter, loc, -1 , 32 );
104
- NamedAttribute noundef = rewriter.getNamedAttr (
105
- LLVM::LLVMDialect::getNoUndefAttrName (), rewriter.getUnitAttr ());
106
- NamedAttribute lowRange = rewriter.getNamedAttr (
104
+ NamedAttribute noundef = {LLVM::LLVMDialect::getNoUndefAttrName (),
105
+ rewriter.getUnitAttr ()};
106
+ NamedAttribute lowRange = {LLVM::LLVMDialect::getRangeAttrName (),
107
+ LLVM::ConstantRangeAttr::get (rewriter.getContext (),
108
+ APInt::getZero (32 ),
109
+ APInt (32 , 32 ))};
110
+ NamedAttribute highRange = {
107
111
LLVM::LLVMDialect::getRangeAttrName (),
108
112
LLVM::ConstantRangeAttr::get (rewriter.getContext (), APInt::getZero (32 ),
109
- APInt (32 , 32 )));
110
- NamedAttribute highRange = rewriter.getNamedAttr (
111
- LLVM::LLVMDialect::getRangeAttrName (),
112
- LLVM::ConstantRangeAttr::get (rewriter.getContext (), APInt::getZero (32 ),
113
- APInt (32 , 64 )));
113
+ APInt (32 , 64 ))};
114
114
Value mbcntLo = ROCDL::MbcntLoOp::create (
115
115
rewriter, loc, int32Type, minus1, zero, /* arg_attrs=*/ {},
116
116
/* res_attrs=*/
@@ -133,9 +133,7 @@ struct PromoteShuffleToDPPPattern : public OpRewritePattern<gpu::ShuffleOp> {
133
133
return rewriter.notifyMatchFailure (op,
134
134
" width must be a constant integer" );
135
135
int64_t widthValue = *width;
136
- if (widthValue != 4 && widthValue != 8 && widthValue != 12 &&
137
- widthValue != 16 && widthValue != 32 && widthValue != 48 &&
138
- widthValue != 64 )
136
+ if (!llvm::is_contained ({4 , 8 , 12 , 16 , 32 , 48 , 64 }, widthValue))
139
137
return rewriter.notifyMatchFailure (
140
138
op, " width must be 4, 8, 12, 16, 32, 48 or 64" );
141
139
0 commit comments