[llvm-bugs] [Bug 34807] New: Pre-RA Machine LICM illegally hoists div
llvm-bugs at lists.llvm.org
Mon Oct 2 12:13:09 PDT 2017
Bug ID: 34807
Summary: Pre-RA Machine LICM illegally hoists div
OS: Windows NT
Assignee: unassignedbugs at nondot.org
Reporter: Alberto.Magni at microsoft.com
CC: llvm-bugs at lists.llvm.org, nunoplopes at sapo.pt
Created attachment 19216
The attached .c file shows an issue with Machine LICM that causes the division
in the loop to be hoisted unconditionally outside of the loop for the aarch64
The .mir file in the package has been obtained from the .c file with this
clang -mllvm -stop-before=machinelicm -target aarch64-- -O2 -S licm_udiv.c -o
To reproduce the hoisting:
llc -debug -mtriple=aarch64-- -run-pass=machinelicm before_licm.mir -o -
The debug output shows that the UDIV instruction is hoisted:
Hoist non-reg-pressure: %vreg13<def> = UDIVXr %vreg7, %vreg6;
Notice that the same issue does not show up for x86_64.
This is because for x86_64 in IsProfitableToHoist we actually reach the
invocation of IsGuaranteedToExecute, which returns false for the block that
contains the division.
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-bugs