[PATCH] D27051: [X86] Add NumRegisterParameters Module Flag

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 30 17:00:21 PST 2017

rnk added inline comments.

Comment at: lib/CodeGen/CodeGenModule.cpp:421
+  // Record mregparm value.
+  getModule().addModuleFlag(llvm::Module::Error, "NumRegisterParameters",
+                            CodeGenOpts.NumRegisterParameters);
I'd like this to be conditional on NumRegisterParameters being non-zero, so that it doesn't pollute the vast majority of modules that don't use -mregparm. I think you will get the right LTO diagnostic behavior if you use llvm::Module::Require instead of Error here.

Comment at: test/CodeGenCUDA/flush-denormals.cu:21
-// FTZ:!llvm.module.flags = !{[[MODFLAG:![0-9]+]]}
+// FTZ:!llvm.module.flags = !{!0, [[MODFLAG:![0-9]+]]}
 // FTZ:[[MODFLAG]] = !{i32 4, !"nvvm-reflect-ftz", i32 1}
jlebar wrote:
> Hm, this is a bummer, but I don't immediately see a better way to do it.
I think this can be removed if the module flag is made conditional.


More information about the llvm-commits mailing list