[PATCH] Added lowering of dbg.declare in JumpThreading.cpp

Hal Finkel hfinkel at anl.gov
Thu Feb 19 05:32:05 PST 2015


[+Eric, David]

----- Original Message -----
> From: "Karl-Johan Karlsson" <karl-johan.karlsson at ericsson.com>
> To: llvm-commits at cs.uiuc.edu
> Sent: Thursday, February 19, 2015 6:42:50 AM
> Subject: Re: [PATCH] Added lowering of dbg.declare in JumpThreading.cpp
> 
> Ping.
> 
> Regards
> / Karl-Johan Karlsson
> 
> On 02/09/2015 03:23 PM, Karl-Johan Karlsson wrote:
> > The jumpthreading algorithm might duplicate blocks, including
> > dbg.declare instrinsics. Avoid ending up with two dbg.declare
> > intrinsics for a single alloca, by using the same method as in
> > InstructionCombining. Lower the dbg.declare intrinsics into an
> > appropriate set of dbg.value instrinsics.
> >
> > Regards
> > / Karl-Johan Karlsson
> >
> > On 02/06/2015 09:39 AM, Karl-Johan Karlsson wrote:
> >>
> >>
> >> On 02/05/2015 08:21 PM, Hans Wennborg wrote:
> >>> On Thu, Feb 5, 2015 at 4:49 AM, Karl-Johan Karlsson
> >>> <karl-johan.karlsson at ericsson.com> wrote:
> >>>> I have a small issue with the JumpThreading pass (in opt). As
> >>>> described in
> >>>> the code (JumpThreading.cpp), the pass may if certain criteria
> >>>> are
> >>>> fulfilled
> >>>> duplicate the content of a block. If the duplicated block
> >>>> contain a
> >>>> call to
> >>>> @llvm.dbg.declare() you will end up with invalid code as the
> >>>> intrinsic
> >>>> @llvm.dbg.declare() only should occur once for each variable.
> >>>>
> >>>> I think the JumpThreading pass should lower all
> >>>> llvm.dbg.declare() into
> >>>> llvm.dbg.value() the same way as the instcombine pass do (see
> >>>> InstructionCombining.cpp):
> >>>>
> >>>>    // Lower dbg.declare intrinsics otherwise their value may be
> >>>> clobbered
> >>>>    // by instcombiner.
> >>>>    bool DbgDeclaresChanged = LowerDbgDeclare(F);
> >>>>
> >>>> Do you agree? Ok to commit?
> >>>
> >>> Did you forget to attach a patch? A patch with a test case
> >>> showing the
> >>> problem you're describing would be great.
> >>>
> >>> Also, patches should generally be sent to the llvm-commits list,
> >>> not
> >>> llvmdev.
> >>
> >> I will create a patch with a testcase and send it to llvm-commits.
> >>
> >> Regards
> >> / Karl-Johan Karlsson
> >>
> >>>
> >>> Thanks,
> >>> Hans
> >>>
> >>>
> >> _______________________________________________
> >> LLVM Developers mailing list
> >> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> >>
> >>
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> >
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory



More information about the llvm-commits mailing list