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 2121#include " clang/CIR/Dialect/IR/CIROpsDialect.cpp.inc"
2222#include " clang/CIR/Dialect/IR/CIROpsEnums.cpp.inc"
2323#include " clang/CIR/MissingFeatures.h"
24+
2425#include < numeric>
2526
2627using namespace mlir ;
@@ -1597,9 +1598,9 @@ OpFoldResult cir::VecShuffleDynamicOp::fold(FoldAdaptor adaptor) {
15971598 elements.reserve (numElements);
15981599
15991600 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 ();
16031604 uint64_t newIdx = idxValue & maskBits;
16041605 elements.push_back (vecElts[newIdx]);
16051606 }
You can’t perform that action at this time.
0 commit comments