[LLVMdev] Segmented Stacks (re-roll)

Evan Cheng evan.cheng at apple.com
Tue Aug 23 11:08:36 PDT 2011


On Aug 23, 2011, at 9:24 AM, Sanjoy Das wrote:

> Hi!
> 
>> diff --git a/lib/CodeGen/StackSegmenter.cpp b/lib/CodeGen/StackSegmenter.cpp
>> new file mode 100644
>> index 0000000..5ffb8f2
>> --- /dev/null
>> +++ b/lib/CodeGen/StackSegmenter.cpp
>> @@ -0,0 +1,48 @@
>> +//===-- StackSegmenter.h - Prolog/Epilog code insertion -------*- C++ -* --===//
>> 
>> The comment is obviously incorrect.
> 
> Thanks.  So much for lifting file headers. :)
> 
>> 
>> diff --git a/lib/CodeGen/StackSegmenter.h b/lib/CodeGen/StackSegmenter.h
>> new file mode 100644
>> index 0000000..1284532
>> --- /dev/null
>> +++ b/lib/CodeGen/StackSegmenter.h
>> @@ -0,0 +1,43 @@
>> +//===-- StackSegmenter.h - Prolog/Epilog code insertion -------*- C++ -* --===//
>> 
>> Please write comment that clearly indicates what the pass would do.
> 
> Will do.
> 
>> A bigger question is why is StackSegmenter.{h|cpp} are for? It's empty as far as I can tell.
> 
> In the `Prologue code emission for X86.', I modify this pass to emit
> segmented stacks code before function prologues (by calling a function
> in X86FrameLowering).  I organized the code this way since it seemed
> more elegant than checking for a flag inside the corresponding
> emitPrologue.


According to the patch you send, the pass is not doing anything:

+bool StackSegmenter::runOnMachineFunction(MachineFunction &MF) {
+  return false;
+}
+

Evan

> 
> -- 
> Sanjoy Das
> http://playingwithpointers.com




More information about the llvm-dev mailing list