]> granicus.if.org Git - llvm/commit
[InlineCost] Do not take INT_MAX when Cost is negative
authorJun Bum Lim <junbuml@codeaurora.org>
Fri, 23 Jun 2017 16:12:37 +0000 (16:12 +0000)
committerJun Bum Lim <junbuml@codeaurora.org>
Fri, 23 Jun 2017 16:12:37 +0000 (16:12 +0000)
commit910c8cc5329ce8c4a8b038c827aef07461996a5f
treeb3bd7122a73de816055992c30e8db8f53fce625b
parentdd1f27e281a148dc16425d91b4d2548d26e92e75
[InlineCost] Do not take INT_MAX when Cost is negative

Summary: visitSwitchInst should not take INT_MAX when Cost is negative. Instead of INT_MAX , we also use a valid upperbound cost when overflow occurs in Cost.

Reviewers: hans, echristo, dmgreen

Reviewed By: dmgreen

Subscribers: mcrosier, javed.absar, llvm-commits, eraman

Differential Revision: https://reviews.llvm.org/D34436

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306118 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/InlineCost.cpp
test/Transforms/Inline/AArch64/switch.ll