Per Fagrell
2010-Dec-15 09:11 UTC
[LLVMdev] Optimization passes break machine instructions on new backend
But in the first version it's used on the next row: %reg16388<def> = CMPrr %reg16384, %reg16385, %CFR<imp-def,dead>; IntRegs:%reg16388,16384,16385 SKIPCOND 1, *%CFR<imp-use>* Or doesn't that count? Following are patters for cmp and skipcond: def cmpcc : SDNode<"CSISD::CMP", SDTIntBinOp, [SDNPOutFlag]>; let Defs = [CFR] in { def CMPrr : InstCS<(outs IntRegs:$dst), (ins IntRegs:$b, IntRegs:$c), "cmp $c, $dst", [(set IntRegs:$dst, (cmpcc IntRegs:$b, IntRegs:$c)), (implicit CFR)]>; } let Uses = [CFR], isBranch = 1, isTerminator = 1 in def SKIPCOND : InstCS<(outs), (ins CCOp:$cc), "s$cc", [(skipcc imm:$cc)]>; On Wed, Dec 15, 2010 at 10:02 AM, Anton Korobeynikov < anton at korobeynikov.info> wrote:> Hello Per, > > > The CMPrr instruction is moved down to after the PHI node. My guess is > that > > the 'dead' in CFR<imp-def,dead> is to blame, but I can't see what I'm > doing > > differently from MSP430/sparc that makes this not work. Any help GREATLY > > appreciated! > It seems like no use of CFR after CMP, indeed. How condbranches on > your platform look like (patterns, etc.) ? > > -- > With best regards, Anton Korobeynikov > Faculty of Mathematics and Mechanics, Saint Petersburg State University >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20101215/962d699c/attachment.html>
Anton Korobeynikov
2010-Dec-15 09:14 UTC
[LLVMdev] Optimization passes break machine instructions on new backend
Hello Per,> SKIPCOND 1, %CFR<imp-use> > Or doesn't that count?Ah, sorry, I didn't recognize the stuff due to funky name. Let me think on the issue more thoroughly then :) -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University
Per Fagrell
2010-Dec-15 13:43 UTC
[LLVMdev] Optimization passes break machine instructions on new backend
It just occured to me that perhaps what happens is that since the cmp-instruction is initially followed by the pseudo-instruction - which doesn't have Uses = [CFR] - that it's marked dead initially, and never changed back when the SKIPCOND is inserted by the custom emitter? But I feel that this would happen in e.g. MSP430 too then... On Wed, Dec 15, 2010 at 10:14 AM, Anton Korobeynikov < anton at korobeynikov.info> wrote:> Hello Per, > > > SKIPCOND 1, %CFR<imp-use> > > Or doesn't that count? > Ah, sorry, I didn't recognize the stuff due to funky name. Let me > think on the issue more thoroughly then :) > > -- > With best regards, Anton Korobeynikov > Faculty of Mathematics and Mechanics, Saint Petersburg State University >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20101215/7fb81a56/attachment.html>
Seemingly Similar Threads
- [LLVMdev] Optimization passes break machine instructions on new backend
- [LLVMdev] Optimization passes break machine instructions on new backend
- [LLVMdev] Optimization passes break machine instructions on new backend
- [LLVMdev] Optimization passes break machine instructions on new backend
- [LLVMdev] [cfe-dev] -fsanitize=address on centos 6.4