The exisiting code goes out of its way to put block parameters into an alloca at -O0 only, but then describes the function argument (instead of the alloca) with a dbg.declare and the value loaded from the alloca with a dbg.value. Describing a function argument with a dbg.declare is undocumented in the LLVM-CFE contract and broke after LLVM r642022.
This patch just generates the alloca unconditionally, the mem2reg pass will eliminate it at -O1 and up anyway and points the dbg.declare to the alloca as intended (which mem2reg will then correctly rewrite into a dbg.value).
rdar://problem/35043980