[llvm] Reland "[Support] Assert that DomTree nodes share parent"" (PR #102782)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 11 00:28:50 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:
Can you replace `null` with a global here to make the code not be immediate UB?
Is the code iterating over `null` users or over `0.000000e+00`/`1.000000e+00` users? If it's the latter, than this code probably needs a larger fix, because iterating over ConstantData users is not allowed in general. (Also applies to null, but in that case a global is a plausible replacement.)
https://github.com/llvm/llvm-project/pull/102782
More information about the llvm-commits
mailing list