[llvm] [NVPTX][NFC] Refactoring and cleanup in NVPTXISelLowering (PR #137222)

Artem Belevich via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 24 14:41:14 PDT 2025


================
@@ -3388,49 +3373,55 @@ SDValue NVPTXTargetLowering::LowerFormalArguments(
   //     individually present in Ins.
   // So a different index should be used for indexing into Ins.
   // See similar issue in LowerCall.
-  unsigned InsIdx = 0;
+  const auto *In = Ins.begin();
----------------
Artem-B wrote:

I wonder if it would be more convenient to use an index into `Ins` instead of an iterator.
Debugging this code in the past, it was always a bit of a pain figuring out which part advanced how far based on the current pointer. Having an index makes it a bit easier to examine things -- you can easily see where things go off-track.

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


More information about the llvm-commits mailing list