llvm.org GIT mirror llvm / 3fec6ee
[IPCP] Don't propagate return value for naked functions. This is pretty much the same change made in SCCP. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294098 91177308-0d34-0410-b5e6-96231b3b80d8 Davide Italiano 2 years ago
2 changed file(s) with 8 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
135135 // For more details, see GlobalValue::mayBeDerefined.
136136 if (!F.isDefinitionExact())
137137 return false;
138
138
139 // Don't touch naked functions. The may contain asm returning
140 // value we don't see, so we may end up interprocedurally propagating
141 // the return value incorrectly.
142 if (F.hasFnAttribute(Attribute::Naked))
143 return false;
144
139145 // Check to see if this function returns a constant.
140146 SmallVector RetVals;
141147 StructType *STy = dyn_cast(F.getReturnType());
0 ; RUN: opt -ipsccp -S %s | FileCheck %s
1 ; RUN: opt -ipconstprop -S %s | FileCheck %s
12
23 target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
34 target triple = "i686-pc-windows-msvc19.0.24215"