[clang] [CIR] Implement folder for VecCreateOp (PR #143355)

Bruno Cardoso Lopes via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 9 06:50:46 PDT 2025


================
@@ -1533,6 +1533,17 @@ LogicalResult cir::GetMemberOp::verify() {
 // VecCreateOp
 //===----------------------------------------------------------------------===//
 
+OpFoldResult cir::VecCreateOp::fold(FoldAdaptor adaptor) {
+  auto elements = getElements();
+  if (std::any_of(elements.begin(), elements.end(), [](mlir::Value attr) {
----------------
bcardosolopes wrote:

`llvm::any_of` will give you a shorter version

https://github.com/llvm/llvm-project/pull/143355


More information about the cfe-commits mailing list