File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 21
21
#include " clang/CIR/Dialect/IR/CIROpsDialect.cpp.inc"
22
22
#include " clang/CIR/Dialect/IR/CIROpsEnums.cpp.inc"
23
23
#include " clang/CIR/MissingFeatures.h"
24
+
24
25
#include < numeric>
25
26
26
27
using namespace mlir ;
@@ -1597,9 +1598,9 @@ OpFoldResult cir::VecShuffleDynamicOp::fold(FoldAdaptor adaptor) {
1597
1598
elements.reserve (numElements);
1598
1599
1599
1600
const uint64_t maskBits = llvm::NextPowerOf2 (numElements - 1 ) - 1 ;
1600
- for (uint64_t i = 0 ; i < numElements; i++) {
1601
- cir::IntAttr idxAttr = mlir::cast <cir::IntAttr>(indicesElts[i]);
1602
- uint64_t idxValue = idxAttr.getUInt ();
1601
+ for (const mlir::APInt &idxAttr :
1602
+ indicesElts. getAsValueRange <cir::IntAttr, mlir::APInt>()) {
1603
+ uint64_t idxValue = idxAttr.getZExtValue ();
1603
1604
uint64_t newIdx = idxValue & maskBits;
1604
1605
elements.push_back (vecElts[newIdx]);
1605
1606
}
You can’t perform that action at this time.
0 commit comments