Skip to content

Commit 328ce32

Browse files
authored
Update Instruction.cpp
1 parent 16cbb2f commit 328ce32

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

llvm/lib/IR/Instruction.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,12 +1092,11 @@ bool Instruction::mayThrow(bool IncludePhaseOneUnwind) const {
10921092
}
10931093

10941094
bool Instruction::mayHaveSideEffects() const {
1095-
// Do not optimize functions have the 'NoInline' attribute.
1095+
// Lambda function to check 'NoInline' attribute.
10961096
auto hasNoInline = [](const Instruction &I) -> bool {
10971097
if (const CallOrInvokeInst *CI = dyn_cast<CallOrInvokeInst>(&I)) {
1098-
if (CI->getCalledFunction() &&
1099-
CI->getCalledFunction()->hasFnAttribute(Attribute::NoInline)) {
1100-
return true;
1098+
if (CI->getCalledFunction()) {
1099+
return CI->getCalledFunction()->hasFnAttribute(Attribute::NoInline);
11011100
}
11021101
}
11031102
return false;

0 commit comments

Comments
 (0)