[PATCH] D86498: AMDGPU/GlobalISel: Partially move constant selection to patterns

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 27 06:33:25 PDT 2020


arsenm added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUGISel.td:312-314
+def gi_bitcast_fpimm_to_i32 : GICustomOperandRenderer<"renderBitcastFPImm32">,
   GISDNodeXFormEquiv<bitcast_fpimm_to_i32>;
+def gi_bitcast_fpimm_to_i64 : GICustomOperandRenderer<"renderBitcastFPImm64">,
----------------
foad wrote:
> Can't you call renderBitcastFPImm directly and avoid the 32/64 wrapper functions?
No, the emitter doesn't handle reusing the same function


================
Comment at: llvm/lib/Target/AMDGPU/SIInstrInfo.td:760
+}]> {
+  let GISelPredicateCode = [{return true;}];
+}
----------------
foad wrote:
> Why is this needed? Perhaps add a comment? In other cases where you've done this it's because there's a PredicateCode that might return false, but I don't see that here.
Because patterns with custom predicate code that don't have the gisel equivalent aren't imported. We need an IgnoreCodePredicate field or something to avoid this. I'm also pretty sure we don't need this specific predicate in SelectionDAG either and don't remember why we have it


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

https://reviews.llvm.org/D86498



More information about the llvm-commits mailing list