[llvm] r295004 - [X86] Add MXCSR register

Kaylor, Andrew via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 9 00:32:36 PST 2017


Hi David,

Thanks for the reproducer!

I think I understand what's going on now, but I'm not entirely sure what to do about it.  The problem is that the llvm.x86.sse.stmxcsr intrinsic, which gets translated directly to an stmxcsr instruction, implicitly reads the MXCSR register but nothing is defined as writing the register yet.  For most cases that would be taken care of when I add the MXCSR defs to the appropriate x86 floating point instructions, but it doesn't really solve the problem because it's perfectly legal to execute stmxcsr before anything has been done to write MXCSR.

In this sense, MXCSR behaves sort of like a reserved register.  It always has a value which can be implicitly read.  However, the whole reason I introduced the modeling of that register's implicit uses is that I want to use it to restrict code motion.  So I don't think I can just add it to the reserved register set (though doing so does mask your problem).  I think it's going to require some kind of special handling.

I think it probably makes sense for me to revert this change set until I can figure out a proper solution.  However, I'm not going to have time to do that until Friday.

I'm sorry for whatever inconvenience this has caused you.

-Andy


-----Original Message-----
From: davide.italiano at gmail.com [mailto:davide.italiano at gmail.com] On Behalf Of Davide Italiano
Sent: Wednesday, March 08, 2017 10:48 AM
To: Kaylor, Andrew <andrew.kaylor at intel.com>; Whittaker, Simon <Simon.Whittaker at sony.com>; Filipe Cabecinhas <filcab at gmail.com>; Simon Pilgrim <llvm-dev at redking.me.uk>
Cc: Reid Kleckner <rnk at google.com>; llvm-commits <llvm-commits at lists.llvm.org>
Subject: Re: [llvm] r295004 - [X86] Add MXCSR register

On Tue, Mar 7, 2017 at 6:26 PM, Davide Italiano <davide at freebsd.org> wrote:
> Sorry, I'm late.
> I'm afraid the patch didn't help. I'll provide a short repro soon.
>

You can find the reduced repro attached. Sorry it took so long, but I haven't gotten around to it until this morning.
The test is synthetic enough to diagnose the problem, but probably can be reduced further. As we're hitting this on one of our games, please let me know if you can take a look (or I can take over, in that case I might need some guidance, maybe).

Thanks!

--
Davide

"There are no solved problems; there are only problems that are more or less solved" -- Henri Poincare


More information about the llvm-commits mailing list