[all-commits] [llvm/llvm-project] eba760: [FuncSpec] Don't specialise (or crash) on poison o...

sjoerdmeijer via All-commits all-commits at lists.llvm.org
Mon Sep 27 06:59:44 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: eba76056a364d206de7f0ac944c8601c988b6405
      https://github.com/llvm/llvm-project/commit/eba76056a364d206de7f0ac944c8601c988b6405
  Author: Sjoerd Meijer <sjoerd.meijer at arm.com>
  Date:   2021-09-27 (Mon, 27 Sep 2021)

  Changed paths:
    M llvm/lib/Transforms/IPO/FunctionSpecialization.cpp
    M llvm/test/Transforms/FunctionSpecialization/function-specialization-constant-expression.ll
    A llvm/test/Transforms/FunctionSpecialization/function-specialization-constant-expression2.ll
    A llvm/test/Transforms/FunctionSpecialization/function-specialization-poison.ll

  Log Message:
  -----------
  [FuncSpec] Don't specialise (or crash) on poison or constexpr values

Function specialization was crashing on poison values and constexpr values.
The problem is that these values are not added to the solver, so it crashes
when a lookup is performed for these values. This fixes that by not
specialising on these values. For poison that is obvious, but for constexpr
this is a change in behaviour. Thus, in one way this is a bit of a stopgap, but
specialising on constexpr values wasn't done very intentionally, and need some
more work and tests if we wanted to support this.

As a follow up, we need to look if the solver should exit more gracefully and
return a "don't know", or that it should really support these constexprs.

This should fix PR51600 (https://bugs.llvm.org/show_bug.cgi?id=51600).

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




More information about the All-commits mailing list