From 750e1c8dbd935eab739544bcea86e2140f2b9109 Mon Sep 17 00:00:00 2001 From: Ron Lieberman Date: Tue, 3 Jan 2023 12:26:39 -0600 Subject: [PATCH] Revert "[libomptarget][plugin-nextgen] fix for [TypePromotion] NewPM support." This reverts commit 135f6a1ee8b20bb392ebad2fa5aef78e3a30ddb4. --- llvm/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp | 11 ++++++++++- .../plugins-nextgen/common/PluginInterface/JIT.cpp | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp b/llvm/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp index 2775d06..92fd7bc 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp @@ -133,7 +133,16 @@ void AMDGPUPrintfRuntimeBindingImpl::getConversionSpecifiers( bool AMDGPUPrintfRuntimeBindingImpl::shouldPrintAsStr(char Specifier, Type *OpType) const { - return Specifier == 's' && isa(OpType); + if (Specifier != 's') + return false; + const PointerType *PT = dyn_cast(OpType); + if (!PT || PT->getAddressSpace() != AMDGPUAS::CONSTANT_ADDRESS) + return false; + Type *ElemType = PT->getContainedType(0); + if (ElemType->getTypeID() != Type::IntegerTyID) + return false; + IntegerType *ElemIType = cast(ElemType); + return ElemIType->getBitWidth() == 8; } bool AMDGPUPrintfRuntimeBindingImpl::lowerPrintfForGpu(Module &M) { diff --git a/openmp/libomptarget/plugins-nextgen/common/PluginInterface/JIT.cpp b/openmp/libomptarget/plugins-nextgen/common/PluginInterface/JIT.cpp index 893f4b1..7cc1bb8 100644 --- a/openmp/libomptarget/plugins-nextgen/common/PluginInterface/JIT.cpp +++ b/openmp/libomptarget/plugins-nextgen/common/PluginInterface/JIT.cpp @@ -107,7 +107,7 @@ void init(Triple TT) { initializeWasmEHPreparePass(Registry); initializeWriteBitcodePassPass(Registry); initializeHardwareLoopsPass(Registry); - initializeTypePromotionLegacyPass(Registry); + initializeTypePromotionPass(Registry); initializeReplaceWithVeclibLegacyPass(Registry); initializeJMCInstrumenterPass(Registry); } -- 2.7.4