[Assignment Tracking] Fix fragment index error in getDerefOffsetInBytes
authorOCHyams <orlando.hyams@sony.com>
Fri, 10 Feb 2023 12:33:16 +0000 (12:33 +0000)
committerOCHyams <orlando.hyams@sony.com>
Fri, 10 Feb 2023 13:49:05 +0000 (13:49 +0000)
commit25d0f3c4d0d9f01755b008b5af92448ba593adf9
tree7db16a85b077562a80fae527998c00c186998d9a
parent4d7c879d33a22a125923449150e493df3dc9fd05
[Assignment Tracking] Fix fragment index error in getDerefOffsetInBytes

Without this patch `getDerefOffsetInBytes` incorrectly always returns
`std::nullopt` for expressions with fragments due to an off-by-one error with
fragment element indices.

Reviewed By: StephenTozer

Differential Revision: https://reviews.llvm.org/D143567
llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
llvm/test/DebugInfo/assignment-tracking/X86/lower-to-value.ll
llvm/test/DebugInfo/assignment-tracking/X86/mem-loc-frag-fill.ll
llvm/test/DebugInfo/assignment-tracking/X86/nested-loop-frags.ll