[LLVMdev] Adding scheduling constraints to intrinsics

Rotem, Nadav nadav.rotem at intel.com
Wed Apr 6 03:31:34 PDT 2011


Hi,

I am working on fixing a bug in the x86 codegen and I need help in adding a new type of scheduling constraints.

The bug I am fixing is related to SSE instruction scheduling.  SSE instructions use the "mxcsr" register for selecting the desired rounding mode.  This control register is set/read by an intrinsic.  Currently, this intrinsic has no scheduling deps and SSE instructions are scheduled freely before and after calls to this register.  When working on this I noticed a case where an SSE instruction (after the intrinsic) was merged with a load instruction (before the intrinsic)  during the isel phase. The merged SSE instruction was placed before the call to the intrinsic, producing an incorrect code.

In order to establish scheduling constraints, I declared a new phys register and wrapped the control intrinsic and SSE instructions with "Uses/Defs" definitions.  My modifications did not add 'blue edges' to the scheduling graph. I also tried to change the intrinsic into a memory barrier, but it did not solve this case for obvious reasons.

My question is, how do I add these new scheduling constraints ?

Thanks,
Nadav


---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110406/b6246402/attachment.html>


More information about the llvm-dev mailing list