Is there a pass I can use after reg2mem to get rid of occurances like this?: store i32 %cond, i32* %cond.reg2mem %cond.reload = load i32* %cond.reg2mem store i32 %cond.reload, i32* %cond4.reg2mem Essentially, in this case, reg2mem creates an extra memory space to store and load a value from just here, and never uses the value again; since this isn't efficient code, I'm wondering if there's another pass I can use to fix the innefficient code reg2mem produces, or if my translator should do it's own PHI elimination? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120725/86cc872d/attachment.html>
Why are you running reg2mem if you want efficient code? --Owen On Jul 25, 2012, at 1:28 PM, ryan baird <ryanrbaird at gmail.com> wrote:> Is there a pass I can use after reg2mem to get rid of occurances like this?: > > store i32 %cond, i32* %cond.reg2mem > %cond.reload = load i32* %cond.reg2mem > store i32 %cond.reload, i32* %cond4.reg2mem > > Essentially, in this case, reg2mem creates an extra memory space to store and load a value from just here, and never uses the value again; since this isn't efficient code, I'm wondering if there's another pass I can use to fix the innefficient code reg2mem produces, or if my translator should do it's own PHI elimination? > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Possibly Parallel Threads
- [LLVMdev] eliminate phi nodes, reduce unnecessary loads / stores , reg2mem, mem2reg
- [LLVMdev] run -mem2reg and -reg2mem programmably from within a Pass
- [LLVMdev] run -mem2reg and -reg2mem programmably from within a Pass
- [LLVMdev] Reg2mem: Identifying introduced memory locations (also, what happens to the phi nodes)
- [LLVMdev] reg2mem pass