[llvm] e65e7b2 - [llvm][LowerConstantIntrinsics] add debug statements
Nick Desaulniers via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 1 13:00:31 PST 2023
Author: Nick Desaulniers
Date: 2023-03-01T12:58:18-08:00
New Revision: e65e7b27fdcc286c799e748fa51dccdf39321ee3
URL: https://github.com/llvm/llvm-project/commit/e65e7b27fdcc286c799e748fa51dccdf39321ee3
DIFF: https://github.com/llvm/llvm-project/commit/e65e7b27fdcc286c799e748fa51dccdf39321ee3.diff
LOG: [llvm][LowerConstantIntrinsics] add debug statements
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 ...
Reviewed By: void
Differential Revision: https://reviews.llvm.org/D143521
Added:
Modified:
llvm/lib/Transforms/Scalar/LowerConstantIntrinsics.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Scalar/LowerConstantIntrinsics.cpp b/llvm/lib/Transforms/Scalar/LowerConstantIntrinsics.cpp
index ef22b0401b1b..b167120a906d 100644
--- a/llvm/lib/Transforms/Scalar/LowerConstantIntrinsics.cpp
+++ b/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 @@ static bool lowerConstantIntrinsics(Function &F, const TargetLibraryInfo &TLI,
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;
}
More information about the llvm-commits
mailing list