[prev in list] [next in list] [prev in thread] [next in thread] 

List:       llvm-dev
Subject:    RE: [LLVMdev] splitting up program into multiple threads
From:       "Vikram S. Adve" <vadve () cs ! uiuc ! edu>
Date:       2003-04-11 9:42:01
Message-ID: 01d301c30038$5e648380$4bf4ae80 () ad ! uiuc ! edu
[Download RAW message or body]

It sounds like you are generating separate code for the different
threads, if you plan ot optimize them separately.

If that's true, it's not clear exactly what you want since LLVM
distinguishes registers and memory and there is no correspondence
between them.  When you say a common variable, do you mean a variable in
memory (i.e., global or alloca slot), or an SSA register?

If you know that you want SSA registers r1 and r2 in 2 different threads
to be mapped to the same register, you can give the RegAlloc pass hints
to suggest which register to use.  These are not guaranteed but unless
you have high register pressure, the hints are likely to be respected.
Then, if the hints are not respected, you could force this "variable" to
be a global.

Let's take this discussion off the llvmdev list.  If anyone else has any
suggestions, please send them to Francesco directly and copy me.

--Vikram
http://www.cs.uiuc.edu/~vadve


> -----Original Message-----
> From: llvmdev-admin@cs.uiuc.edu 
> [mailto:llvmdev-admin@cs.uiuc.edu] On Behalf Of Francesco Spadini
> Sent: Thursday, April 10, 2003 10:19 PM
> To: llvmdev@cs.uiuc.edu
> Subject: [LLVMdev] splitting up program into multiple threads
> 
> 
> 	I have a sort of strange request -- I am splitting up a 
> program into multiple threads, which may have duplicated 
> instructions between them.  I'd like to run optimizations on 
> the threads separately, but I'd like for the variables common 
> amongst the threads to get register allocated the same way 
> (i.e, a value that is duplicated in the two threads gets 
> mapped to the same register/memory location).  Is there a cleaner way 
> to this other than to make all the shared variables global?  
> Thanks in 
> advance for any advice.
> 
> -- 
> Francesco Spadini
> http://www.crhc.uiuc.edu/~spadini
> spadini@crhc.uiuc.edu
> 
> "The universe is full of magical 
> things, patiently waiting for our 
> wits to grow sharper."
> 	- Eden Phillpots
> 
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev@cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev
> 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic