[PATCH] D15736: AMDGPU/SI: Select non-uniform constant addrspace loads to flat instructions for HSA

Changpeng Fang via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 23 15:48:06 PST 2015

cfang added inline comments.

Comment at: lib/Target/AMDGPU/CIInstructions.td:265
@@ -266,1 +264,3 @@
+def : FlatLoadPat <FLAT_LOAD_DWORDX2, flat_load, v2i32>;
+def : FlatLoadPat <FLAT_LOAD_DWORDX4, flat_load, v4i32>;
tstellarAMD wrote:
> tstellarAMD wrote:
> > Those patterns are redundant now.  I will remove them.
> I looked at this more closely and they actually aren't redundant, because they match flat address space on Kaveri without HSA.
what was redundant is here:
let Predicates = [useFlatForGlobal] in {
def : FlatLoadPat <FLAT_LOAD_DWORD, flat_load, i32>;
I think you should not use "flat_load" here, which including FlatAddress. Instead, you should use "mubuf_load" 


More information about the llvm-commits mailing list