]> granicus.if.org Git - llvm/commitdiff
[X86][NFC] Add a `use-aa` feature.
authorClement Courbet <courbet@google.com>
Mon, 16 Sep 2019 14:05:28 +0000 (14:05 +0000)
committerClement Courbet <courbet@google.com>
Mon, 16 Sep 2019 14:05:28 +0000 (14:05 +0000)
Summary:
This allows enabling useaa on the command-line and will allow enabling the
feature on a per-CPU basis where benchmarking shows improvements.

This is modelled after the ARM/AArch64 target.

Reviewers: RKSimon, andreadb, craig.topper

Subscribers: javed.absar, kristof.beyls, hiraditya, ychen, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D67266

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

lib/Target/X86/X86.td
lib/Target/X86/X86Subtarget.h

index 53a05f6a9c42caeb40e445c09015eeda1ccd09ef..d8631aca2734da58ae4e630a3ef4888fe6c8edf1 100644 (file)
@@ -457,6 +457,10 @@ def FeatureMergeToThreeWayBranch : SubtargetFeature<"merge-to-threeway-branch",
                                         "Merge branches to a three-way "
                                         "conditional branch">;
 
+// Enable use of alias analysis during code generation.
+def FeatureUseAA : SubtargetFeature<"use-aa", "UseAA", "true",
+                                    "Use alias analysis during codegen">;
+
 // Bonnell
 def ProcIntelAtom : SubtargetFeature<"", "X86ProcFamily", "IntelAtom", "">;
 // Silvermont
index ce926b40ac3761c67cbed2d19e1c018cc58e735a..4d7495641d9233eca5715e77dc1c44b598a2642d 100644 (file)
@@ -427,6 +427,9 @@ protected:
   /// Use software floating point for code generation.
   bool UseSoftFloat = false;
 
+  /// Use alias analysis during code generation.
+  bool UseAA = false;
+
   /// The minimum alignment known to hold of the stack frame on
   /// entry to the function and which must be maintained by every function.
   unsigned stackAlignment = 4;
@@ -741,6 +744,7 @@ public:
            X86ProcFamily == IntelTRM;
   }
   bool useSoftFloat() const { return UseSoftFloat; }
+  bool useAA() const override { return UseAA; }
 
   /// Use mfence if we have SSE2 or we're on x86-64 (even if we asked for
   /// no-sse2). There isn't any reason to disable it if the target processor