Skip to content

[SandboxIR] Add more Instruction member functions #98588

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

Merged
merged 1 commit into from
Jul 16, 2024
Merged

Conversation

vporpo
Copy link
Contributor

@vporpo vporpo commented Jul 12, 2024

This patch adds new Instruction member functions, including:

  • getNextNode()
  • getPrevNode()
  • getOpcode()
  • removeFromParent()
  • eraseFromParent()
  • getParent()
  • insertBefore()
  • insertAfter()
  • insertInto()
  • moveBefore()
  • moveAfter()

Copy link
Contributor

@aeubanks aeubanks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be useful to have a README that explains the high level design, perhaps even updating it as we land PRs

return;
auto *LLVMBB = cast<llvm::BasicBlock>(BB.Val);
llvm::BasicBlock::iterator It;
if (WhereIt == BB.end())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

braces

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

}

std::unique_ptr<Value> Context::detach(Value *V) {
#ifndef NDEBUG
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assert(V->getSubclassID() != Constant && "");
assert(V->getSubclassID() != User && "");

is much shorter

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

return BasicBlock::iterator(I->getParent(), I->getIterator(), &Ctx);
}

Instruction *Instruction::getNextNode() const {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this necessary? this is part of ilist_node_with_parent, so the name doesn't really make sense here. if we do want to support this operation, I'd at least rename it to something like getNextInstruction()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well getNextNode() is part of the Instruction API, so the user expects it to be there. So I am not sure we should remove it, or use a different name for a function that does the same thing. Perhaps we could have both getNextInstruction() and getNextNode()? Wdyt?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still think that Node is an implementation detail and we can just have getNextInstruction(), but don't feel that strongly. This is fine for now.

assert(getIterator() != getParent()->end() && "Already at end!");
auto *LLVMI = cast<llvm::Instruction>(Val);
assert(LLVMI->getParent() != nullptr && "LLVM IR instr is detached!");
auto *NextLLVMI = LLVMI->getNextNode();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about multi-instruction instructions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So here is how this works: NextLLVMI is an LLVM instruction that belongs to the next SandboxIR instruction, whether it's a single-Instruction or multi-Instruction. If it's a multi-Instruction, then NextLLVMI will be the topmost LLVM instruction. In either case Ctxt.getValue(NextLLVMI) returns the correct SandboxIR Instruction that maps to NextLLVMI. Does this make sense?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant if this is a multi-instruction, then NextLLVMI will point to the second LLVM instruction in this. Or are you going to override getNextNode() in the multi-instruction subclass?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah the confusing part is that Val always points to the bottom LLVM Instruction of a sandboxir::Instruction, not the topmost one.
So if this is a multi-instruction, LLVMI is the bottom-most LLVM Instruction in this, so LLVMI->getNextNode() points to an LLVM instruction that does not belong to this, but instead to the next sandboxir::Instruction.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh I see. can you update the comments around Val (separate PR) to say that?

@tschuett
Copy link

README.md would be great, but could you put a minimal SandboxIR.rst file in https://github.com/llvm/llvm-project/tree/main/llvm/docs

@vporpo
Copy link
Contributor Author

vporpo commented Jul 12, 2024

it would be useful to have a README that explains the high level design, perhaps even updating it as we land PRs

I agree, there is no information about the design at this point. Perhaps an llvm/docs/SandboxIR.rst ? Wdyt?

@aeubanks
Copy link
Contributor

in llvm/docs sgtm, although please use markdown instead of rst, rst is kinda bad

@tschuett
Copy link

@aeubanks
Copy link
Contributor

rst is the default. There is no markdown. https://github.com/llvm/llvm-project/blob/main/llvm/docs/SphinxQuickstartTemplate.rst

there are multiple .md files in llvm/docs that are rendered, e.g. https://llvm.org/docs/AssignmentTracking.html comes from llvm/docs/AssignmentTracking.md

@tschuett
Copy link

The README.md states LLVM's documentation is written in reStructuredText, a lightweight plaintext markup language (file extension .rst).

It = WhereI->getTopmostLLVMInstruction()->getIterator();
}
auto IRInstrsInProgramOrder(getLLVMInstrs());
sort(IRInstrsInProgramOrder,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we enforce that getLLVMInstrs() returns the instructions in program order so we don't need to sort here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think it makes sense, but what is a good way of enforcing it? I guess we can always add an assert(is_sorted()) in moveBefore().

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe in some verify method?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that should work.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Supporting this in the verifier is not trivial, so I will keep an assertion in moveBefore() for now.

Instruction *BeforeI;
llvm::BasicBlock::iterator LLVMBeforeIt;
if (WhereIt != BB->end()) {
BeforeI = &*WhereIt;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inline BeforeI?

assert(getIterator() != getParent()->end() && "Already at end!");
auto *LLVMI = cast<llvm::Instruction>(Val);
assert(LLVMI->getParent() != nullptr && "LLVM IR instr is detached!");
auto *NextLLVMI = LLVMI->getNextNode();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant if this is a multi-instruction, then NextLLVMI will point to the second LLVM instruction in this. Or are you going to override getNextNode() in the multi-instruction subclass?

assert(getIterator() != getParent()->end() && "Already at end!");
auto *LLVMI = cast<llvm::Instruction>(Val);
assert(LLVMI->getParent() != nullptr && "LLVM IR instr is detached!");
auto *NextLLVMI = LLVMI->getNextNode();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh I see. can you update the comments around Val (separate PR) to say that?

return BasicBlock::iterator(I->getParent(), I->getIterator(), &Ctx);
}

Instruction *Instruction::getNextNode() const {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still think that Node is an implementation detail and we can just have getNextInstruction(), but don't feel that strongly. This is fine for now.

@@ -623,6 +670,12 @@ class Context {
DenseMap<llvm::Value *, std::unique_ptr<sandboxir::Value>>
LLVMValueToValueMap;

/// Remove \p V from the maps and returns the unique_ptr.
std::unique_ptr<Value> detachLLVMValue(llvm::Value *V);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm debating whether or not this should have [[nodiscard]]. Unsure how pervasive you'd want [[nodiscard]] to be throughout these APIs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't feel strongly either way, but these detach() functions are meant to be used either for detaching or for just deleting the value. I think it's currently only used for deleting them, so the value is discarded. There is no real harm in discarding the returned value as far as I can tell.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we wanted to keep around Values in case we rollback

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These APIs are for internal use only. The user won't be able to detach values. The only way a user can delete a value is through the eraseFromParent() API, and this will be tracked and can be rolled back.

This patch adds new Instruction member functions, including:
- getNextNode()
- getPrevNode()
- getOpcode()
- removeFromParent()
- eraseFromParent()
- getParent()
- insertBefore()
- insertAfter()
- insertInto()
- moveBefore()
- moveAfter()
@vporpo vporpo merged commit 618b0b7 into llvm:main Jul 16, 2024
7 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 16, 2024

LLVM Buildbot has detected a new failure on builder llvm-nvptx-nvidia-ubuntu running on as-builder-7 while building llvm at step 6 "test-build-unified-tree-check-llvm".

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

Here is the relevant piece of the build log for the reference:

Step 6 (test-build-unified-tree-check-llvm) failure: test (failure)
******************** TEST 'LLVM-Unit :: SandboxIR/./SandboxIRTests/7/8' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/build/unittests/SandboxIR/./SandboxIRTests-LLVM-Unit-3304920-7-8.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=8 GTEST_SHARD_INDEX=7 /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/build/unittests/SandboxIR/./SandboxIRTests
--

Note: This is test shard 8 of 8.
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from SandboxIRTest
[ RUN      ] SandboxIRTest.Instruction
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  libLLVMSupport.so.19.0git     0x000075b32a5e5c70 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 240
1  libLLVMSupport.so.19.0git     0x000075b32a5e308f llvm::sys::RunSignalHandlers() + 47
2  libLLVMSupport.so.19.0git     0x000075b32a5e31e5
3  libc.so.6                     0x000075b329c42520
4  libLLVMCore.so.19.0git        0x000075b32a9b6572 llvm::Instruction::eraseFromParent() + 18
5  libLLVMSandboxIR.so.19.0git   0x000075b32ad1010e llvm::sandboxir::Instruction::eraseFromParent() + 206
6  SandboxIRTests                0x000057a22655d006
7  libllvm_gtest.so.19.0git      0x000075b32a6ebcd3
8  libllvm_gtest.so.19.0git      0x000075b32a6fa702 testing::TestInfo::Run() + 722
9  libllvm_gtest.so.19.0git      0x000075b32a6faca1
10 libllvm_gtest.so.19.0git      0x000075b32a709eea testing::internal::UnitTestImpl::RunAllTests() + 2842
11 libllvm_gtest.so.19.0git      0x000075b32a6eabbf testing::UnitTest::Run() + 143
12 libllvm_gtest_main.so.19.0git 0x000075b32a736bba main + 106
13 libc.so.6                     0x000075b329c29d90
14 libc.so.6                     0x000075b329c29e40 __libc_start_main + 128
15 SandboxIRTests                0x000057a22654f775

--
exit: -11
--
shard JSON output does not exist: /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/build/unittests/SandboxIR/./SandboxIRTests-LLVM-Unit-3304920-7-8.json
********************


@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 16, 2024

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

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

Here is the relevant piece of the build log for the reference:

Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM-Unit :: SandboxIR/./SandboxIRTests/7/8' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/unittests/SandboxIR/./SandboxIRTests-LLVM-Unit-3453548-7-8.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=8 GTEST_SHARD_INDEX=7 /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/unittests/SandboxIR/./SandboxIRTests
--

Note: This is test shard 8 of 8.
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from SandboxIRTest
[ RUN      ] SandboxIRTest.Instruction
 #0 0x00005d0eacf9e8a0 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/unittests/SandboxIR/./SandboxIRTests+0x2ac8a0)
 #1 0x00005d0eacf9c1af llvm::sys::RunSignalHandlers() (/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/unittests/SandboxIR/./SandboxIRTests+0x2aa1af)
 #2 0x00005d0eacf9c305 SignalHandler(int) Signals.cpp:0:0
 #3 0x000075d689034520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x00005d0eace9b3d2 llvm::Instruction::eraseFromParent() (/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/unittests/SandboxIR/./SandboxIRTests+0x1a93d2)
 #5 0x00005d0eacdda7be llvm::sandboxir::Instruction::eraseFromParent() (/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/unittests/SandboxIR/./SandboxIRTests+0xe87be)
 #6 0x00005d0eacd6df86 SandboxIRTest_Instruction_Test::TestBody() (/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/unittests/SandboxIR/./SandboxIRTests+0x7bf86)
 #7 0x00005d0eacfb4b83 testing::Test::Run() (.part.0) gtest-all.cc:0:0
 #8 0x00005d0eacfbf402 testing::TestInfo::Run() (/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/unittests/SandboxIR/./SandboxIRTests+0x2cd402)
 #9 0x00005d0eacfbf9a1 testing::TestSuite::Run() (.part.0) gtest-all.cc:0:0
#10 0x00005d0eacfca37a testing::internal::UnitTestImpl::RunAllTests() (/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/unittests/SandboxIR/./SandboxIRTests+0x2d837a)
#11 0x00005d0eacfb3eef testing::UnitTest::Run() (/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/unittests/SandboxIR/./SandboxIRTests+0x2c1eef)
#12 0x00005d0eacd5ca8a main (/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/unittests/SandboxIR/./SandboxIRTests+0x6aa8a)
#13 0x000075d68901bd90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#14 0x000075d68901be40 call_init ./csu/../csu/libc-start.c:128:20
#15 0x000075d68901be40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#16 0x00005d0eacd606f5 _start (/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/unittests/SandboxIR/./SandboxIRTests+0x6e6f5)

--
exit: -11
--
shard JSON output does not exist: /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/unittests/SandboxIR/./SandboxIRTests-LLVM-Unit-3453548-7-8.json
********************


@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 16, 2024

LLVM Buildbot has detected a new failure on builder openmp-offload-sles-build-only running on rocm-worker-hw-04-sles while building llvm at step 8 "Add check check-llvm".

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

Here is the relevant piece of the build log for the reference:

Step 8 (Add check check-llvm) failure: test (failure)
******************** TEST 'LLVM-Unit :: SandboxIR/./SandboxIRTests/7/8' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/unittests/SandboxIR/./SandboxIRTests-LLVM-Unit-1251877-7-8.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=8 GTEST_SHARD_INDEX=7 /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/unittests/SandboxIR/./SandboxIRTests
--

Note: This is test shard 8 of 8.
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from SandboxIRTest
[ RUN      ] SandboxIRTest.Instruction
 #0 0x000000000061bdf8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/unittests/SandboxIR/./SandboxIRTests+0x61bdf8)
 #1 0x00000000006198fc SignalHandler(int) Signals.cpp:0:0
 #2 0x00007f5b1e456910 __restore_rt (/lib64/libpthread.so.0+0x16910)
 #3 0x0000000000507b0d llvm::DbgMarker::removeMarker() (/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/unittests/SandboxIR/./SandboxIRTests+0x507b0d)
 #4 0x00000000005229de llvm::Instruction::eraseFromParent() (/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/unittests/SandboxIR/./SandboxIRTests+0x5229de)
 #5 0x000000000047c04c llvm::sandboxir::Instruction::eraseFromParent() (/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/unittests/SandboxIR/./SandboxIRTests+0x47c04c)
 #6 0x000000000041b6a8 SandboxIRTest_Instruction_Test::TestBody() (/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/unittests/SandboxIR/./SandboxIRTests+0x41b6a8)
 #7 0x000000000062c998 testing::Test::Run() (.part.1013) gtest-all.cc:0:0
 #8 0x00000000006383e2 testing::TestInfo::Run() (/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/unittests/SandboxIR/./SandboxIRTests+0x6383e2)
 #9 0x0000000000640037 testing::TestSuite::Run() (.part.1016) gtest-all.cc:0:0
#10 0x0000000000640add testing::internal::UnitTestImpl::RunAllTests() (/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/unittests/SandboxIR/./SandboxIRTests+0x640add)
#11 0x0000000000640f81 testing::UnitTest::Run() (/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/unittests/SandboxIR/./SandboxIRTests+0x640f81)
#12 0x0000000000411555 main (/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/unittests/SandboxIR/./SandboxIRTests+0x411555)
#13 0x00007f5b1dd6f24d __libc_start_main (/lib64/libc.so.6+0x3524d)
#14 0x0000000000411dea _start /home/abuild/rpmbuild/BUILD/glibc-2.31/csu/../sysdeps/x86_64/start.S:122:0

--
exit: -7
--
shard JSON output does not exist: /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/unittests/SandboxIR/./SandboxIRTests-LLVM-Unit-1251877-7-8.json
********************


vporpo added a commit that referenced this pull request Jul 16, 2024
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 16, 2024

LLVM Buildbot has detected a new failure on builder llvm-nvptx64-nvidia-ubuntu running on as-builder-7 while building llvm at step 6 "test-build-unified-tree-check-llvm".

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

Here is the relevant piece of the build log for the reference:

Step 6 (test-build-unified-tree-check-llvm) failure: test (failure)
******************** TEST 'LLVM-Unit :: SandboxIR/./SandboxIRTests/7/8' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/build/unittests/SandboxIR/./SandboxIRTests-LLVM-Unit-3864293-7-8.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=8 GTEST_SHARD_INDEX=7 /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/build/unittests/SandboxIR/./SandboxIRTests
--

Note: This is test shard 8 of 8.
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from SandboxIRTest
[ RUN      ] SandboxIRTest.Instruction
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  libLLVMSupport.so.19.0git     0x00007286bc04cc70 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 240
1  libLLVMSupport.so.19.0git     0x00007286bc04a08f llvm::sys::RunSignalHandlers() + 47
2  libLLVMSupport.so.19.0git     0x00007286bc04a1e5
3  libc.so.6                     0x00007286bb842520
4  libLLVMCore.so.19.0git        0x00007286bc41d582 llvm::Instruction::eraseFromParent() + 18
5  libLLVMSandboxIR.so.19.0git   0x00007286bc77710e llvm::sandboxir::Instruction::eraseFromParent() + 206
6  SandboxIRTests                0x0000633bdc279016
7  libllvm_gtest.so.19.0git      0x00007286bc152cd3
8  libllvm_gtest.so.19.0git      0x00007286bc161702 testing::TestInfo::Run() + 722
9  libllvm_gtest.so.19.0git      0x00007286bc161ca1
10 libllvm_gtest.so.19.0git      0x00007286bc170eea testing::internal::UnitTestImpl::RunAllTests() + 2842
11 libllvm_gtest.so.19.0git      0x00007286bc151bbf testing::UnitTest::Run() + 143
12 libllvm_gtest_main.so.19.0git 0x00007286bc19dbba main + 106
13 libc.so.6                     0x00007286bb829d90
14 libc.so.6                     0x00007286bb829e40 __libc_start_main + 128
15 SandboxIRTests                0x0000633bdc26b785

--
exit: -11
--
shard JSON output does not exist: /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/build/unittests/SandboxIR/./SandboxIRTests-LLVM-Unit-3864293-7-8.json
********************


@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 16, 2024

LLVM Buildbot has detected a new failure on builder ml-opt-rel-x86-64 running on ml-opt-rel-x86-64-b2 while building llvm at step 6 "test-build-unified-tree-check-all".

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

Here is the relevant piece of the build log for the reference:

Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM-Unit :: SandboxIR/./SandboxIRTests/7/8' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:/b/ml-opt-rel-x86-64-b1/build/unittests/SandboxIR/./SandboxIRTests-LLVM-Unit-1476574-7-8.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=8 GTEST_SHARD_INDEX=7 /b/ml-opt-rel-x86-64-b1/build/unittests/SandboxIR/./SandboxIRTests
--

Note: This is test shard 8 of 8.
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from SandboxIRTest
[ RUN      ] SandboxIRTest.Instruction
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  SandboxIRTests  0x00005628b1700b88
1  SandboxIRTests  0x00005628b16fe49c
2  libpthread.so.0 0x00007f0ef042a140
3  SandboxIRTests  0x00005628b160277e
4  SandboxIRTests  0x00005628b15461b2
5  SandboxIRTests  0x00005628b14dd5c0
6  SandboxIRTests  0x00005628b17142df
7  SandboxIRTests  0x00005628b171c1e2
8  SandboxIRTests  0x00005628b171c7c7
9  SandboxIRTests  0x00005628b1729826
10 SandboxIRTests  0x00005628b171384c
11 SandboxIRTests  0x00005628b14cb0a6
12 libc.so.6       0x00007f0eeff35d0a __libc_start_main + 234
13 SandboxIRTests  0x00005628b14cf01a

--
exit: -11
--
shard JSON output does not exist: /b/ml-opt-rel-x86-64-b1/build/unittests/SandboxIR/./SandboxIRTests-LLVM-Unit-1476574-7-8.json
********************


@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 16, 2024

LLVM Buildbot has detected a new failure on builder ml-opt-dev-x86-64 running on ml-opt-dev-x86-64-b1 while building llvm at step 6 "test-build-unified-tree-check-all".

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

Here is the relevant piece of the build log for the reference:

Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM-Unit :: SandboxIR/./SandboxIRTests/7/8' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:/b/ml-opt-dev-x86-64-b1/build/unittests/SandboxIR/./SandboxIRTests-LLVM-Unit-46392-7-8.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=8 GTEST_SHARD_INDEX=7 /b/ml-opt-dev-x86-64-b1/build/unittests/SandboxIR/./SandboxIRTests
--

Note: This is test shard 8 of 8.
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from SandboxIRTest
[ RUN      ] SandboxIRTest.Instruction
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  SandboxIRTests  0x0000556514d4eb88
1  SandboxIRTests  0x0000556514d4c49c
2  libpthread.so.0 0x00007f8799df6140
3  SandboxIRTests  0x0000556514c5077e
4  SandboxIRTests  0x0000556514b941b2
5  SandboxIRTests  0x0000556514b2b5c0
6  SandboxIRTests  0x0000556514d622df
7  SandboxIRTests  0x0000556514d6a1e2
8  SandboxIRTests  0x0000556514d6a7c7
9  SandboxIRTests  0x0000556514d77826
10 SandboxIRTests  0x0000556514d6184c
11 SandboxIRTests  0x0000556514b190a6
12 libc.so.6       0x00007f8799901d0a __libc_start_main + 234
13 SandboxIRTests  0x0000556514b1d01a

--
exit: -11
--
shard JSON output does not exist: /b/ml-opt-dev-x86-64-b1/build/unittests/SandboxIR/./SandboxIRTests-LLVM-Unit-46392-7-8.json
********************


vporpo added a commit that referenced this pull request Jul 16, 2024
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 16, 2024

LLVM Buildbot has detected a new failure on builder lld-x86_64-ubuntu-fast running on as-builder-4 while building llvm at step 6 "test-build-unified-tree-check-all".

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

Here is the relevant piece of the build log for the reference:

Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM-Unit :: SandboxIR/./SandboxIRTests/7/8' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:/home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/unittests/SandboxIR/./SandboxIRTests-LLVM-Unit-1308350-7-8.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=8 GTEST_SHARD_INDEX=7 /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/unittests/SandboxIR/./SandboxIRTests
--

Note: This is test shard 8 of 8.
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from SandboxIRTest
[ RUN      ] SandboxIRTest.Instruction
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  SandboxIRTests 0x0000565411904410
1  SandboxIRTests 0x0000565411901d1f
2  SandboxIRTests 0x0000565411901e75
3  libc.so.6      0x00007f8e5ff69520
4  SandboxIRTests 0x0000565411801182
5  SandboxIRTests 0x00005654117406be
6  SandboxIRTests 0x00005654116d3ef6
7  SandboxIRTests 0x000056541191a643
8  SandboxIRTests 0x0000565411924ea2
9  SandboxIRTests 0x0000565411925441
10 SandboxIRTests 0x000056541192fdba
11 SandboxIRTests 0x00005654119199bf
12 SandboxIRTests 0x00005654116c2a3a
13 libc.so.6      0x00007f8e5ff50d90
14 libc.so.6      0x00007f8e5ff50e40 __libc_start_main + 128
15 SandboxIRTests 0x00005654116c66a5

--
exit: -11
--
shard JSON output does not exist: /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/unittests/SandboxIR/./SandboxIRTests-LLVM-Unit-1308350-7-8.json
********************


yuxuanchen1997 pushed a commit that referenced this pull request Jul 25, 2024
This patch adds new Instruction member functions, including:
- getNextNode()
- getPrevNode()
- getOpcode()
- removeFromParent()
- eraseFromParent()
- getParent()
- insertBefore()
- insertAfter()
- insertInto()
- moveBefore()
- moveAfter()
yuxuanchen1997 pushed a commit that referenced this pull request Jul 25, 2024
Summary: This reverts commit 618b0b7.

Test Plan: 

Reviewers: 

Subscribers: 

Tasks: 

Tags: 


Differential Revision: https://phabricator.intern.facebook.com/D60251723
yuxuanchen1997 pushed a commit that referenced this pull request Jul 25, 2024
Summary: This reverts commit 1ca07ce.

Test Plan: 

Reviewers: 

Subscribers: 

Tasks: 

Tags: 


Differential Revision: https://phabricator.intern.facebook.com/D60251476
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants