[llvm] [AMDGPU][GlobalISel] Fix G_UNMERGE_VALUES combine (PR #141812)

Maksim Shelegov via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 4 06:48:54 PDT 2025


================
@@ -1064,13 +1064,17 @@ class LegalizationArtifactCombiner {
                                GISelChangeObserver &Observer) {
     unsigned NumDefs = MI.getNumDefs();
     Register SrcReg = MI.getSourceReg();
-    MachineInstr *SrcDef = getDefIgnoringCopies(SrcReg, MRI);
+    std::optional<DefinitionAndSourceRegister> DefSrcReg =
+        getDefSrcRegIgnoringCopies(SrcReg, MRI);
+    if (!DefSrcReg)
+      return false;
+    MachineInstr *SrcDef = DefSrcReg->MI;
----------------
mshelego wrote:

Thanks! Fixed in the updated patch.

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


More information about the llvm-commits mailing list