[llvm] [GVN] Skip instructions without value numbers in performScalarPRE (PR #219851)
Antonio Frighetto via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 10 00:32:41 PDT 2026
================
@@ -0,0 +1,42 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
+; RUN: opt -passes=gvn -S < %s | FileCheck %s
+
+; Test for #216265: GVN load-PREs %load1, then forwards the i64 store to %conv,
+; so MaterializeAdjustedValue RAUWs a coercing trunc over it without a value
+; number. Scalar PRE on the inserted .pre load's GEP index then looked that
+; trunc up and asserted with "Value not numbered?".
----------------
antoniofrighetto wrote:
```suggestion
; Test for #216265. GVN forwards the i64 store to the i8 load
; (%conv), inserting a coercing `trunc i64 %x to i8` via MaterializeAdjustedValue
; without assigning it a value number. When scalar PRE later runs on the GEP
; indices of the PRE'd load, it encounters the unnumbered trunc and asserts
; in VN.lookup().
```
https://github.com/llvm/llvm-project/pull/219851
More information about the llvm-commits
mailing list