@@ -47,7 +47,9 @@ using namespace llvm;
4747
4848#define DEBUG_TYPE " nvptx-reflect"
4949
50- namespace llvm { void initializeNVVMReflectPass (PassRegistry &); }
50+ namespace llvm {
51+ void initializeNVVMReflectPass (PassRegistry &);
52+ }
5153
5254namespace {
5355class NVVMReflect : public FunctionPass {
@@ -61,15 +63,15 @@ class NVVMReflect : public FunctionPass {
6163
6264 bool runOnFunction (Function &) override ;
6365};
64- }
66+ } // namespace
6567
6668FunctionPass *llvm::createNVVMReflectPass (unsigned int SmVersion) {
6769 return new NVVMReflect (SmVersion);
6870}
6971
7072static cl::opt<bool >
71- NVVMReflectEnabled (" nvvm-reflect-enable" , cl::init(true ), cl::Hidden,
72- cl::desc(" NVVM reflection, enabled by default" ));
73+ NVVMReflectEnabled (" nvvm-reflect-enable" , cl::init(true ), cl::Hidden,
74+ cl::desc(" NVVM reflection, enabled by default" ));
7375
7476char NVVMReflect::ID = 0 ;
7577INITIALIZE_PASS (NVVMReflect, " nvvm-reflect" ,
@@ -189,8 +191,7 @@ static bool runNVVMReflect(Function &F, unsigned SmVersion) {
189191 // until we find a terminator that we can then remove.
190192 while (!ToSimplify.empty ()) {
191193 Instruction *I = ToSimplify.pop_back_val ();
192- if (Constant *C =
193- ConstantFoldInstruction (I, F.getDataLayout ())) {
194+ if (Constant *C = ConstantFoldInstruction (I, F.getDataLayout ())) {
194195 for (User *U : I->users ())
195196 if (Instruction *I = dyn_cast<Instruction>(U))
196197 ToSimplify.push_back (I);
@@ -220,13 +221,7 @@ bool NVVMReflect::runOnFunction(Function &F) {
220221 return runNVVMReflect (F, SmVersion);
221222}
222223
223- NVVMReflectPass::NVVMReflectPass () {
224- // Get the CPU string from the command line if not provided.
225- std::string MCPU = codegen::getMCPU ();
226- StringRef SM = MCPU;
227- if (!SM.consume_front (" sm_" ) || SM.consumeInteger (10 , SmVersion))
228- SmVersion = 0 ;
229- }
224+ NVVMReflectPass::NVVMReflectPass () {}
230225
231226PreservedAnalyses NVVMReflectPass::run (Function &F,
232227 FunctionAnalysisManager &AM) {
0 commit comments