llvm.org GIT mirror llvm / abaa9ca
[RA CopyHints] Fix compile-time regression This patch makes sure that a register is only hinted once to RA. In extreme cases the same register can otherwise be hinted numerous times and cause a compile time slowdown. Review: Simon Pilgrim https://reviews.llvm.org/D52826 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343686 91177308-0d34-0410-b5e6-96231b3b80d8 Jonas Paulsson 1 year, 9 months ago
1 changed file(s) with 4 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
286286 if (TargetHint.first == 0 && TargetHint.second)
287287 mri.clearSimpleHint(li.reg);
288288
289 std::set HintedRegs;
289290 for (auto &Hint : CopyHints) {
290 if (TargetHint.first != 0 && Hint.Reg == TargetHint.second)
291 // Don't add again the target-type hint.
291 if (!HintedRegs.insert(Hint.Reg).second ||
292 (TargetHint.first != 0 && Hint.Reg == TargetHint.second))
293 // Don't add the same reg twice or the target-type hint again.
292294 continue;
293295 mri.addRegAllocationHint(li.reg, Hint.Reg);
294296 if (!tri.enableMultipleCopyHints())