[llvm-commits] [llvm] r43734 - in /llvm/trunk: lib/AsmParser/ParserInternals.h lib/AsmParser/llvmAsmParser.cpp.cvs lib/AsmParser/llvmAsmParser.h.cvs lib/AsmParser/llvmAsmParser.y lib/AsmParser/llvmAsmParser.y.cvs lib/Bitcode/Reader/BitcodeReader.cpp lib/CodeGen/AsmPrinter.cpp lib/CodeGen/SelectionDAG/ScheduleDAG.cpp lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp lib/CodeGen/SelectionDAG/TargetLowering.cpp test/CodeGen/X86/asm-block-labels.ll

Chris Lattner clattner at apple.com
Wed Nov 7 09:51:25 PST 2007


On Nov 5, 2007, at 1:20 PM, Dale Johannesen wrote:

> Author: johannes
> Date: Mon Nov  5 15:20:28 2007
> New Revision: 43734
>
> URL: http://llvm.org/viewvc/llvm-project?rev=43734&view=rev
> Log:
> Make labels work in asm blocks; allow labels as
> parameters.  Rename ValueRefList to ParamList
> in AsmParser, since its only use is for parameters.

Hey Dale,

> +"LASM$foo":		; preds = %entry
> +	call void asm sideeffect ".file \22block12.c\22", "~{dirflag},~ 
> {fpsr},~{flags}"( )
> +	call void asm sideeffect ".line 1", "~{dirflag},~{fpsr},~{flags}"( )
> +	call void asm sideeffect "int $$1", "~{dirflag},~{fpsr},~{flags},~ 
> {memory}"( )
> +	call void asm sideeffect ".file \22block12.c\22", "~{dirflag},~ 
> {fpsr},~{flags}"( )
> +	call void asm sideeffect ".line 2", "~{dirflag},~{fpsr},~{flags}"( )
> +	call void asm sideeffect "brl ${0:l}", "X,~{dirflag},~{fpsr},~ 
> {flags},~{memory}"( label %"LASM$foo" )

This is somewhat dangerous: I think there is code in the compiler  
that assumes that only phi nodes and terminators use basic block.

One specific problem with this is that the data-flow machinery won't  
know that the asm branches to LASM$foo, so misoptimizations can  
happen.  I guess the question is how common this is an how important  
it is that it works :)

-Chris



More information about the llvm-commits mailing list