Skip to content

Conversation

YonahGoldberg
Copy link
Contributor

I noticed a small bug I introduced in the NVVMReflect pass. The Changed variable should be initialized to false, because by default the pass doesn't modify the IR.

@YonahGoldberg
Copy link
Contributor Author

@AlexMaclean @Artem-B

@llvmbot
Copy link
Member

llvmbot commented Apr 23, 2025

@llvm/pr-subscribers-backend-nvptx

Author: Yonah Goldberg (YonahGoldberg)

Changes

I noticed a small bug I introduced in the NVVMReflect pass. The Changed variable should be initialized to false, because by default the pass doesn't modify the IR.


Full diff: https://github.com/llvm/llvm-project/pull/137062.diff

1 Files Affected:

  • (modified) llvm/lib/Target/NVPTX/NVVMReflect.cpp (+1-1)
diff --git a/llvm/lib/Target/NVPTX/NVVMReflect.cpp b/llvm/lib/Target/NVPTX/NVVMReflect.cpp
index 208bab52284a3..5ba4819afcdb5 100644
--- a/llvm/lib/Target/NVPTX/NVVMReflect.cpp
+++ b/llvm/lib/Target/NVPTX/NVVMReflect.cpp
@@ -217,7 +217,7 @@ bool NVVMReflect::runOnModule(Module &M) {
   if (!NVVMReflectEnabled)
     return false;
   populateReflectMap(M);
-  bool Changed = true;
+  bool Changed = false;
   Changed |= handleReflectFunction(M, NVVM_REFLECT_FUNCTION);
   Changed |= handleReflectFunction(M, NVVM_REFLECT_OCL_FUNCTION);
   Changed |=

Copy link
Member

@AlexMaclean AlexMaclean left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants