[all-commits] [llvm/llvm-project] c2a0b0: [DCE] Add tests for non-willreturn function being ...

Nikita Popov via All-commits all-commits at lists.llvm.org
Fri Feb 19 16:32:44 PST 2021


  Branch: refs/heads/release/12.x
  Home:   https://github.com/llvm/llvm-project
  Commit: c2a0b0810a40199ec94c90539b601ba72bcb3523
      https://github.com/llvm/llvm-project/commit/c2a0b0810a40199ec94c90539b601ba72bcb3523
  Author: Nikita Popov <nikita.ppv at gmail.com>
  Date:   2021-02-19 (Fri, 19 Feb 2021)

  Changed paths:
    A llvm/test/Transforms/ADCE/willreturn.ll
    A llvm/test/Transforms/BDCE/willreturn.ll

  Log Message:
  -----------
  [DCE] Add tests for non-willreturn function being removed (NFC)

(cherry picked from commit 4045ad6b0ccd35fe990d51b9bfdd9e7de109bdf5)


  Commit: d1d7dc779a296001568d855bba7843a9eb94a585
      https://github.com/llvm/llvm-project/commit/d1d7dc779a296001568d855bba7843a9eb94a585
  Author: Nikita Popov <nikita.ppv at gmail.com>
  Date:   2021-02-19 (Fri, 19 Feb 2021)

  Changed paths:
    M llvm/include/llvm/IR/InstrTypes.h
    M llvm/include/llvm/IR/Instruction.h
    M llvm/lib/Analysis/ValueTracking.cpp
    M llvm/lib/IR/Instruction.cpp
    M llvm/lib/Transforms/IPO/FunctionAttrs.cpp
    M llvm/lib/Transforms/Utils/Local.cpp

  Log Message:
  -----------
  [IR] Move willReturn() to Instruction

This moves the willReturn() helper from CallBase to Instruction,
so that it can be used in a more generic manner. This will make
it easier to fix additional passes (ADCE and BDCE), and will give
us one place to change if additional instructions should become
non-willreturn (e.g. there has been talk about handling volatile
operations this way).

I have also included the IntrinsicInst workaround directly in
here, so that it gets applied consistently. (As such this change
is not entirely NFC -- FuncAttrs will now use this as well.)

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

(cherry picked from commit 370addb996138a9e3634899cf264c7621307617a)


  Commit: 8e9c2ad95eb5ab439b933d8c793957bc4d82e456
      https://github.com/llvm/llvm-project/commit/8e9c2ad95eb5ab439b933d8c793957bc4d82e456
  Author: Nikita Popov <nikita.ppv at gmail.com>
  Date:   2021-02-19 (Fri, 19 Feb 2021)

  Changed paths:
    M llvm/lib/Analysis/DemandedBits.cpp
    M llvm/lib/Transforms/Scalar/ADCE.cpp
    M llvm/test/Feature/OperandBundles/adce.ll
    M llvm/test/LTO/X86/parallel.ll
    M llvm/test/Transforms/ADCE/dce_pure_call.ll
    M llvm/test/Transforms/ADCE/willreturn.ll
    M llvm/test/Transforms/BDCE/dce-pure.ll
    M llvm/test/Transforms/BDCE/dead-void-ro.ll
    M llvm/test/Transforms/BDCE/willreturn.ll
    M llvm/test/tools/gold/X86/parallel.ll

  Log Message:
  -----------
  [DCE] Don't remove non-willreturn calls

In both ADCE and BDCE (via DemandedBits) we should not remove
instructions that are not guaranteed to return. This issue was
pointed out by fhahn in the recent llvm-dev thread.

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

(cherry picked from commit 2f17ed294fcd8cde505b93c9c5bbab06ba59051c)


  Commit: 17daef8bfdfd3a78465122f968a93df6db42dca6
      https://github.com/llvm/llvm-project/commit/17daef8bfdfd3a78465122f968a93df6db42dca6
  Author: Nikita Popov <nikita.ppv at gmail.com>
  Date:   2021-02-19 (Fri, 19 Feb 2021)

  Changed paths:
    M lld/test/ELF/lto/parallel.ll
    M lld/test/wasm/lto/parallel.ll

  Log Message:
  -----------
  [LLD] Fix tests after D96993

We now need mustprogress to eliminate these calls. The code doesn't
really make sense, but that's not the point of the test...

(cherry picked from commit ac065b7a37d6dd8daacd526f6c3a0d1563bc88ac)


Compare: https://github.com/llvm/llvm-project/compare/dda7ef025bc6...17daef8bfdfd


More information about the All-commits mailing list