This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU/R600: Use KCache selection in DAGCombiner
AbandonedPublic

Authored by jvesely on Aug 26 2016, 8:21 AM.

Details

Reviewers
arsenm
Summary

This allows get_global_id to be computed in one ALU clause

Diff Detail

Repository
rL LLVM

Event Timeline

jvesely updated this revision to Diff 69377.Aug 26 2016, 8:21 AM
jvesely retitled this revision from to AMDGPU/R600: Use KCache selection in DAGCombiner.
jvesely updated this object.
arsenm added inline comments.Aug 26 2016, 4:57 PM
lib/Target/AMDGPU/R600ISelLowering.cpp
1750–1752

I don't think you should need to look at the underlying IR value. I assume you should be seeing a GlobalAddressSDNode in the case of the ConstantExpr? You may want to look at isOffsetFoldingLegal

2008–2009

isa<ConstantExpr> should be redundant with isa<Constant>

lib/Target/AMDGPU/R600ISelLowering.h
101

New functions should start with lowercase letter

jvesely planned changes to this revision.Aug 28 2016, 12:35 PM
jvesely added inline comments.
lib/Target/AMDGPU/R600ISelLowering.cpp
1750–1752

This is just a copy of condition from LowerLOAD, so I guess it can use some cleanup.
The only requirement is that the address is compile time constant (I think we could make it work with fixups too), this should not happen with global addresses since those should be lowered to their values in this case.

My reason to have this transformation in combiner was to have intrinsics (specifically r600_implicitarg_ptr) lowered to constants, the constant expr should be: $implicit_arg_offset + $implict_var_offset

jvesely updated this revision to Diff 110830.Aug 11 2017, 6:50 PM

sorry for the long delay.
This patch only handles implicit params, real params and AS laods are left for later.

jvesely edited reviewers, added: arsenm; removed: tstellarAMD.Aug 11 2017, 6:50 PM
jvesely abandoned this revision.Aug 20 2018, 7:40 AM

This patch no longer applies