Add functions for finding ephemeral values
authorHal Finkel <hfinkel@anl.gov>
Sun, 7 Sep 2014 13:49:57 +0000 (13:49 +0000)
committerHal Finkel <hfinkel@anl.gov>
Sun, 7 Sep 2014 13:49:57 +0000 (13:49 +0000)
commit3d03d60ca8ad1f1b4e76cd5af024e31a1aed5b6d
tree8a22d7db4b00f6cd928bcdabf3a29fb207981231
parent3666e7f4c161c50e5f6dcb0e015ca16bf69fb941
Add functions for finding ephemeral values

This adds a set of utility functions for collecting 'ephemeral' values. These
are LLVM IR values that are used only by @llvm.assume intrinsics (directly or
indirectly), and thus will be removed prior to code generation, implying that
they should be considered free for certain purposes (like inlining). The
inliner's cost analysis, and a few other passes, have been updated to account
for ephemeral values using the provided functionality.

This functionality is important for the usability of @llvm.assume, because it
limits the "non-local" side-effects of adding llvm.assume on inlining, loop
unrolling, etc. (these are hints, and do not generate code, so they should not
directly contribute to estimates of execution cost).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217335 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/CodeMetrics.h
include/llvm/Analysis/InlineCost.h
lib/Analysis/CodeMetrics.cpp
lib/Analysis/IPA/InlineCost.cpp
lib/Transforms/Scalar/LoopRotation.cpp
lib/Transforms/Scalar/LoopUnrollPass.cpp
lib/Transforms/Scalar/LoopUnswitch.cpp
test/Transforms/Inline/ephemeral.ll [new file with mode: 0644]
test/Transforms/LoopUnroll/ephemeral.ll [new file with mode: 0644]