[llvm-dev] IR question re: constants

Krzysztof Parzyszek via llvm-dev llvm-dev at lists.llvm.org
Wed Sep 2 11:24:18 PDT 2015


On 9/2/2015 1:16 PM, via llvm-dev wrote:
> I'm curious.  Is there a specific technical reason that the high-level
> IR doesn't have an instruction to simply set a register to a constant?
> This limitation means we cannot hoist an "expensive" constant out of a
> loop until we lower the IR to MachineInstrs.  Or more to the point, it
> forces backends to undo any such hoisting done by frontends.
>
> Or am I not understanding something?

The LLVM IR doesn't have registers.  The computations are values and a 
constant represents itself.

-Krzysztof

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, 
hosted by The Linux Foundation


More information about the llvm-dev mailing list