[llvm] [LLVM][IR] Add native vector support to ConstantInt & ConstantFP. (PR #74502)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 18 02:01:27 PST 2024
================
@@ -35,6 +35,20 @@
using namespace llvm;
using namespace PatternMatch;
+// As set of temporary options to help migrate how splats are represented.
+static cl::opt<bool> UseConstantIntForFixedLengthSplat(
+ "use-constant-int-for-fixed-length-splat", cl::init(false), cl::Hidden,
+ cl::desc("Use ConstantInt's native fixed-length vector splat support."));
+static cl::opt<bool> UseConstantFPForFixedLengthSplat(
+ "use-constant-fp-for-fixed-length-splat", cl::init(false), cl::Hidden,
+ cl::desc("Use ConstantFP's native fixed-length vector splat support."));
+static cl::opt<bool> UseConstantIntForScalableSplat(
+ "use-constant-int-for-scalable-splat", cl::init(false), cl::Hidden,
+ cl::desc("Use ConstantInt's native scalable vector splat support."));
+static cl::opt<bool> UseConstantFPForScalableSplat(
+ "use-constant-fp-for-scalable-splat", cl::init(false), cl::Hidden,
+ cl::desc("Use ConstantFP's native scalable vector splat support."));
+
----------------
nikic wrote:
I'd say tentatively "no". We only really export options if we need to *read* them from multiple files. If we wanted to make these settable via API, I think the way we'd typically do that is by moving them into LLVMContext and adding setters.
FWIW, I don't think these options are mature enough yet for practical usage.
> I tried to set them directly from within a custom tool, but failed to get access to these. For us, setting them via. the command line is impractical.
Can you provide more details on this? The usual way to set the options is via cl::ParseCommandLineOptions, which doesn't mean that they actually have to come from the command line. It's pretty typical to just hardcode some options in the invocation.
https://github.com/llvm/llvm-project/pull/74502
More information about the llvm-commits
mailing list