[PATCH] D148957: [AMDGPU] Add intrinsic for converting global pointers to resources

Krzysztof Drewniak via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 3 17:06:25 PDT 2023


krzysz00 marked an inline comment as not done.
krzysz00 added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp:4413-4414
+  MachineInstrBuilder NewHighHalf = Masked;
+  std::optional<ValueAndVReg> StrideConst =
+      getIConstantVRegValWithLookThrough(Stride, MRI);
+  if (!StrideConst.has_value() || !StrideConst->Value.isZero()) {
----------------
arsenm wrote:
> Do you need really need the version that returns APInt and the register, or can you use the one that returns int64_t?
Having looked around, the `APInt` version seems to do things like look through chains of sext/trunc/copy/... and otherwise does that sort of constant folding. That might be worth it?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148957



More information about the llvm-commits mailing list