[polly] 7617445 - [RuntimeDebugBuilder] Remove pointer element type accesses
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 30 05:02:49 PDT 2022
Author: Nikita Popov
Date: 2022-03-30T14:02:41+02:00
New Revision: 76174459acc43d4294beeb445977ef183ff17a6b
URL: https://github.com/llvm/llvm-project/commit/76174459acc43d4294beeb445977ef183ff17a6b
DIFF: https://github.com/llvm/llvm-project/commit/76174459acc43d4294beeb445977ef183ff17a6b.diff
LOG: [RuntimeDebugBuilder] Remove pointer element type accesses
Added:
Modified:
polly/lib/CodeGen/RuntimeDebugBuilder.cpp
Removed:
################################################################################
diff --git a/polly/lib/CodeGen/RuntimeDebugBuilder.cpp b/polly/lib/CodeGen/RuntimeDebugBuilder.cpp
index 05e47e1a48543..680a7ff05982a 100644
--- a/polly/lib/CodeGen/RuntimeDebugBuilder.cpp
+++ b/polly/lib/CodeGen/RuntimeDebugBuilder.cpp
@@ -132,8 +132,7 @@ prepareValuesForPrinting(PollyIRBuilder &Builder, ArrayRef<Value *> Values) {
assert(Ty->getIntegerBitWidth() &&
"Integer types larger 64 bit not supported");
} else if (isa<PointerType>(Ty)) {
- if (Ty->getPointerElementType() == Builder.getInt8Ty() &&
- Ty->getPointerAddressSpace() == 4) {
+ if (Ty == Builder.getInt8PtrTy(4)) {
Val = Builder.CreateGEP(Builder.getInt8Ty(), Val, Builder.getInt64(0));
} else {
Val = Builder.CreatePtrToInt(Val, Builder.getInt64Ty());
@@ -207,11 +206,10 @@ void RuntimeDebugBuilder::createGPUPrinterT(PollyIRBuilder &Builder,
"Integer types larger 64 bit not supported");
// fallthrough
}
- } else if (auto PtTy = dyn_cast<PointerType>(Ty)) {
- if (PtTy->getAddressSpace() == 4) {
+ } else if (isa<PointerType>(Ty)) {
+ if (Ty == Builder.getInt8PtrTy(4)) {
// Pointers in constant address space are printed as strings
- Val = Builder.CreateGEP(Ty->getPointerElementType(), Val,
- Builder.getInt64(0));
+ Val = Builder.CreateGEP(Builder.getInt8Ty(), Val, Builder.getInt64(0));
auto F = RuntimeDebugBuilder::getAddressSpaceCast(Builder, 4, 0);
Val = Builder.CreateCall(F, Val);
} else {
More information about the llvm-commits
mailing list