On Nov 7, 2007, at 9:51 AM, Chris Lattner wrote: > 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 :)
This construct got an internal error before, so I claim this is an improvement. Asm's are still a long way from working well; it wouldn't surprise me if they call for some optimizer changes. (But we really should be disabling most optimizations on asm's, as I've said before.) If you want to be able to compile the same set of programs as Apple's gcc, it needs to work. But not necessarily tomorrow. _______________________________________________ llvm-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
