Here is the output of the last three steps of the debug. What I am trying to create is an instruction that is treated similar to fences during compilation
===== Instruction selection begins: %bb.0 ‘’
ISEL: Starting selection on root node: t15: ch = RISCVISD::RET_GLUE t14, Register:i64 $x10, t14:1
ISEL: Starting pattern match
Morphed node: t15: ch = PseudoRET Register:i64 $x10, t14, t14:1
ISEL: Match complete!
ISEL: Starting selection on root node: t14: ch,glue = CopyToReg t10:1, Register:i64 $x10, Constant:i64<0>
ISEL: Starting selection on root node: t10: i64,ch = llvm.test t7:1, TargetConstant:i64<292>, Constant:i64<6>, Constant:i64<7>
ISEL: Starting selection on root node: t7: i64,ch = llvm.test t4:1, TargetConstant:i64<292>, Constant:i64<3>, Constant:i64<4>
ISEL: Starting selection on root node: t4: i64,ch = llvm.test t0, TargetConstant:i64<292>, Constant:i64<1>, Constant:i64<2>
ISEL: Starting selection on root node: t13: i64 = Register $x10
ISEL: Starting selection on root node: t12: i64 = Constant<0>
ISEL: Starting selection on root node: t9: i64 = Constant<7>
ISEL: Starting selection on root node: t8: i64 = Constant<6>
ISEL: Starting selection on root node: t6: i64 = Constant<4>
ISEL: Starting selection on root node: t5: i64 = Constant<3>
ISEL: Starting selection on root node: t3: i64 = Constant<2>
ISEL: Starting selection on root node: t2: i64 = Constant<1>
ISEL: Starting selection on root node: t1: i64 = TargetConstant<292>
ISEL: Starting selection on root node: t0: ch,glue = EntryToken
===== Instruction selection ends:
Selected selection DAG: %bb.0 'main:'
SelectionDAG has 25 nodes:
t0: ch,glue = EntryToken
t4: i64,ch = llvm.test t0, TargetConstant:i64<292>, t32, t30
t18: i64,ch = G_TEST t32, t30
t7: i64,ch = llvm.test t18:1, TargetConstant:i64<292>, t28, t26
t17: i64,ch = G_TEST t28, t26
t10: i64,ch = llvm.test t17:1, TargetConstant:i64<292>, t24, t22
t16: i64,ch = G_TEST t24, t22
t20: i64,ch = CopyFromReg t0, Register:i64 $x0
t14: ch,glue = CopyToReg t16:1, Register:i64 $x10, t20
t22: i64 = ADDI Register:i64 $x0, TargetConstant:i64<7>
t24: i64 = ADDI Register:i64 $x0, TargetConstant:i64<6>
t26: i64 = ADDI Register:i64 $x0, TargetConstant:i64<4>
t28: i64 = ADDI Register:i64 $x0, TargetConstant:i64<3>
t30: i64 = ADDI Register:i64 $x0, TargetConstant:i64<2>
t32: i64 = ADDI Register:i64 $x0, TargetConstant:i64<1>
t15: ch = PseudoRET Register:i64 $x10, t14, t14:1
Total amount of phi nodes to update: 0
*** MachineFunction at end of ISel ***
Machine code for function main: IsSSA, TracksLiveness
bb.0 (%ir-block.0):
%0:gpr = ADDI $x0, 7
%1:gpr = ADDI $x0, 6
%2:gpr = G_TEST %1:gpr, %0:gpr
%3:gpr = COPY $x0
$x10 = COPY %3:gpr
PseudoRET implicit $x10
End machine code for function main.