Skip to content

Instantly share code, notes, and snippets.

@hanhanW
Created April 1, 2021 15:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hanhanW/56a8fcdd6a8eb25a743a71667754e6e4 to your computer and use it in GitHub Desktop.
Save hanhanW/56a8fcdd6a8eb25a743a71667754e6e4 to your computer and use it in GitHub Desktop.
Load new dialect in Context
Load new dialect in Context spv
Load new dialect in Context memref
Load new dialect in Context std
Load new dialect in Context tensor
//===-------------------------------------------===//
Legalizing operation : 'module'(0x5522ffdb2ac0) {
* Fold {
} -> FAILURE : unable to fold
} -> FAILURE : no matched legalization pattern
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'func'(0x5522ffcc1240) {
* Fold {
} -> FAILURE : unable to fold
* Pattern : 'func -> ()' {
i8 illegal: requires at least one capability in [StorageBuffer8BitAccess] but none allowed in target environment
i8 converted to 32-bit for SPIR-V
i8 illegal: requires at least one capability in [Int8] but none allowed in target environment
i8 converted to 32-bit for SPIR-V
** Insert : 'spv.func'(0x5522ffcc1380)
** Erase : 'func'(0x5522ffcc1240)
//===-------------------------------------------===//
Legalizing operation : 'spv.func'(0x5522ffcc1380) {
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
} -> SUCCESS : pattern applied successfully
} -> SUCCESS
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'memref.load'(0x5522ffc7ee70) {
%0 = "memref.load"(<<UNKNOWN SSA VALUE>>) : (memref<i8>) -> i8
* Fold {
} -> FAILURE : unable to fold
* Pattern : 'memref.load -> ()' {
} -> FAILURE : pattern failed to match
* Pattern : 'memref.load -> ()' {
** Insert : 'spv.Constant'(0x5522ffcfced0)
** Insert : 'spv.AccessChain'(0x5522ff826f30)
** Insert : 'spv.Constant'(0x5522ffcc3aa0)
** Insert : 'spv.SDiv'(0x5522ffd92810)
** Insert : 'spv.AccessChain'(0x5522ff827030)
** Insert : 'spv.Load'(0x5522ffc7f170)
** Insert : 'spv.Constant'(0x5522ffcc3b30)
** Insert : 'spv.Constant'(0x5522ffcc3980)
** Insert : 'spv.UMod'(0x5522ffd928f0)
** Insert : 'spv.IMul'(0x5522ffd929d0)
** Insert : 'spv.ShiftRightArithmetic'(0x5522ffd92ab0)
** Insert : 'spv.Constant'(0x5522ffcc3a10)
** Insert : 'spv.BitwiseAnd'(0x5522ffd92b90)
** Insert : 'spv.Constant'(0x5522ffcc3c50)
** Insert : 'spv.ShiftLeftLogical'(0x5522ffd92c70)
** Insert : 'spv.ShiftRightArithmetic'(0x5522ffd92d50)
** Replace : 'memref.load'(0x5522ffc7ee70)
** Erase : 'spv.AccessChain'(0x5522ff826f30)
//===-------------------------------------------===//
Legalizing operation : 'spv.Constant'(0x5522ffcfced0) {
%0 = "spv.Constant"() {value = 0 : i32} : () -> i32
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'spv.AccessChain'(0x5522ff826f30) {
%1 = "spv.AccessChain"(%arg0, %0, %0) : (!spv.ptr<!spv.struct<(!spv.array<1 x i32, stride=4> [0])>, StorageBuffer>, i32, i32) -> !spv.ptr<i32, StorageBuffer>
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'spv.Constant'(0x5522ffcc3aa0) {
%2 = "spv.Constant"() {value = 4 : i32} : () -> i32
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'spv.SDiv'(0x5522ffd92810) {
%3 = "spv.SDiv"(%0, %2) : (i32, i32) -> i32
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'spv.AccessChain'(0x5522ff827030) {
%4 = "spv.AccessChain"(%arg0, %0, %3) : (!spv.ptr<!spv.struct<(!spv.array<1 x i32, stride=4> [0])>, StorageBuffer>, i32, i32) -> !spv.ptr<i32, StorageBuffer>
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'spv.Load'(0x5522ffc7f170) {
%5 = "spv.Load"(%4) : (!spv.ptr<i32, StorageBuffer>) -> i32
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'spv.Constant'(0x5522ffcc3b30) {
%6 = "spv.Constant"() {value = 4 : i32} : () -> i32
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'spv.Constant'(0x5522ffcc3980) {
%7 = "spv.Constant"() {value = 8 : i32} : () -> i32
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'spv.UMod'(0x5522ffd928f0) {
%8 = "spv.UMod"(%0, %6) : (i32, i32) -> i32
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'spv.IMul'(0x5522ffd929d0) {
%9 = "spv.IMul"(%8, %7) : (i32, i32) -> i32
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'spv.ShiftRightArithmetic'(0x5522ffd92ab0) {
%10 = "spv.ShiftRightArithmetic"(%5, %9) : (i32, i32) -> i32
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'spv.Constant'(0x5522ffcc3a10) {
%11 = "spv.Constant"() {value = 255 : i32} : () -> i32
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'spv.BitwiseAnd'(0x5522ffd92b90) {
%12 = "spv.BitwiseAnd"(%10, %11) : (i32, i32) -> i32
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'spv.Constant'(0x5522ffcc3c50) {
%13 = "spv.Constant"() {value = 24 : i32} : () -> i32
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'spv.ShiftLeftLogical'(0x5522ffd92c70) {
%14 = "spv.ShiftLeftLogical"(%12, %13) : (i32, i32) -> i32
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'spv.ShiftRightArithmetic'(0x5522ffd92d50) {
%15 = "spv.ShiftRightArithmetic"(%14, %13) : (i32, i32) -> i32
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
} -> SUCCESS : pattern applied successfully
} -> SUCCESS
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'std.return'(0x5522ffdf6180) {
"std.return"(%16) : (i8) -> ()
* Fold {
} -> FAILURE : unable to fold
* Pattern : 'std.return -> ()' {
%15 = spv.ShiftRightArithmetic %14, %13 : i32, i32
** Insert : 'spv.ReturnValue'(0x5522ffdf6020)
** Replace : 'std.return'(0x5522ffdf6180)
//===-------------------------------------------===//
Legalizing operation : 'spv.ReturnValue'(0x5522ffdf6020) {
"spv.ReturnValue"(%15) : (i32) -> ()
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
} -> SUCCESS : pattern applied successfully
} -> SUCCESS
//===-------------------------------------------===//
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment