[PATCH] D143521: [llvm][LowerConstantIntrinsics] add debug statements
Nick Desaulniers via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 7 11:50:32 PST 2023
nickdesaulniers created this revision.
nickdesaulniers added a reviewer: void.
Herald added a subscriber: hiraditya.
Herald added a project: All.
nickdesaulniers requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
These can help us better understand what __builtin_constant_p and
__builtin_object_size get folded to.
$ clang -mllvm -debug-only=lower-is-constant-intrinsic ...
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D143521
Files:
llvm/lib/Transforms/Scalar/LowerConstantIntrinsics.cpp
Index: llvm/lib/Transforms/Scalar/LowerConstantIntrinsics.cpp
===================================================================
--- llvm/lib/Transforms/Scalar/LowerConstantIntrinsics.cpp
+++ llvm/lib/Transforms/Scalar/LowerConstantIntrinsics.cpp
@@ -29,6 +29,7 @@
#include "llvm/IR/PatternMatch.h"
#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
+#include "llvm/Support/Debug.h"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Utils/Local.h"
#include <optional>
@@ -136,10 +137,12 @@
continue;
case Intrinsic::is_constant:
NewValue = lowerIsConstantIntrinsic(II);
+ LLVM_DEBUG(dbgs() << "Folding " << *II << " to " << *NewValue << "\n");
IsConstantIntrinsicsHandled++;
break;
case Intrinsic::objectsize:
NewValue = lowerObjectSizeCall(II, DL, &TLI, true);
+ LLVM_DEBUG(dbgs() << "Folding " << *II << " to " << *NewValue << "\n");
ObjectSizeIntrinsicsHandled++;
break;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D143521.495604.patch
Type: text/x-patch
Size: 976 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230207/9449aef3/attachment.bin>
More information about the llvm-commits
mailing list