Currently we're able to select longer alternative code sequence if it has better sched numbers but we should always select the shortest code sequence if OptSize == true. This patch fixes the given issue.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
Unfortunately, before D40602 (or D26855 which I'm going to update soon) we don't have any test case because we don't use Machine Combiner when alternative sequence of instructions is longer then the original one.
But D40602 has such test just now (see lines 420-423 in test/CodeGen/X86/schedule-x86-64-shld.ll): at the moment we can select longer code sequence even if we have optsize option for the function (see define void @lshift_mem_b_optsize(i64 %b) nounwind readnone optsize {).