forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPIR-V] No OpBitcast is generated for a bitcast between identical ty…
…pes (llvm#114877) The goal of the PR is to ensure that no OpBitcast is generated for a bitcast between identical types. This PR resolves llvm#114482
- Loading branch information
1 parent
5dc9c39
commit 93cda6d
Showing
2 changed files
with
24 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
llvm/test/CodeGen/SPIRV/no-opbitcast-between-identical-types.ll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
; The goal of the test case is to ensure that no OpBitcast is generated for a bitcast between identical types. | ||
|
||
; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv-unknown-unknown %s -o - | FileCheck %s | ||
; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-unknown %s -o - -filetype=obj | spirv-val %} | ||
|
||
; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s | ||
; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %} | ||
|
||
; CHECK: OpFunction | ||
; CHECK-NO: OpBitcast | ||
; CHECK: OpReturn | ||
|
||
define void @foo() { | ||
entry: | ||
%r = bitcast i32 0 to i32 | ||
ret void | ||
} |