Skip to content

Commit 8a2b373

Browse files
committed
Build UserData c++17 compatible
2 parents 40b2e7b + e06fb82 commit 8a2b373

File tree

5 files changed

+47
-12
lines changed

5 files changed

+47
-12
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ clang/test/AST/Interp/ @tbaederr
116116
/mlir/**/NVVM* @grypp
117117

118118
# MLIR Python Bindings
119-
/mlir/test/python/ @makslevental @stellaraccident
120-
/mlir/python/ @makslevental @stellaraccident
119+
/mlir/test/python/ @ftynse @makslevental @stellaraccident
120+
/mlir/python/ @ftynse @makslevental @stellaraccident
121121

122122
# BOLT
123123
/bolt/ @aaupov @maksfb @rafaelauler @ayermolo @dcci

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24478,7 +24478,8 @@ SDValue DAGCombiner::visitEXTRACT_SUBVECTOR(SDNode *N) {
2447824478
unsigned NumSubElts = NVT.getVectorMinNumElements();
2447924479
if (InsIdx <= ExtIdx && (ExtIdx + NumSubElts) <= (InsIdx + NumInsElts) &&
2448024480
TLI.isExtractSubvectorCheap(NVT, InsSubVT, ExtIdx - InsIdx) &&
24481-
InsSubVT.isFixedLengthVector() && NVT.isFixedLengthVector())
24481+
InsSubVT.isFixedLengthVector() && NVT.isFixedLengthVector() &&
24482+
V.getValueType().isFixedLengthVector())
2448224483
return DAG.getNode(ISD::EXTRACT_SUBVECTOR, DL, NVT, InsSub,
2448324484
DAG.getVectorIdxConstant(ExtIdx - InsIdx, DL));
2448424485
}

llvm/test/CodeGen/AArch64/sve-fixed-length-extract-subvector.ll

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,40 @@ define void @extract_subvector_v32f64(ptr %a, ptr %b) vscale_range(16,0) #0 {
613613
ret void
614614
}
615615

616+
; Test for infinite loop due to fold:
617+
; extract_subvector(insert_subvector(x,y,c1),c2)--> extract_subvector(y,c2-c1)
618+
define void @extract_subvector_legalization_v8i32() vscale_range(2,2) #0 {
619+
; CHECK-LABEL: extract_subvector_legalization_v8i32:
620+
; CHECK: // %bb.0: // %entry
621+
; CHECK-NEXT: ptrue p0.s
622+
; CHECK-NEXT: adrp x8, .LCPI40_0
623+
; CHECK-NEXT: add x8, x8, :lo12:.LCPI40_0
624+
; CHECK-NEXT: movi v2.2d, #0000000000000000
625+
; CHECK-NEXT: ptrue p1.d
626+
; CHECK-NEXT: ld1w { z0.s }, p0/z, [x8]
627+
; CHECK-NEXT: mov z1.d, z0.d
628+
; CHECK-NEXT: ext z1.b, z1.b, z0.b, #16
629+
; CHECK-NEXT: cmeq v0.4s, v0.4s, v2.4s
630+
; CHECK-NEXT: cmeq v1.4s, v1.4s, v2.4s
631+
; CHECK-NEXT: sunpklo z0.d, z0.s
632+
; CHECK-NEXT: sunpklo z1.d, z1.s
633+
; CHECK-NEXT: cmpne p0.d, p1/z, z1.d, #0
634+
; CHECK-NEXT: cmpne p1.d, p1/z, z0.d, #0
635+
; CHECK-NEXT: .LBB40_1: // %body
636+
; CHECK-NEXT: // =>This Inner Loop Header: Depth=1
637+
; CHECK-NEXT: st1d { z0.d }, p1, [x8]
638+
; CHECK-NEXT: st1d { z0.d }, p0, [x8]
639+
; CHECK-NEXT: b .LBB40_1
640+
entry:
641+
%splat = shufflevector <8 x i32> poison, <8 x i32> poison, <8 x i32> zeroinitializer
642+
br label %body
643+
body:
644+
%0 = icmp eq <8 x i32> zeroinitializer, %splat
645+
tail call void @llvm.masked.store.v8f64.p0(<8 x double> poison, ptr poison, i32 8, <8 x i1> %0)
646+
br label %body
647+
}
648+
declare void @llvm.masked.store.v8f64.p0(<8 x double>, ptr nocapture, i32 immarg, <8 x i1>)
649+
616650
declare <4 x i8> @llvm.vector.extract.v4i8.v8i8(<8 x i8>, i64)
617651
declare <8 x i8> @llvm.vector.extract.v8i8.v16i8(<16 x i8>, i64)
618652
declare <16 x i8> @llvm.vector.extract.v16i8.v32i8(<32 x i8>, i64)

llvm/utils/gn/secondary/libcxx/include/BUILD.gn

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,6 @@ if (current_toolchain == default_toolchain) {
143143
"__algorithm/pop_heap.h",
144144
"__algorithm/prev_permutation.h",
145145
"__algorithm/pstl_any_all_none_of.h",
146-
"__algorithm/pstl_backends/cpu_backends/any_of.h",
147-
"__algorithm/pstl_backends/cpu_backends/fill.h",
148-
"__algorithm/pstl_backends/cpu_backends/find_if.h",
149-
"__algorithm/pstl_backends/cpu_backends/for_each.h",
150-
"__algorithm/pstl_backends/cpu_backends/merge.h",
151-
"__algorithm/pstl_backends/cpu_backends/stable_sort.h",
152-
"__algorithm/pstl_backends/cpu_backends/transform.h",
153-
"__algorithm/pstl_backends/cpu_backends/transform_reduce.h",
154146
"__algorithm/pstl_copy.h",
155147
"__algorithm/pstl_count.h",
156148
"__algorithm/pstl_equal.h",
@@ -663,7 +655,15 @@ if (current_toolchain == default_toolchain) {
663655
"__pstl/backends/std_thread.h",
664656
"__pstl/configuration.h",
665657
"__pstl/configuration_fwd.h",
658+
"__pstl/cpu_algos/any_of.h",
666659
"__pstl/cpu_algos/cpu_traits.h",
660+
"__pstl/cpu_algos/fill.h",
661+
"__pstl/cpu_algos/find_if.h",
662+
"__pstl/cpu_algos/for_each.h",
663+
"__pstl/cpu_algos/merge.h",
664+
"__pstl/cpu_algos/stable_sort.h",
665+
"__pstl/cpu_algos/transform.h",
666+
"__pstl/cpu_algos/transform_reduce.h",
667667
"__random/bernoulli_distribution.h",
668668
"__random/binomial_distribution.h",
669669
"__random/cauchy_distribution.h",

mlir/lib/Bindings/Python/IRCore.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1261,7 +1261,7 @@ void PyOperationBase::walk(
12611261
std::string exceptionWhat;
12621262
py::object exceptionType;
12631263
};
1264-
UserData userData{.callback = callback};
1264+
UserData userData{callback, false, {}, {}};
12651265
MlirOperationWalkCallback walkCallback = [](MlirOperation op,
12661266
void *userData) {
12671267
UserData *calleeUserData = static_cast<UserData *>(userData);

0 commit comments

Comments
 (0)