On Mon, Apr 14, 2008 at 5:37 PM, Chris Lattner <sabre at nondot.org> wrote:> The code generator does CFG simplification to handle cases where blocks > become dead during lowering.Oh... is there a way to prevent that from happening? While %x is always 1 and %T is always taken, %F isn't actually dead. There would be a way (with another intrinsic) for control to flow into %F at the point of.. br i1 %x, label %T, label %F That's why I wanted the rest of the compiler to still know about the potential flow into %F. Ed
On Mon, Apr 14, 2008 at 2:50 PM, Edward Lee <eslee3 at uiuc.edu> wrote:> On Mon, Apr 14, 2008 at 5:37 PM, Chris Lattner <sabre at nondot.org> wrote: > > The code generator does CFG simplification to handle cases where blocks > > become dead during lowering. > Oh... is there a way to prevent that from happening? While %x is > always 1 and %T is always taken, %F isn't actually dead. There would > be a way (with another intrinsic) for control to flow into %F at the > point of.. > br i1 %x, label %T, label %F > > That's why I wanted the rest of the compiler to still know about the > potential flow into %F. >Then that flow would be explicit in the CFG, right? Then %F wouldn't be dead, I'm assuming. -bw
On Mon, 14 Apr 2008, Edward Lee wrote:> On Mon, Apr 14, 2008 at 5:37 PM, Chris Lattner <sabre at nondot.org> wrote: >> The code generator does CFG simplification to handle cases where blocks >> become dead during lowering. > Oh... is there a way to prevent that from happening? While %x is > always 1 and %T is always taken, %F isn't actually dead. There would > be a way (with another intrinsic) for control to flow into %F at the > point of.. > br i1 %x, label %T, label %F > > That's why I wanted the rest of the compiler to still know about the > potential flow into %F.You can change the code generator or not run the block layout pass. -Chris -- http://nondot.org/sabre/ http://llvm.org/
On Mon, Apr 14, 2008 at 5:02 PM, Bill Wendling <isanbard at gmail.com> wrote:> Then that flow would be explicit in the CFG, right? Then %F wouldn't > be dead, I'm assuming.Right. That's why I used a conditional branch after the intrinsic, but it sounds like the CFG simplification pass after lowering will optimize it away and no longer have the flow explicit. (To the rest of the compiler, the only flow into %F is from the branch, but actual execution can have flow enter %F from elsewhere with the *same* flow behavior as if it entered from the branch.) On Mon, Apr 14, 2008 at 6:00 PM, Chris Lattner <sabre at nondot.org> wrote:> You can change the code generator or not run the block layout pass.Ok thanks for the help. I'll try finding where to twiddle this. Perhaps explicitly check if the branch's condition is the call to my intrinsic. Or is there another way for me to have my intrinsic return a Value that causes the codegen to emit an unconditional jump yet keep the CFG intact? Ed