[all-commits] [llvm/llvm-project] 6cd44b: [FunctionAttrs] Derive willreturn for fns with rea...

Florian Hahn via All-commits all-commits at lists.llvm.org
Tue Jan 12 12:03:55 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6cd44b204c6c6f2e915270af6792f247c4c23abc
      https://github.com/llvm/llvm-project/commit/6cd44b204c6c6f2e915270af6792f247c4c23abc
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2021-01-12 (Tue, 12 Jan 2021)

  Changed paths:
    M llvm/include/llvm/IR/Function.h
    M llvm/lib/Transforms/IPO/FunctionAttrs.cpp
    M llvm/test/Transforms/FunctionAttrs/willreturn.ll

  Log Message:
  -----------
  [FunctionAttrs] Derive willreturn for fns with readonly` & `mustprogress`.

Similar to D94125, derive `willreturn` for functions that are `readonly` and
`mustprogress` in FunctionAttrs.

To quote the reasoning from D94125:

    Since D86233 we have `mustprogress` which, in combination with
    `readonly`, implies `willreturn`. The idea is that every side-effect
    has to be modeled as a "write". Consequently, `readonly` means there
    is no side-effect, and `mustprogress` guarantees that we cannot "loop"
    forever without side-effect.

Reviewed By: jdoerfert, nikic

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




More information about the All-commits mailing list