diff options
Diffstat (limited to 'include/llvm/IR/InlineAsm.h')
-rw-r--r-- | include/llvm/IR/InlineAsm.h | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/include/llvm/IR/InlineAsm.h b/include/llvm/IR/InlineAsm.h index d2e9e48539ceb..40ba830b88198 100644 --- a/include/llvm/IR/InlineAsm.h +++ b/include/llvm/IR/InlineAsm.h @@ -223,6 +223,7 @@ public: Extra_AsmDialect = 4, Extra_MayLoad = 8, Extra_MayStore = 16, + Extra_IsConvergent = 32, // Inline asm operands map to multiple SDNode / MachineInstr operands. // The first operand is an immediate describing the asm operand, the low @@ -271,6 +272,16 @@ public: return Kind | (NumOps << 3); } + static bool isRegDefKind(unsigned Flag){ return getKind(Flag) == Kind_RegDef;} + static bool isImmKind(unsigned Flag) { return getKind(Flag) == Kind_Imm; } + static bool isMemKind(unsigned Flag) { return getKind(Flag) == Kind_Mem; } + static bool isRegDefEarlyClobberKind(unsigned Flag) { + return getKind(Flag) == Kind_RegDefEarlyClobber; + } + static bool isClobberKind(unsigned Flag) { + return getKind(Flag) == Kind_Clobber; + } + /// getFlagWordForMatchingOp - Augment an existing flag word returned by /// getFlagWord with information indicating that this input operand is tied /// to a previous output operand. @@ -289,6 +300,8 @@ public: static unsigned getFlagWordForRegClass(unsigned InputFlag, unsigned RC) { // Store RC + 1, reserve the value 0 to mean 'no register class'. ++RC; + assert(!isImmKind(InputFlag) && "Immediates cannot have a register class"); + assert(!isMemKind(InputFlag) && "Memory operand cannot have a register class"); assert(RC <= 0x7fff && "Too large register class ID"); assert((InputFlag & ~0xffff) == 0 && "High bits already contain data"); return InputFlag | (RC << 16); @@ -297,6 +310,7 @@ public: /// Augment an existing flag word returned by getFlagWord with the constraint /// code for a memory constraint. static unsigned getFlagWordForMem(unsigned InputFlag, unsigned Constraint) { + assert(isMemKind(InputFlag) && "InputFlag is not a memory constraint!"); assert(Constraint <= 0x7fff && "Too large a memory constraint ID"); assert(Constraint <= Constraints_Max && "Unknown constraint ID"); assert((InputFlag & ~0xffff) == 0 && "High bits already contain data"); @@ -312,16 +326,6 @@ public: return Flags & 7; } - static bool isRegDefKind(unsigned Flag){ return getKind(Flag) == Kind_RegDef;} - static bool isImmKind(unsigned Flag) { return getKind(Flag) == Kind_Imm; } - static bool isMemKind(unsigned Flag) { return getKind(Flag) == Kind_Mem; } - static bool isRegDefEarlyClobberKind(unsigned Flag) { - return getKind(Flag) == Kind_RegDefEarlyClobber; - } - static bool isClobberKind(unsigned Flag) { - return getKind(Flag) == Kind_Clobber; - } - static unsigned getMemoryConstraintID(unsigned Flag) { assert(isMemKind(Flag)); return (Flag >> Constraints_ShiftAmount) & 0x7fff; |