[PATCH] D59990: AMDGPU. Divergence driven ISel. Assign register class for cross block values according to the divergence.

Nicolai Hähnle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 15 07:51:55 PDT 2019


nhaehnle added a comment.

Okay, you've convinced me. I only hope we can move forward with GlobalISel and do it right there.

There are still some formatting issues, but apart from that I think the patch is good.



================
Comment at: include/llvm/CodeGen/TargetRegisterInfo.h:524-526
+  virtual bool isDivergentRegClass(const TargetRegisterClass *RC) const {
+    return false;
+  }
----------------
alex-t wrote:
> nhaehnle wrote:
> > This function is problematic because we can't actually tell for a given register class whether the underlying value is divergent or not. Specifically, 64-bit SGPRs can be either uniform or divergent depending on whether it's the lowering of an i1 or an i64.
> > 
> This is not about the underlying value at all. 
> This is a way to ask the target does it consider given register class as uniform or divergent.
> In other words:  we cannot expose the concrete register class properties to the common code.
> From the other hand, the instruction description structure is common and it maps operand to register class.
> While emitting the instruction we want to consult the target if the given operand required to be assigned the divergent (aka VGPR) register. This is not because of the value divergence but because the selected instruction.
Another way to look at it is that my misunderstanding of the point of the function is precisely why the name is so misleading :)


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

https://reviews.llvm.org/D59990





More information about the llvm-commits mailing list