llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.1k stars 11.6k forks source link

Constrained FP operations should have implicit use/def for FP environment registers #30632

Open andykaylor opened 7 years ago

andykaylor commented 7 years ago
Bugzilla Link 31284
Version trunk
OS All
CC @hfinkel,@rotateright

Extended Description

This is a pre-emptive bug for the implementation of constrained FP intrinsics. When these intrinsics are translated to machine instructions, an implicit use and/or def of target-specific FP environment registers should be added to the instructions selected. These registers aren't currently modeled for FP instructions, and for the default, non-constrained case it probably makes sense to continue not modeling them, but when the constrained intrinsics are used these accesses need to be modeled to prevent unwanted code motion.

For example, if a program uses an intrinsic such as llvm.x86.sse.ldmxcsr to change the rounding mode we need to be certain that FP operations are not moved across the LDMXCSR instruction.

andykaylor commented 7 years ago

assigned to @andykaylor