Add computeFSAdditions to the function based subtarget creation
authorEric Christopher <echristo@gmail.com>
Thu, 26 Mar 2015 00:50:23 +0000 (00:50 +0000)
committerEric Christopher <echristo@gmail.com>
Thu, 26 Mar 2015 00:50:23 +0000 (00:50 +0000)
for PPC due to some unfortunate default setting via TargetMachine
creation. I've added a FIXME on how this can be unraveled in the
backend and a test to make sure we successfully legalize 64-bit things
if we say we're 64-bits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233239 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PowerPC/PPCTargetMachine.cpp

index 5d1f2387e823581b0845c22ad3ccced2ecd4f7a8..7267529ef81d19b3fd517768f499c68fea30afaf 100644 (file)
@@ -207,7 +207,15 @@ PPCTargetMachine::getSubtargetImpl(const Function &F) const {
     // creation will depend on the TM and the code generation flags on the
     // function that reside in TargetOptions.
     resetTargetOptions(F);
-    I = llvm::make_unique<PPCSubtarget>(TargetTriple, CPU, FS, *this);
+    I = llvm::make_unique<PPCSubtarget>(
+        TargetTriple, CPU,
+        // FIXME: It would be good to have the subtarget additions here
+        // not necessary. Anything that turns them on/off (overrides) ends
+        // up being put at the end of the feature string, but the defaults
+        // shouldn't require adding them. Fixing this means pulling Feature64Bit
+        // out of most of the target cpus in the .td file and making it set only
+        // as part of initialization via the TargetTriple.
+        computeFSAdditions(FS, getOptLevel(), getTargetTriple()), *this);
   }
   return I.get();
 }