[llvm] Only guard loop metadata that has non-debug info in it (PR #118825)
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 16 10:52:43 PST 2024
================
@@ -461,6 +463,29 @@ bool Instruction::hasPoisonGeneratingMetadata() const {
hasMetadata(LLVMContext::MD_align);
}
+bool Instruction::hasLoopMetadataOtherThanDebugLoc() const {
----------------
dwblaikie wrote:
We usually use the term "NonDebug" for this sort of situation (see: https://github.com/llvm/llvm-project/blob/8ec819e62c22c6086837eb653ae91e76b0e0842b/llvm/include/llvm/IR/Instruction.h#L860, https://github.com/llvm/llvm-project/blob/8ec819e62c22c6086837eb653ae91e76b0e0842b/llvm/include/llvm/IR/Instruction.h#L445, etc)
So probably "hasNonDebugLoopMetadata" might be a good name for this function?
Though it doesn't look like we have a generic way to query "is this MDOperand a debug operand", so just testing for DILocation specifically probably suffices.
https://github.com/llvm/llvm-project/pull/118825
More information about the llvm-commits
mailing list