Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SystemZ][z/OS] Open YAML files for read as text files #121340

Merged
merged 1 commit into from
Dec 31, 2024

Conversation

zibi2
Copy link
Contributor

@zibi2 zibi2 commented Dec 30, 2024

This patch makes sure YAML files are opened for reading as text file to trigger auto-conversion from EBCDIC encoding into expected ASCII encoding on z/OS platform. This is required to fix the following lit tests:

LLVM :: tools/llvm-gsymutil/ARM_AArch64/macho-gsym-callsite-info-exe.yaml
LLVM :: tools/llvm-gsymutil/ARM_AArch64/macho-gsym-callsite-info-obj.test
LLVM :: tools/llvm-gsymutil/ARM_AArch64/macho-gsym-callsite-info-dsym.yaml
LLVM :: Transforms/PGOProfile/memprof_undrift_missing_leaf.ll

@zibi2 zibi2 self-assigned this Dec 30, 2024
@llvmbot llvmbot added debuginfo PGO Profile Guided Optimizations labels Dec 30, 2024
@llvmbot
Copy link
Member

llvmbot commented Dec 30, 2024

@llvm/pr-subscribers-pgo

@llvm/pr-subscribers-debuginfo

Author: Zibi Sarbinowski (zibi2)

Changes

This patch makes sure YAML files are opened for reading as text file to trigger auto-conversion from EBCDIC encoding into expected ASCII encoding on z/OS platform. This is required to fix the following lit tests:

LLVM :: tools/llvm-gsymutil/ARM_AArch64/macho-gsym-callsite-info-exe.yaml
LLVM :: tools/llvm-gsymutil/ARM_AArch64/macho-gsym-callsite-info-obj.test
LLVM :: tools/llvm-gsymutil/ARM_AArch64/macho-gsym-callsite-info-dsym.yaml
LLVM :: Transforms/PGOProfile/memprof_undrift_missing_leaf.ll

Full diff: https://github.com/llvm/llvm-project/pull/121340.diff

2 Files Affected:

  • (modified) llvm/lib/DebugInfo/GSYM/CallSiteInfo.cpp (+1-1)
  • (modified) llvm/lib/ProfileData/MemProfReader.cpp (+2-2)
diff --git a/llvm/lib/DebugInfo/GSYM/CallSiteInfo.cpp b/llvm/lib/DebugInfo/GSYM/CallSiteInfo.cpp
index 85b41e28991316..c112c0bc3ddc9d 100644
--- a/llvm/lib/DebugInfo/GSYM/CallSiteInfo.cpp
+++ b/llvm/lib/DebugInfo/GSYM/CallSiteInfo.cpp
@@ -151,7 +151,7 @@ LLVM_YAML_IS_SEQUENCE_VECTOR(FunctionYAML)
 
 Error CallSiteInfoLoader::loadYAML(StringRef YAMLFile) {
   // Step 1: Read YAML file
-  auto BufferOrError = MemoryBuffer::getFile(YAMLFile);
+  auto BufferOrError = MemoryBuffer::getFile(YAMLFile, /*IsText=*/true);
   if (!BufferOrError)
     return errorCodeToError(BufferOrError.getError());
 
diff --git a/llvm/lib/ProfileData/MemProfReader.cpp b/llvm/lib/ProfileData/MemProfReader.cpp
index 10c36f25c4b795..6a4fecd5ae05e8 100644
--- a/llvm/lib/ProfileData/MemProfReader.cpp
+++ b/llvm/lib/ProfileData/MemProfReader.cpp
@@ -754,7 +754,7 @@ Error RawMemProfReader::readNextRecord(
 
 Expected<std::unique_ptr<YAMLMemProfReader>>
 YAMLMemProfReader::create(const Twine &Path) {
-  auto BufferOr = MemoryBuffer::getFileOrSTDIN(Path);
+  auto BufferOr = MemoryBuffer::getFileOrSTDIN(Path, /*IsText=*/true);
   if (std::error_code EC = BufferOr.getError())
     return report(errorCodeToError(EC), Path.getSingleStringRef());
 
@@ -770,7 +770,7 @@ YAMLMemProfReader::create(std::unique_ptr<MemoryBuffer> Buffer) {
 }
 
 bool YAMLMemProfReader::hasFormat(const StringRef Path) {
-  auto BufferOr = MemoryBuffer::getFileOrSTDIN(Path);
+  auto BufferOr = MemoryBuffer::getFileOrSTDIN(Path, /*IsText=*/true);
   if (!BufferOr)
     return false;
 

@alx32
Copy link
Contributor

alx32 commented Dec 30, 2024

LGTM. Thanks for fixing !

@zibi2 zibi2 merged commit 1d51546 into llvm:main Dec 31, 2024
11 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Dec 31, 2024

LLVM Buildbot has detected a new failure on builder llvm-clang-x86_64-darwin running on doug-worker-3 while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/23/builds/6219

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: 1200 seconds without output running [b'ninja', b'check-all'], attempting to kill
...
UNSUPPORTED: mlgo-utils :: corpus/extract_ir_test.py (80736 of 80746)
UNSUPPORTED: mlgo-utils :: corpus/make_corpus_test.py (80737 of 80746)
UNSUPPORTED: mlgo-utils :: pytype.test (80738 of 80746)
PASS: lld :: MachO/x86-64-stubs.s (80739 of 80746)
PASS: lld :: MachO/zippered.yaml (80740 of 80746)
PASS: lld :: MachO/weak-reference.s (80741 of 80746)
PASS: lld :: MinGW/lib.test (80742 of 80746)
PASS: lld :: MachO/weak-definition-direct-fetch.s (80743 of 80746)
PASS: lld :: MinGW/driver.test (80744 of 80746)
PASS: lit :: shtest-define.py (80745 of 80746)
command timed out: 1200 seconds without output running [b'ninja', b'check-all'], attempting to kill
process killed by signal 9
program finished with exit code -1
elapsedTime=2637.489704

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debuginfo PGO Profile Guided Optimizations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants