[PATCH] D146287: [AMDGPU][GISel] Add inverse ballot intrinsic

Diana Picus via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 20 05:01:28 PDT 2023


rovka added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIISelLowering.cpp:4497
+    if (!IsVALU) {
+      BuildMI(*BB, &MI, DL, TII->get(AMDGPU::COPY), DstReg).addReg(MaskReg);
+      MI.eraseFromParent();
----------------
Nit: Most of this looks the same for GlobalISel, could you try to extract a helper function to use for both? 


================
Comment at: llvm/test/CodeGen/AMDGPU/GlobalISel/llvm.amdgcn.inverse.ballot.i32.ll:3
+; RUN: llc -march=amdgcn -mcpu=gfx1010 -mattr=+wavefrontsize32,-wavefrontsize64 -global-isel -amdgpu-global-isel-risky-select -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX10 %s
+; RUN: llc -march=amdgcn -mcpu=gfx1100 -amdgpu-enable-delay-alu=0 -mattr=+wavefrontsize32,-wavefrontsize64 -global-isel -amdgpu-global-isel-risky-select -verify-machineinstrs < %s | FileCheck  -check-prefixes=GFX11 %s
+
----------------
I have 2 nits here:
1. Why go all the way to assembly? You could -stop-after=finalize-isel (or even before it). You'll probably have to use update_mir_test_checks.py though.
2. There's precedent for having a single test with -global-isel=0 and -global-isel=1 RUN lines, so you don't really need separate files in this directory.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146287



More information about the llvm-commits mailing list