Skip to content

Conversation

@tmsri
Copy link
Member

@tmsri tmsri commented Sep 25, 2024

The getter functions simply turn around and call the LLVM
counterparts. This is fine until we don't add new sandbox IR
opcodes. At that point, we may have to explicitly check if
the behavior is different.

The getter functions simply turn around and call the LLVM
counterparts.  This is fine until we don't add new sandbox IR
opcodes.  At that point, we may have to explicitly check if
the behavior is different.
@vporpo vporpo changed the title Add more functions to sandboxir:Instruction class. [SandboxIR] Add more functions to sandboxir:Instruction class. Sep 25, 2024
@github-actions
Copy link

github-actions bot commented Sep 25, 2024

✅ With the latest revision this PR passed the C/C++ code formatter.

Copy link
Contributor

@Sterling-Augustine Sterling-Augustine left a comment

Choose a reason for hiding this comment

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

Pretty straight-forward pass through functions.

//===--------------------------------------------------------------------===//

/// Return true if the instruction has any metadata attached to it.
bool hasMetadata() const { return cast<llvm::Instruction>(Val)->hasMetadata(); }
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure about whether we should give access to metadata at this point, because these are LLVM IR structures and we can't really track their state.

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed getMetadata and getAllMetadata functions.

Add them back after MDNode is available in sandboxir.  For now,
exposing them could give access to functions that modify the
metadata.
Copy link
Contributor

@vporpo vporpo left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@tmsri tmsri merged commit 5103910 into llvm:main Sep 25, 2024
4 checks passed
@tmsri tmsri deleted the sandbox_ir_instruction branch September 25, 2024 23:09
@llvm-ci
Copy link
Collaborator

llvm-ci commented Sep 25, 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/5788

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/32/131' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/build/unittests/SandboxIR/./SandboxIRTests-LLVM-Unit-1162265-32-131.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=131 GTEST_SHARD_INDEX=32 /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/build/unittests/SandboxIR/./SandboxIRTests
--

Script:
--
/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/build/unittests/SandboxIR/./SandboxIRTests --gtest_filter=SandboxIRTest.Instruction
--
warning: ignoring debug info with an invalid version (0) in <string>
/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/llvm-project/llvm/unittests/SandboxIR/SandboxIRTest.cpp:1871: Failure
Expected equality of these values:
  I0->getOpcodeName()
    Which is: 0x7a7bae088b4b
  "Add"
    Which is: 0x58622378b737

/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/llvm-project/llvm/unittests/SandboxIR/SandboxIRTest.cpp:1872: Failure
Expected equality of these values:
  I1->getOpcodeName()
    Which is: 0x7a7bae088b54
  "Sub"
    Which is: 0x58622378c6e0

/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/llvm-project/llvm/unittests/SandboxIR/SandboxIRTest.cpp:1873: Failure
Expected equality of these values:
  Ret->getOpcodeName()
    Which is: 0x7a7bae0889ff
  "Ret"
    Which is: 0x58622378b865

/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/llvm-project/llvm/unittests/SandboxIR/SandboxIRTest.cpp:1875: Failure
Expected equality of these values:
  sandboxir::Instruction::getOpcodeName( sandboxir::Instruction::Opcode::Alloca)
    Which is: 0x7a7bae088a9d
  "Alloca"
    Which is: 0x58622378c719


/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/llvm-project/llvm/unittests/SandboxIR/SandboxIRTest.cpp:1871
Expected equality of these values:
  I0->getOpcodeName()
    Which is: 0x7a7bae088b4b
  "Add"
    Which is: 0x58622378b737

/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/llvm-project/llvm/unittests/SandboxIR/SandboxIRTest.cpp:1872
Expected equality of these values:
  I1->getOpcodeName()
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Sep 25, 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/5786

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/32/131' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/build/unittests/SandboxIR/./SandboxIRTests-LLVM-Unit-1342298-32-131.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=131 GTEST_SHARD_INDEX=32 /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/build/unittests/SandboxIR/./SandboxIRTests
--

Script:
--
/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/build/unittests/SandboxIR/./SandboxIRTests --gtest_filter=SandboxIRTest.Instruction
--
warning: ignoring debug info with an invalid version (0) in <string>
/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/llvm-project/llvm/unittests/SandboxIR/SandboxIRTest.cpp:1871: Failure
Expected equality of these values:
  I0->getOpcodeName()
    Which is: 0x7d60015a7b4b
  "Add"
    Which is: 0x5ef5c9d4670d

/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/llvm-project/llvm/unittests/SandboxIR/SandboxIRTest.cpp:1872: Failure
Expected equality of these values:
  I1->getOpcodeName()
    Which is: 0x7d60015a7b54
  "Sub"
    Which is: 0x5ef5c9d476b6

/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/llvm-project/llvm/unittests/SandboxIR/SandboxIRTest.cpp:1873: Failure
Expected equality of these values:
  Ret->getOpcodeName()
    Which is: 0x7d60015a79ff
  "Ret"
    Which is: 0x5ef5c9d4683b

/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/llvm-project/llvm/unittests/SandboxIR/SandboxIRTest.cpp:1875: Failure
Expected equality of these values:
  sandboxir::Instruction::getOpcodeName( sandboxir::Instruction::Opcode::Alloca)
    Which is: 0x7d60015a7a9d
  "Alloca"
    Which is: 0x5ef5c9d476ef


/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/llvm-project/llvm/unittests/SandboxIR/SandboxIRTest.cpp:1871
Expected equality of these values:
  I0->getOpcodeName()
    Which is: 0x7d60015a7b4b
  "Add"
    Which is: 0x5ef5c9d4670d

/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/llvm-project/llvm/unittests/SandboxIR/SandboxIRTest.cpp:1872
Expected equality of these values:
  I1->getOpcodeName()
...

@vporpo
Copy link
Contributor

vporpo commented Sep 25, 2024

This should fix it: 13809b3

@llvm-ci
Copy link
Collaborator

llvm-ci commented Sep 27, 2024

LLVM Buildbot has detected a new failure on builder llvm-x86_64-debian-dylib running on gribozavr4 while building llvm at step 7 "test-build-unified-tree-check-llvm".

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

Here is the relevant piece of the build log for the reference
Step 7 (test-build-unified-tree-check-llvm) failure: test (failure)
******************** TEST 'LLVM-Unit :: SandboxIR/./SandboxIRTests/32/131' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:/b/1/llvm-x86_64-debian-dylib/build/unittests/SandboxIR/./SandboxIRTests-LLVM-Unit-4103137-32-131.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=131 GTEST_SHARD_INDEX=32 /b/1/llvm-x86_64-debian-dylib/build/unittests/SandboxIR/./SandboxIRTests
--

Script:
--
/b/1/llvm-x86_64-debian-dylib/build/unittests/SandboxIR/./SandboxIRTests --gtest_filter=SandboxIRTest.Instruction
--
warning: ignoring debug info with an invalid version (0) in <string>
/b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/unittests/SandboxIR/SandboxIRTest.cpp:1871: Failure
Expected equality of these values:
  I0->getOpcodeName()
    Which is: 0x7f7721798a63
  "Add"
    Which is: 0x5416cc

/b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/unittests/SandboxIR/SandboxIRTest.cpp:1872: Failure
Expected equality of these values:
  I1->getOpcodeName()
    Which is: 0x7f7721798a6c
  "Sub"
    Which is: 0x5426ba

/b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/unittests/SandboxIR/SandboxIRTest.cpp:1873: Failure
Expected equality of these values:
  Ret->getOpcodeName()
    Which is: 0x7f7721798a0c
  "Ret"
    Which is: 0x54134f

/b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/unittests/SandboxIR/SandboxIRTest.cpp:1877: Failure
Expected equality of these values:
  sandboxir::Instruction::getOpcodeName( sandboxir::Instruction::Opcode::Alloca)
    Which is: 0x7f7721798acd
  "Alloca"
    Which is: 0x542731


/b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/unittests/SandboxIR/SandboxIRTest.cpp:1871
Expected equality of these values:
  I0->getOpcodeName()
    Which is: 0x7f7721798a63
  "Add"
    Which is: 0x5416cc

/b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/unittests/SandboxIR/SandboxIRTest.cpp:1872
Expected equality of these values:
  I1->getOpcodeName()
...

Sterling-Augustine pushed a commit to Sterling-Augustine/llvm-project that referenced this pull request Sep 27, 2024
…110050)

The getter functions simply turn around and call the LLVM
counterparts.  This is fine until we don't add new sandbox IR
opcodes.  At that point, we may have to explicitly check if
the behavior is different.
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