<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Dec 29, 2017, at 11:34, Krzysztof Parzyszek via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">You can construct an instruction that has an immediate operand in place of a register, but that won't work well.  For one, the MachineVerifier will complain about having an invalid operand, plus any code that tries to use operand information for that instruction may end up "surprised" to see an immediate where a register was expected.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote></div>You could do this, but you would have to define a custom operand type with custom verification for the allowed operand types. This is how AMDGPU handles most operands which can be registers or specific immediates<div class=""><br class=""></div><div class="">-Matt</div></body></html>