[PATCH] D21684: AMDGPU/SI: Simplify address space checks in AMDGPUDAGToDAGISel

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 24 08:45:06 PDT 2016


arsenm added inline comments.

================
Comment at: lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp:492-494
@@ -494,15 +491,5 @@
 
-bool AMDGPUDAGToDAGISel::checkType(const Value *Ptr, unsigned AS) {
-  assert(AS != 0 && "Use checkPrivateAddress instead.");
-  if (!Ptr)
-    return false;
-
-  return Ptr->getType()->getPointerAddressSpace() == AS;
-}
-
 bool AMDGPUDAGToDAGISel::isGlobalStore(const MemSDNode *N) {
-  if (!N->writeMem())
-    return false;
-  return checkType(N->getMemOperand()->getValue(), AMDGPUAS::GLOBAL_ADDRESS);
+  return N->writeMem() && N->getAddressSpace() == AMDGPUAS::GLOBAL_ADDRESS;
 }
 
----------------
I've been planning on removing these entirely. There's no reason this can't be done in tablegen and some of the address space checks are already there


http://reviews.llvm.org/D21684





More information about the llvm-commits mailing list