Skip to content
Commit 2fc0d17e authored by Vincent Lee's avatar Vincent Lee
Browse files

[FuncSpec] Avoid crashing when SwitchInst doesn't see ConstantInt

D150464 updated the cost model for function specialization. Unfortunately, this
also crashes when trying to build stage2 LLD with thinLTO and assertions. It looks
like the issue is caused by a mishandling of the Constant in a SwitchInst since the
Constant cannot always be assumed to safely casted to a ConstantInt. In the case
of the crash, Constant was a ConstantExpr which triggered the assertion.

Reviewed By: ChuanqiXu

Differential Revision: https://reviews.llvm.org/D154159
parent afb27437
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment