llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

PPCTLSDynamicCallPass needs to be preceded by LiveVariables otherwise stage 2 clang build fails

Open stefanp-synopsys opened this issue 8 years ago • 1 comments

Bugzilla Link 39756
Version trunk
OS Linux
CC @hfinkel,@nemanjai

Extended Description

Currently in PPCTargetMachine.cpp we have the pass PPCTLSDynamicCallPass preceded by LiveVariables. If the LiveVariables pass is removed then stage 2 clang fails to build. The dependency should not be required. Should investigate the failure to find out where the bug comes from and possibly remove the dependency.

stefanp-synopsys avatar Nov 22 '18 16:11 stefanp-synopsys

Adding further details here with respect to the history of this code.

First on Tue Feb 10 2015 r228725 - [PowerPC] Fix reverted patch r227976 to avoid register assignment issues This patch adds the following two lines to PPCTargetMachine.cpp. if (getPPCTargetMachine().getRelocationModel() == Reloc::PIC_) addPass(createPPCTLSDynamicCallPass());

This patch adds the PPCTLSDynamicCallPass to run before register allocation and only in the case of using the PIC model.

On Apr 28 2016 the commit r267954 - LiveIntervalAnalysis: Remove LiveVariables requirement

This patch removes the LiveVariables requirement from LiveIntervalAnalysis. However, the author noticed that PPCTLSDynamicCallPass still requires to have LiveVariables run first otherwise a stage 2 bootstrap build of clang fails. Therefore, LiveVariables was added just before that pass in PowerPC specific code.

stefanp-synopsys avatar Nov 24 '18 02:11 stefanp-synopsys