[all-commits] [llvm/llvm-project] 914066: [DebugInfo] Avoid LSR crash on large integer inputs

Jeremy Morse via All-commits all-commits at lists.llvm.org
Tue Jan 5 02:32:08 PST 2021


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 914066fe38a93c004b742a696ec337701eb738ec
      https://github.com/llvm/llvm-project/commit/914066fe38a93c004b742a696ec337701eb738ec
  Author: Jeremy Morse <jeremy.morse at sony.com>
  Date:   2021-01-05 (Tue, 05 Jan 2021)

  Changed paths:
    M llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
    A llvm/test/Transforms/LoopStrengthReduce/dbg-preserve-1.ll

  Log Message:
  -----------
  [DebugInfo] Avoid LSR crash on large integer inputs

Loop strength reduction tries to recover debug variable values by looking
for simple offsets from PHI values. In really extreme conditions there may
be an offset used that won't fit in an int64_t, hitting an APInt assertion.

This patch adds a regression test and adjusts the equivalent value
collecting code to filter out any values where the offset can't be
represented by an int64_t. This means that for very large integers with
very large offsets, the variable location will become undef, which is the
same behaviour as before 2a6782bb9f1 / D87494.

Differential Revision: https://reviews.llvm.org/D94016




More information about the All-commits mailing list