[PATCH] D29542: [TargetInfo] Adjust x86-32 atomic support to the CPU used

Justin Lebar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 6 08:37:42 PST 2017


jlebar added inline comments.


================
Comment at: lib/Basic/Targets.cpp:1808
+    if (HostTriple.getArch() == llvm::Triple::x86)
+      HostTarget->setCPU("i586");
+
----------------
mgorny wrote:
> jlebar wrote:
> > Okay, is this still needed now?
> Yes. I've specifically tested with it commented out, and the CPU gets initiated to generic (=no inline atomics) then.
Yes, but is that a bug?  Does that break the test?

I thought the problem we were trying to solve here was that CUDA host and device builds did not define the same macros.  And I thought that setCPU modified the values for MaxAtomicInlineWidth and MaxAtomicPromoteWidth.  Moreover I thought that we called HostTarget->setCPU before calling this function.

If all of those things are true, I don't see what problem we're solving by calling HostTarget->setCPU("i586") here.


https://reviews.llvm.org/D29542





More information about the cfe-commits mailing list