[PATCH] D72673: [PowerPC] Fix powerpcspe subtarget enablement in llvm backend

Justin Hibbits via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 14 07:43:35 PST 2020


jhibbits marked an inline comment as done.
jhibbits added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCSubtarget.cpp:129-130
     if (TargetTriple.getArch() == Triple::ppc64le)
       CPUName = "ppc64le";
+    else if (TargetTriple.getSubArch() == Triple::PPCSubArch_spe)
+      CPUName = "e500";
----------------
MaskRay wrote:
> Why is this change needed?
It sets the default CPU to e500, which allows doing 'llc -mtarget=powerpcspe foo.ll' instead of needing to specify -mattr=+spe as well, or -mcpu=e500, in order to get the SPE.  It's the only way I found to default enable it on the subarch basis.  If it's better to just make the SubArch a hint to clang, and remove this, that's fine as well, it just looks a little silly to see 'llc -mtarget=powerpcspe -mattr=+spe ...'.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72673/new/

https://reviews.llvm.org/D72673





More information about the llvm-commits mailing list