[LLVMdev] Segmented Stacks (re-roll)

Evan Cheng evan.cheng at apple.com
Wed Aug 24 18:06:39 PDT 2011


Please move it into PEI. It doesn't make sense to add a pass, which has costs, for this. 

Evan

On Aug 23, 2011, at 6:52 PM, Sanjoy Das wrote:

> Hi!
>> According to the patch you send, the pass is not doing anything:
>> 
>> +bool StackSegmenter::runOnMachineFunction(MachineFunction &MF) {
>> +  return false;
>> +}
>> +
> 
> It is, in the next patch.
> 
> diff --git a/lib/CodeGen/StackSegmenter.cpp b/lib/CodeGen/StackSegmenter.cpp
> index 5ffb8f2..cc2ca87 100644
> --- a/lib/CodeGen/StackSegmenter.cpp
> +++ b/lib/CodeGen/StackSegmenter.cpp
> @@ -40,7 +40,10 @@ void StackSegmenter::getAnalysisUsage(AnalysisUsage
> &info) const {
> }
> 
> bool StackSegmenter::runOnMachineFunction(MachineFunction &MF) {
> -  return false;
> +  const TargetFrameLowering &TFI = *MF.getTarget().getFrameLowering();
> +  TFI.adjustForSegmentedStacks(MF);
> +  // adjustForSegmentedStacks always changes the MachineFunction
> +  return true;
> }
> 
> FunctionPass *llvm::createStackSegmenter() {
> 
> -- 
> Sanjoy Das
> http://playingwithpointers.com




More information about the llvm-dev mailing list