[llvm] [NVPTX] Teach NVPTX about predicates (PR #67468)

Fraser Cormack via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 29 03:03:07 PDT 2024


================
@@ -29,6 +29,9 @@ using namespace llvm;
 #define DEBUG_TYPE "nvptx-isel"
 #define PASS_NAME "NVPTX DAG->DAG Pattern Instruction Selection"
 
+#define PRED(reg) (CurDAG->getRegister((reg), MVT::i32))
+#define SW(val) (CurDAG->getTargetConstant((val), SDLoc(N), MVT::i1))
----------------
frasercrmck wrote:

Might having an implicit "capture" of `N` here cause some misplaced debug locs?

We already have a `getI32Imm` helper function in `NVPTXISelDAGToDAG.h` which do take in a `SDLoc` as a parameter: perhaps these two should follow that model.

https://github.com/llvm/llvm-project/pull/67468


More information about the llvm-commits mailing list