[llvm] r293846 - [IPSCCP] Restore the old behaviour (pre r293799).
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 1 16:46:54 PST 2017
Author: davide
Date: Wed Feb 1 18:46:54 2017
New Revision: 293846
URL: http://llvm.org/viewvc/llvm-project?rev=293846&view=rev
Log:
[IPSCCP] Restore the old behaviour (pre r293799).
It's not clear the change I made a good idea, and it definitely needs
further discussion. Thanks to Eli for pointing out.
Removed:
llvm/trunk/test/Transforms/IPConstantProp/noinline-return.ll
Modified:
llvm/trunk/lib/Transforms/Scalar/SCCP.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/SCCP.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SCCP.cpp?rev=293846&r1=293845&r2=293846&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/SCCP.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/SCCP.cpp Wed Feb 1 18:46:54 2017
@@ -1715,12 +1715,7 @@ static bool runIPSCCP(Module &M, const D
// Don't touch naked functions. They may contain asm returning a
// value we don't see, so we may end up interprocedurally propagating
// the return value incorrectly.
- // Also, don't touch functions marked as noinline. Trivial functions may
- // essentially be inlined because of return value propagation.
- // (e.g. int tinkywinky(void) { return 666; })
- if (F.hasExactDefinition() &&
- !(F.hasFnAttribute(Attribute::Naked) ||
- F.hasFnAttribute(Attribute::NoInline)))
+ if (F.hasExactDefinition() && !F.hasFnAttribute(Attribute::Naked))
Solver.AddTrackedFunction(&F);
// If this function only has direct calls that we can see, we can track its
Removed: llvm/trunk/test/Transforms/IPConstantProp/noinline-return.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/IPConstantProp/noinline-return.ll?rev=293845&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/IPConstantProp/noinline-return.ll (original)
+++ llvm/trunk/test/Transforms/IPConstantProp/noinline-return.ll (removed)
@@ -1,21 +0,0 @@
-; RUN: opt %s -ipsccp -S | FileCheck %s
-
-define i32 @tinkywinky() #0 {
-entry:
- ret i32 5
-}
-
-define i32 @patatino() {
-entry:
- %call = call i32 @tinkywinky()
-
-; Check that we don't propagate the return value of
-; @tinkywinky.
-; CHECK: call i32 @dipsy(i32 %call)
- %call1 = call i32 @dipsy(i32 %call)
- ret i32 %call1
-}
-
-declare i32 @dipsy(i32)
-
-attributes #0 = { noinline }
More information about the llvm-commits
mailing list