This patch allows the following IR to compile:
define i32 @vscale() { ret i32 ptrtoint (<vscale x 1 x i8>* getelementptr (<vscale x 1 x i8>, <vscale x 1 x i8>* null, i64 1) to i32) }
to the following, which produces a value equal to the runtime value of vscale:
cntd x8 lsr x0, x8, #1 // kill: def $w0 killed $w0 killed $x0 ret
Posting this patch mainly to pose the question of whether the input IR is supposed to be valid. Some people have expressed the opinion that vscale should not be an llvm::Constant.