[PATCH] D13137: Do not remove calls to functions that may not halt

Oliver Stannard via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 24 09:07:08 PDT 2015


olista01 created this revision.
olista01 added a subscriber: llvm-commits.
olista01 set the repository for this revision to rL LLVM.

This prevents LLVM from removing calls to functions if that function may not terminate. This was previously done by several passes (including ADCE and the inliner) in cases where the callee is otherwise side-effect free.

The actual fix is in Instruction.{h,cpp}, the rest of the changes are fixing up passes that were relying on the old behaviour, in cases such as intrinsics and known library functions where it is still safe to do this.

A few of the tests had to be modified as they were checking that calls were removed when this this is not safe to do so. The only test I am concerned about is LTO/X86/parallel.ll, which appears to be the only test for parallel LTO. I've relaxed it so that it passes, but I'm not sure if it is really testing the functionality any more.

Repository:
  rL LLVM

http://reviews.llvm.org/D13137

Files:
  include/llvm/Analysis/DemandedBits.h
  include/llvm/Analysis/TargetLibraryInfo.h
  include/llvm/IR/Instruction.h
  include/llvm/Transforms/Utils/Local.h
  lib/Analysis/DemandedBits.cpp
  lib/IR/Instruction.cpp
  lib/Transforms/Scalar/ADCE.cpp
  lib/Transforms/Scalar/TailRecursionElimination.cpp
  lib/Transforms/Utils/Local.cpp
  lib/Transforms/Utils/SimplifyCFG.cpp
  test/LTO/X86/parallel.ll
  test/Transforms/ADCE/noreturn.ll
  test/Transforms/BDCE/basic.ll
  test/Transforms/Inline/delete-call.ll
  test/Transforms/Inline/noreturn.ll
  test/Transforms/InstCombine/nothrow.ll
  test/Transforms/InstSimplify/call.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13137.35636.patch
Type: text/x-patch
Size: 25326 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150924/25e7ef93/attachment.bin>


More information about the llvm-commits mailing list