[libomptarget][plugin-nextgen] fix for [TypePromotion] NewPM support.
authorRon Lieberman <ron.lieberman@amd.com>
Tue, 3 Jan 2023 17:04:13 +0000 (11:04 -0600)
committerRon Lieberman <ron.lieberman@amd.com>
Tue, 3 Jan 2023 17:04:13 +0000 (11:04 -0600)
llvm/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp
openmp/libomptarget/plugins-nextgen/common/PluginInterface/JIT.cpp

index 92fd7bc..2775d06 100644 (file)
@@ -133,16 +133,7 @@ void AMDGPUPrintfRuntimeBindingImpl::getConversionSpecifiers(
 
 bool AMDGPUPrintfRuntimeBindingImpl::shouldPrintAsStr(char Specifier,
                                                       Type *OpType) const {
-  if (Specifier != 's')
-    return false;
-  const PointerType *PT = dyn_cast<PointerType>(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<IntegerType>(ElemType);
-  return ElemIType->getBitWidth() == 8;
+  return Specifier == 's' && isa<PointerType>(OpType);
 }
 
 bool AMDGPUPrintfRuntimeBindingImpl::lowerPrintfForGpu(Module &M) {
index 7cc1bb8..893f4b1 100644 (file)
@@ -107,7 +107,7 @@ void init(Triple TT) {
   initializeWasmEHPreparePass(Registry);
   initializeWriteBitcodePassPass(Registry);
   initializeHardwareLoopsPass(Registry);
-  initializeTypePromotionPass(Registry);
+  initializeTypePromotionLegacyPass(Registry);
   initializeReplaceWithVeclibLegacyPass(Registry);
   initializeJMCInstrumenterPass(Registry);
 }