[llvm] Reland "[Support] Assert that DomTree nodes share parent"" (PR #102782)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 12 06:58:29 PDT 2024


================
@@ -0,0 +1,46 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
+; RUN: opt -S -mtriple=x86_64 -passes=slp-vectorizer < %s | FileCheck %s
+
+; Test that SLP vectorize doesn't crash if a stored constant is used in multiple
+; functions.
+
+define void @_Z1hPfl() {
+; CHECK-LABEL: define void @_Z1hPfl() {
+; CHECK-NEXT:  [[ENTRY:.*:]]
+; CHECK-NEXT:    [[TMP0:%.*]] = getelementptr i8, ptr null, i64 28
+; CHECK-NEXT:    store <2 x float> <float 0.000000e+00, float 1.000000e+00>, ptr [[TMP0]], align 4
+; CHECK-NEXT:    ret void
+;
+entry:
+  %0 = getelementptr i8, ptr null, i64 28
----------------
nikic wrote:

> It's iterating over the ConstantData users. I'm not familiar with SLP, please advise how to fix the larger problem.

Adding an `isa<ConstantData>(V) break;` in this function should work. (You should still keep your check, in case we're iterating over GV users.)

> If iterating over such users is not allowed, why is there no assertion for this?

Nobody has implemented it :)

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


More information about the llvm-commits mailing list