[llvm-dev] Order of IR statements

Peng Yu via llvm-dev llvm-dev at lists.llvm.org
Tue Jan 22 05:56:30 PST 2019


Hi,

I am not sure if it is mentioned explicitly in the lang ref. Based on
my preliminary test It seems that the order of LLVM statements are
nonessential (unless it is the instructions in a function, which, of
course, must be ordered.)

https://llvm.org/docs/LangRef.html

For example, these things can appear in any order in a .ll file? I can
move them in a legal .ll file around and the new .ll file should still
work? Different from most high-level programming languages, forward
references (e.g., !10 refers to !100, which is defined later) are also
OK in IR? Thanks.

source_filename
target triple
define
declare
attributes
!
@

-- 
Regards,
Peng


More information about the llvm-dev mailing list