<div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div>Hi, guys</div><div>I am interesting about how to get the switch case value form the Machine Instruction.</div><div><br></div><div>I know the switch will be converted to jump-table in the Machine Instruction.</div><div>And in the phase CodeGen ,  the case-value of SwitchInst can get esasly.</div><div>but it seems no case -value in Machine Instruction.</div><div><br>The MI as follows:<br><i style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;">Frame Objects:</i></div><div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i>  fi#0: size=1, align=0, at location [SP]</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i>  fi#1: size=4, align=4, at location [SP+8]</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i>  fi#2: size=4, align=4, at location [SP+4]</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i>  fi#3: size=4, align=4, at location [SP]</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i>Jump Tables:</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i><b>%jump-table.0:  %bb.2 %bb.3 %bb.4 %bb.5</b></i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i><br></i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i>%bb.0: derived from LLVM BB %0</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i><span style="white-space: pre-wrap;">   </span>%r0 = MOVi 0, 14, %noreg, %noreg</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i><span style="white-space: pre-wrap;">       </span>STRi12 %r0, %stack.1, 14, %noreg</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i><span style="white-space: pre-wrap;">       </span>%r0 = MOVi 4, 14, %noreg, %noreg</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i><span style="white-space: pre-wrap;">       </span>STRi12 %r0, %stack.2, 14, %noreg</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i><span style="white-space: pre-wrap;">       </span>%r0 = LDRi12 %stack.2, 14, %noreg</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i><span style="white-space: pre-wrap;">      </span>%r0 = SUBri %r0, 1, 14, %noreg, %noreg</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i><span style="white-space: pre-wrap;"> </span>CMPri %r0, 3, 14, %noreg, implicit-def %cpsr</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i><span style="white-space: pre-wrap;">   </span>STRi12 %r0, %stack.3, 14, %noreg</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i><span style="white-space: pre-wrap;">       </span><b>Bcc %bb.6, 8, %cpsr</b></i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i>    Successors according to CFG: %bb.6 %bb.1</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i><br></i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i><b>%bb.1: derived from LLVM BB %1</b></i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i><b>    Predecessors according to CFG: %bb.0</b></i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i><b><span style="white-space: pre-wrap;">      </span>%1:gprnopc = LEApcrelJT %jump-table.0, 14, %noreg</b></i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i><b><span style="white-space: pre-wrap;">   </span>%2:gprnopc = LDRrs killed %0:gprnopc, %1, 0, 14, %noreg; mem:LD4[JumpTable]</b></i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i><b><span style="white-space: pre-wrap;"> </span>BR_JTr killed %2, %jump-table.0</b></i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i><b>    Successors according to CFG: %bb.2(?%) %bb.3(?%) %bb.4(?%) %bb.5(?%)</b></i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i><br></i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i>%bb.2: derived from LLVM BB %2</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i>    Predecessors according to CFG: %bb.1</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i><span style="white-space: pre-wrap;">   </span>%r0 = LDRi12 %stack.2, 14, %noreg</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i><span style="white-space: pre-wrap;">      </span>%r0 = ADDri %r0, 11, 14, %noreg, %noreg</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i><span style="white-space: pre-wrap;">        </span>STRi12 %r0, %stack.2, 14, %noreg</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i><span style="white-space: pre-wrap;">       </span>B %bb.6</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i>    Successors according to CFG: %bb.6</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i><br></i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i>%bb.3: derived from LLVM BB %3</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i>    Predecessors according to CFG: %bb.1</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i><span style="white-space: pre-wrap;">  </span>%r0 = LDRi12 %stack.2, 14, %noreg</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i><span style="white-space: pre-wrap;">      </span>%r0 = ADDri %r0, 12, 14, %noreg, %noreg</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i><span style="white-space: pre-wrap;">        </span>STRi12 %r0, %stack.2, 14, %noreg</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i><span style="white-space: pre-wrap;">       </span>B %bb.6</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i>    Successors according to CFG: %bb.6</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i><br></i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i>%bb.4: derived from LLVM BB %4</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i>    Predecessors according to CFG: %bb.1</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i><span style="white-space: pre-wrap;">  </span>%r0 = LDRi12 %stack.2, 14, %noreg</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i><span style="white-space: pre-wrap;">      </span>%r0 = ADDri %r0, 13, 14, %noreg, %noreg</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i><span style="white-space: pre-wrap;">        </span>STRi12 %r0, %stack.2, 14, %noreg</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i><span style="white-space: pre-wrap;">       </span>B %bb.6</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i>    Successors according to CFG: %bb.6</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i><br></i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i>%bb.5: derived from LLVM BB %5</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i>    Predecessors according to CFG: %bb.1</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i><span style="white-space: pre-wrap;">  </span>%r0 = LDRi12 %stack.2, 14, %noreg</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i><span style="white-space: pre-wrap;">      </span>%r0 = ADDri %r0, 14, 14, %noreg, %noreg</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i><span style="white-space: pre-wrap;">        </span>STRi12 %r0, %stack.2, 14, %noreg</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i>    Successors according to CFG: %bb.6</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i><br></i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i>%bb.6: derived from LLVM BB %6</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i>    Predecessors according to CFG: %bb.0 %bb.2 %bb.3 %bb.4 %bb.5</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i><span style="white-space: pre-wrap;"> </span>%r0 = LDRi12 %stack.2, 14, %noreg</i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i><span style="white-space: pre-wrap;">      </span>BX_RET 14, %noreg</i></div></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"><i><br></i></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;">I  hope to get the Case value from the MI, <br>Thanks,<i><br></i>yaoxiao</div></div>