Add functional equivalents to SelectionDAGs isFloatingPoint(), getConstantOperandVal() which frequently is used during selection.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
include/llvm/CodeGen/GlobalISel/Utils.h | ||
---|---|---|
65 | This name is too generic to live in the llvm namespace (I would expect the function to take Instruction:: opcodes). More importantly, AArch64RegisterBankInfo.cpp has a 'isPreISelGenericFloatingPointOpcode', which has a different behavior (it ignores itofp, because it interprets 'floating point opcode' as 'all operands are FP values') IMO that shows that this is too nebulous to be shared. Keep it next to your use? Otherwise, maybe we could make this precise enough that we could share it? For instance, 'isFloatingPointVRegDef' that takes a vreg, checks its definition, and returns true if the def is known to be FP? | |
76 | I added a 'getConstantVRegVal' in r298855, but that's only in the selector; the Optional hopefully lets it replace all three functions (after extracting it from the selector) ? |
This name is too generic to live in the llvm namespace (I would expect the function to take Instruction:: opcodes).
More importantly, AArch64RegisterBankInfo.cpp has a 'isPreISelGenericFloatingPointOpcode', which has a different behavior (it ignores itofp, because it interprets 'floating point opcode' as 'all operands are FP values')
IMO that shows that this is too nebulous to be shared. Keep it next to your use?
Otherwise, maybe we could make this precise enough that we could share it? For instance, 'isFloatingPointVRegDef' that takes a vreg, checks its definition, and returns true if the def is known to be FP?