[PATCH] D31103: [AMDGPU] Add address space based alias analysis pass

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 17 14:26:18 PDT 2017


arsenm added inline comments.


================
Comment at: lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp:1
+#include "AMDGPU.h"
+#include "AMDGPUAliasAnalysis.h"
----------------
Missing comment


================
Comment at: lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp:13
+
+#define DEBUG_TYPE "hsail-aa"
+
----------------
doesn't match pass name


================
Comment at: lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp:15-17
+static cl::opt<bool> EnableAMDGPUAliasAnalysis("enable-amdgpu-aa", cl::Hidden,
+  cl::desc("Enable AMDGPU Alias Analysis"),
+  cl::init(true));
----------------
Should move this to the TargetMachine when adding it


================
Comment at: lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp:58-59
+  if (isa<Argument>(LocA.Ptr) && isa<Argument>(LocB.Ptr)) {
+    Type *T1 = dyn_cast<PointerType>(LocA.Ptr->getType())->getElementType();
+    Type *T2 = dyn_cast<PointerType>(LocB.Ptr->getType())->getElementType();
+
----------------
Use cast<> if not checking it


================
Comment at: lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp:71
+                                            bool OrLocal)
+{
+  if (!EnableAMDGPUAliasAnalysis)
----------------
formatting


================
Comment at: lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp:78
+
+  if(Base->getType()->getPointerAddressSpace() ==
+     AMDGPUAS::AddressSpaces::CONSTANT_ADDRESS) {
----------------
Missin space


================
Comment at: lib/Target/AMDGPU/AMDGPUAliasAnalysis.h:1-2
+#ifndef LLVM_ANALYSIS_AMDGPUALIASANALYSIS_H
+#define LLVM_ANALYSIS_AMDGPUALIASANALYSIS_H
+
----------------
Missing comment


Repository:
  rL LLVM

https://reviews.llvm.org/D31103





More information about the llvm-commits mailing list