https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109393
Haochen Jiang <haochen.jiang at intel dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |haochen.jiang at intel dot com --- Comment #12 from Haochen Jiang <haochen.jiang at intel dot com> --- I have a problem on this patch. When folding this pattern, let's say 8*x-8 -> 8*(x-1), that is great. But there is another scenario, when we need to read a memory at y+8*x-8, then the patch will fold it into y+8*(x-1). At this scenario, after the patch, you will have to use another register to get the result of (x-1) first then calculate instead of directly calculating y+8*x-8. When the register pressure is high and we need to access the data in y+8*x-t, where t is a multiply of 8, the extra registers to store (x-t/8) used are causing spill.