forked from OSchip/llvm-project
MIR Serialization: Change MIR syntax - use custom syntax for MBBs.
This commit modifies the way the machine basic blocks are serialized - now the machine basic blocks are serialized using a custom syntax instead of relying on YAML primitives. Instead of using YAML mappings to represent the individual machine basic blocks in a machine function's body, the new syntax uses a single YAML block scalar which contains all of the machine basic blocks and instructions for that function. This is an example of a function's body that uses the old syntax: body: - id: 0 name: entry instructions: - '%eax = MOV32r0 implicit-def %eflags' - 'RETQ %eax' ... The same body is now written like this: body: | bb.0.entry: %eax = MOV32r0 implicit-def %eflags RETQ %eax ... This syntax change is motivated by the fact that the bundled machine instructions didn't map that well to the old syntax which was using a single YAML sequence to store all of the machine instructions in a block. The bundled machine instructions internally use flags like BundledPred and BundledSucc to determine the bundles, and serializing them as MI flags using the old syntax would have had a negative impact on the readability and the ease of editing for MIR files. The new syntax allows me to serialize the bundled machine instructions using a block construct without relying on the internal flags, for example: BUNDLE implicit-def dead %itstate, implicit-def %s1 ... { t2IT 1, 24, implicit-def %itstate %s1 = VMOVS killed %s0, 1, killed %cpsr, implicit killed %itstate } This commit also converts the MIR testcases to the new syntax. I developed a script that can convert from the old syntax to the new one. I will post the script on the llvm-commits mailing list in the thread for this commit. llvm-svn: 244982
This commit is contained in:
parent
2038b54eae
commit
5022f6bb81
|
@ -73,6 +73,20 @@ template <> struct ScalarTraits<FlowStringValue> {
|
||||||
static bool mustQuote(StringRef Scalar) { return needsQuotes(Scalar); }
|
static bool mustQuote(StringRef Scalar) { return needsQuotes(Scalar); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct BlockStringValue {
|
||||||
|
StringValue Value;
|
||||||
|
};
|
||||||
|
|
||||||
|
template <> struct BlockScalarTraits<BlockStringValue> {
|
||||||
|
static void output(const BlockStringValue &S, void *Ctx, raw_ostream &OS) {
|
||||||
|
return ScalarTraits<StringValue>::output(S.Value, Ctx, OS);
|
||||||
|
}
|
||||||
|
|
||||||
|
static StringRef input(StringRef Scalar, void *Ctx, BlockStringValue &S) {
|
||||||
|
return ScalarTraits<StringValue>::input(Scalar, Ctx, S.Value);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/// A wrapper around unsigned which contains a source range that's being set
|
/// A wrapper around unsigned which contains a source range that's being set
|
||||||
/// during parsing.
|
/// during parsing.
|
||||||
struct UnsignedValue {
|
struct UnsignedValue {
|
||||||
|
@ -164,36 +178,6 @@ template <> struct MappingTraits<MachineFunctionLiveIn> {
|
||||||
static const bool flow = true;
|
static const bool flow = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct MachineBasicBlock {
|
|
||||||
unsigned ID;
|
|
||||||
StringValue Name;
|
|
||||||
StringValue IRBlock;
|
|
||||||
unsigned Alignment = 0;
|
|
||||||
bool IsLandingPad = false;
|
|
||||||
bool AddressTaken = false;
|
|
||||||
std::vector<FlowStringValue> Successors;
|
|
||||||
std::vector<UnsignedValue> SuccessorWeights;
|
|
||||||
std::vector<FlowStringValue> LiveIns;
|
|
||||||
std::vector<StringValue> Instructions;
|
|
||||||
};
|
|
||||||
|
|
||||||
template <> struct MappingTraits<MachineBasicBlock> {
|
|
||||||
static void mapping(IO &YamlIO, MachineBasicBlock &MBB) {
|
|
||||||
YamlIO.mapRequired("id", MBB.ID);
|
|
||||||
YamlIO.mapOptional("name", MBB.Name,
|
|
||||||
StringValue()); // Don't print out an empty name.
|
|
||||||
YamlIO.mapOptional("ir-block", MBB.IRBlock,
|
|
||||||
StringValue()); // Don't print out an empty BB reference.
|
|
||||||
YamlIO.mapOptional("alignment", MBB.Alignment);
|
|
||||||
YamlIO.mapOptional("isLandingPad", MBB.IsLandingPad);
|
|
||||||
YamlIO.mapOptional("addressTaken", MBB.AddressTaken);
|
|
||||||
YamlIO.mapOptional("successors", MBB.Successors);
|
|
||||||
YamlIO.mapOptional("weights", MBB.SuccessorWeights);
|
|
||||||
YamlIO.mapOptional("liveins", MBB.LiveIns);
|
|
||||||
YamlIO.mapOptional("instructions", MBB.Instructions);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/// Serializable representation of stack object from the MachineFrameInfo class.
|
/// Serializable representation of stack object from the MachineFrameInfo class.
|
||||||
///
|
///
|
||||||
/// The flags 'isImmutable' and 'isAliased' aren't serialized, as they are
|
/// The flags 'isImmutable' and 'isAliased' aren't serialized, as they are
|
||||||
|
@ -320,7 +304,6 @@ template <> struct MappingTraits<MachineJumpTable::Entry> {
|
||||||
|
|
||||||
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::MachineFunctionLiveIn)
|
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::MachineFunctionLiveIn)
|
||||||
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::VirtualRegisterDefinition)
|
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::VirtualRegisterDefinition)
|
||||||
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::MachineBasicBlock)
|
|
||||||
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::MachineStackObject)
|
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::MachineStackObject)
|
||||||
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::FixedMachineStackObject)
|
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::FixedMachineStackObject)
|
||||||
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::MachineConstantPoolValue)
|
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::MachineConstantPoolValue)
|
||||||
|
@ -404,8 +387,7 @@ struct MachineFunction {
|
||||||
std::vector<MachineStackObject> StackObjects;
|
std::vector<MachineStackObject> StackObjects;
|
||||||
std::vector<MachineConstantPoolValue> Constants; /// Constant pool.
|
std::vector<MachineConstantPoolValue> Constants; /// Constant pool.
|
||||||
MachineJumpTable JumpTableInfo;
|
MachineJumpTable JumpTableInfo;
|
||||||
|
BlockStringValue Body;
|
||||||
std::vector<MachineBasicBlock> BasicBlocks;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <> struct MappingTraits<MachineFunction> {
|
template <> struct MappingTraits<MachineFunction> {
|
||||||
|
@ -426,7 +408,7 @@ template <> struct MappingTraits<MachineFunction> {
|
||||||
YamlIO.mapOptional("constants", MF.Constants);
|
YamlIO.mapOptional("constants", MF.Constants);
|
||||||
if (!YamlIO.outputting() || !MF.JumpTableInfo.Entries.empty())
|
if (!YamlIO.outputting() || !MF.JumpTableInfo.Entries.empty())
|
||||||
YamlIO.mapOptional("jumpTable", MF.JumpTableInfo);
|
YamlIO.mapOptional("jumpTable", MF.JumpTableInfo);
|
||||||
YamlIO.mapOptional("body", MF.BasicBlocks);
|
YamlIO.mapOptional("body", MF.Body);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ class Pass;
|
||||||
class BasicBlock;
|
class BasicBlock;
|
||||||
class MachineFunction;
|
class MachineFunction;
|
||||||
class MCSymbol;
|
class MCSymbol;
|
||||||
class MIRPrinter;
|
class MIPrinter;
|
||||||
class SlotIndexes;
|
class SlotIndexes;
|
||||||
class StringRef;
|
class StringRef;
|
||||||
class raw_ostream;
|
class raw_ostream;
|
||||||
|
@ -660,7 +660,7 @@ private:
|
||||||
const_weight_iterator getWeightIterator(const_succ_iterator I) const;
|
const_weight_iterator getWeightIterator(const_succ_iterator I) const;
|
||||||
|
|
||||||
friend class MachineBranchProbabilityInfo;
|
friend class MachineBranchProbabilityInfo;
|
||||||
friend class MIRPrinter;
|
friend class MIPrinter;
|
||||||
|
|
||||||
/// Return weight of the edge from this block to MBB. This method should NOT
|
/// Return weight of the edge from this block to MBB. This method should NOT
|
||||||
/// be called directly, but by using getEdgeWeight method from
|
/// be called directly, but by using getEdgeWeight method from
|
||||||
|
|
|
@ -79,7 +79,18 @@ MIToken &MIToken::setIntegerValue(APSInt IntVal) {
|
||||||
|
|
||||||
/// Skip the leading whitespace characters and return the updated cursor.
|
/// Skip the leading whitespace characters and return the updated cursor.
|
||||||
static Cursor skipWhitespace(Cursor C) {
|
static Cursor skipWhitespace(Cursor C) {
|
||||||
while (isspace(C.peek()))
|
while (isblank(C.peek()))
|
||||||
|
C.advance();
|
||||||
|
return C;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool isNewlineChar(char C) { return C == '\n' || C == '\r'; }
|
||||||
|
|
||||||
|
/// Skip a line comment and return the updated cursor.
|
||||||
|
static Cursor skipComment(Cursor C) {
|
||||||
|
if (C.peek() != ';')
|
||||||
|
return C;
|
||||||
|
while (!isNewlineChar(C.peek()) && !C.isEOF())
|
||||||
C.advance();
|
C.advance();
|
||||||
return C;
|
return C;
|
||||||
}
|
}
|
||||||
|
@ -127,7 +138,7 @@ static Cursor lexStringConstant(
|
||||||
function_ref<void(StringRef::iterator Loc, const Twine &)> ErrorCallback) {
|
function_ref<void(StringRef::iterator Loc, const Twine &)> ErrorCallback) {
|
||||||
assert(C.peek() == '"');
|
assert(C.peek() == '"');
|
||||||
for (C.advance(); C.peek() != '"'; C.advance()) {
|
for (C.advance(); C.peek() != '"'; C.advance()) {
|
||||||
if (C.isEOF()) {
|
if (C.isEOF() || isNewlineChar(C.peek())) {
|
||||||
ErrorCallback(
|
ErrorCallback(
|
||||||
C.location(),
|
C.location(),
|
||||||
"end of machine instruction reached before the closing '\"'");
|
"end of machine instruction reached before the closing '\"'");
|
||||||
|
@ -206,6 +217,10 @@ static MIToken::TokenKind getIdentifierKind(StringRef Identifier) {
|
||||||
.Case("jump-table", MIToken::kw_jump_table)
|
.Case("jump-table", MIToken::kw_jump_table)
|
||||||
.Case("constant-pool", MIToken::kw_constant_pool)
|
.Case("constant-pool", MIToken::kw_constant_pool)
|
||||||
.Case("liveout", MIToken::kw_liveout)
|
.Case("liveout", MIToken::kw_liveout)
|
||||||
|
.Case("address-taken", MIToken::kw_address_taken)
|
||||||
|
.Case("landing-pad", MIToken::kw_landing_pad)
|
||||||
|
.Case("liveins", MIToken::kw_liveins)
|
||||||
|
.Case("successors", MIToken::kw_successors)
|
||||||
.Default(MIToken::Identifier);
|
.Default(MIToken::Identifier);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -224,10 +239,12 @@ static Cursor maybeLexIdentifier(Cursor C, MIToken &Token) {
|
||||||
static Cursor maybeLexMachineBasicBlock(
|
static Cursor maybeLexMachineBasicBlock(
|
||||||
Cursor C, MIToken &Token,
|
Cursor C, MIToken &Token,
|
||||||
function_ref<void(StringRef::iterator Loc, const Twine &)> ErrorCallback) {
|
function_ref<void(StringRef::iterator Loc, const Twine &)> ErrorCallback) {
|
||||||
if (!C.remaining().startswith("%bb."))
|
bool IsReference = C.remaining().startswith("%bb.");
|
||||||
|
if (!IsReference && !C.remaining().startswith("bb."))
|
||||||
return None;
|
return None;
|
||||||
auto Range = C;
|
auto Range = C;
|
||||||
C.advance(4); // Skip '%bb.'
|
unsigned PrefixLength = IsReference ? 4 : 3;
|
||||||
|
C.advance(PrefixLength); // Skip '%bb.' or 'bb.'
|
||||||
if (!isdigit(C.peek())) {
|
if (!isdigit(C.peek())) {
|
||||||
Token.reset(MIToken::Error, C.remaining());
|
Token.reset(MIToken::Error, C.remaining());
|
||||||
ErrorCallback(C.location(), "expected a number after '%bb.'");
|
ErrorCallback(C.location(), "expected a number after '%bb.'");
|
||||||
|
@ -237,14 +254,16 @@ static Cursor maybeLexMachineBasicBlock(
|
||||||
while (isdigit(C.peek()))
|
while (isdigit(C.peek()))
|
||||||
C.advance();
|
C.advance();
|
||||||
StringRef Number = NumberRange.upto(C);
|
StringRef Number = NumberRange.upto(C);
|
||||||
unsigned StringOffset = 4 + Number.size(); // Drop '%bb.<id>'
|
unsigned StringOffset = PrefixLength + Number.size(); // Drop '%bb.<id>'
|
||||||
if (C.peek() == '.') {
|
if (C.peek() == '.') {
|
||||||
C.advance(); // Skip '.'
|
C.advance(); // Skip '.'
|
||||||
++StringOffset;
|
++StringOffset;
|
||||||
while (isIdentifierChar(C.peek()))
|
while (isIdentifierChar(C.peek()))
|
||||||
C.advance();
|
C.advance();
|
||||||
}
|
}
|
||||||
Token.reset(MIToken::MachineBasicBlock, Range.upto(C))
|
Token.reset(IsReference ? MIToken::MachineBasicBlock
|
||||||
|
: MIToken::MachineBasicBlockLabel,
|
||||||
|
Range.upto(C))
|
||||||
.setIntegerValue(APSInt(Number))
|
.setIntegerValue(APSInt(Number))
|
||||||
.setStringValue(Range.upto(C).drop_front(StringOffset));
|
.setStringValue(Range.upto(C).drop_front(StringOffset));
|
||||||
return C;
|
return C;
|
||||||
|
@ -460,10 +479,19 @@ static Cursor maybeLexSymbol(Cursor C, MIToken &Token) {
|
||||||
return C;
|
return C;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Cursor maybeLexNewline(Cursor C, MIToken &Token) {
|
||||||
|
if (!isNewlineChar(C.peek()))
|
||||||
|
return None;
|
||||||
|
auto Range = C;
|
||||||
|
C.advance();
|
||||||
|
Token.reset(MIToken::Newline, Range.upto(C));
|
||||||
|
return C;
|
||||||
|
}
|
||||||
|
|
||||||
StringRef llvm::lexMIToken(
|
StringRef llvm::lexMIToken(
|
||||||
StringRef Source, MIToken &Token,
|
StringRef Source, MIToken &Token,
|
||||||
function_ref<void(StringRef::iterator Loc, const Twine &)> ErrorCallback) {
|
function_ref<void(StringRef::iterator Loc, const Twine &)> ErrorCallback) {
|
||||||
auto C = skipWhitespace(Cursor(Source));
|
auto C = skipComment(skipWhitespace(Cursor(Source)));
|
||||||
if (C.isEOF()) {
|
if (C.isEOF()) {
|
||||||
Token.reset(MIToken::Eof, C.remaining());
|
Token.reset(MIToken::Eof, C.remaining());
|
||||||
return C.remaining();
|
return C.remaining();
|
||||||
|
@ -471,10 +499,10 @@ StringRef llvm::lexMIToken(
|
||||||
|
|
||||||
if (Cursor R = maybeLexIntegerType(C, Token))
|
if (Cursor R = maybeLexIntegerType(C, Token))
|
||||||
return R.remaining();
|
return R.remaining();
|
||||||
if (Cursor R = maybeLexIdentifier(C, Token))
|
|
||||||
return R.remaining();
|
|
||||||
if (Cursor R = maybeLexMachineBasicBlock(C, Token, ErrorCallback))
|
if (Cursor R = maybeLexMachineBasicBlock(C, Token, ErrorCallback))
|
||||||
return R.remaining();
|
return R.remaining();
|
||||||
|
if (Cursor R = maybeLexIdentifier(C, Token))
|
||||||
|
return R.remaining();
|
||||||
if (Cursor R = maybeLexJumpTableIndex(C, Token))
|
if (Cursor R = maybeLexJumpTableIndex(C, Token))
|
||||||
return R.remaining();
|
return R.remaining();
|
||||||
if (Cursor R = maybeLexStackObject(C, Token))
|
if (Cursor R = maybeLexStackObject(C, Token))
|
||||||
|
@ -499,6 +527,8 @@ StringRef llvm::lexMIToken(
|
||||||
return R.remaining();
|
return R.remaining();
|
||||||
if (Cursor R = maybeLexSymbol(C, Token))
|
if (Cursor R = maybeLexSymbol(C, Token))
|
||||||
return R.remaining();
|
return R.remaining();
|
||||||
|
if (Cursor R = maybeLexNewline(C, Token))
|
||||||
|
return R.remaining();
|
||||||
|
|
||||||
Token.reset(MIToken::Error, C.remaining());
|
Token.reset(MIToken::Error, C.remaining());
|
||||||
ErrorCallback(C.location(),
|
ErrorCallback(C.location(),
|
||||||
|
|
|
@ -30,6 +30,7 @@ struct MIToken {
|
||||||
// Markers
|
// Markers
|
||||||
Eof,
|
Eof,
|
||||||
Error,
|
Error,
|
||||||
|
Newline,
|
||||||
|
|
||||||
// Tokens with no info.
|
// Tokens with no info.
|
||||||
comma,
|
comma,
|
||||||
|
@ -75,11 +76,16 @@ struct MIToken {
|
||||||
kw_jump_table,
|
kw_jump_table,
|
||||||
kw_constant_pool,
|
kw_constant_pool,
|
||||||
kw_liveout,
|
kw_liveout,
|
||||||
|
kw_address_taken,
|
||||||
|
kw_landing_pad,
|
||||||
|
kw_liveins,
|
||||||
|
kw_successors,
|
||||||
|
|
||||||
// Identifier tokens
|
// Identifier tokens
|
||||||
Identifier,
|
Identifier,
|
||||||
IntegerType,
|
IntegerType,
|
||||||
NamedRegister,
|
NamedRegister,
|
||||||
|
MachineBasicBlockLabel,
|
||||||
MachineBasicBlock,
|
MachineBasicBlock,
|
||||||
StackObject,
|
StackObject,
|
||||||
FixedStackObject,
|
FixedStackObject,
|
||||||
|
@ -118,6 +124,10 @@ public:
|
||||||
|
|
||||||
bool isError() const { return Kind == Error; }
|
bool isError() const { return Kind == Error; }
|
||||||
|
|
||||||
|
bool isNewlineOrEOF() const { return Kind == Newline || Kind == Eof; }
|
||||||
|
|
||||||
|
bool isErrorOrEOF() const { return Kind == Error || Kind == Eof; }
|
||||||
|
|
||||||
bool isRegister() const {
|
bool isRegister() const {
|
||||||
return Kind == NamedRegister || Kind == underscore ||
|
return Kind == NamedRegister || Kind == underscore ||
|
||||||
Kind == VirtualRegister;
|
Kind == VirtualRegister;
|
||||||
|
@ -149,10 +159,10 @@ public:
|
||||||
|
|
||||||
bool hasIntegerValue() const {
|
bool hasIntegerValue() const {
|
||||||
return Kind == IntegerLiteral || Kind == MachineBasicBlock ||
|
return Kind == IntegerLiteral || Kind == MachineBasicBlock ||
|
||||||
Kind == StackObject || Kind == FixedStackObject ||
|
Kind == MachineBasicBlockLabel || Kind == StackObject ||
|
||||||
Kind == GlobalValue || Kind == VirtualRegister ||
|
Kind == FixedStackObject || Kind == GlobalValue ||
|
||||||
Kind == ConstantPoolItem || Kind == JumpTableIndex ||
|
Kind == VirtualRegister || Kind == ConstantPoolItem ||
|
||||||
Kind == IRBlock;
|
Kind == JumpTableIndex || Kind == IRBlock;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -90,11 +90,19 @@ public:
|
||||||
/// This function always return true.
|
/// This function always return true.
|
||||||
bool error(StringRef::iterator Loc, const Twine &Msg);
|
bool error(StringRef::iterator Loc, const Twine &Msg);
|
||||||
|
|
||||||
|
bool
|
||||||
|
parseBasicBlockDefinitions(DenseMap<unsigned, MachineBasicBlock *> &MBBSlots);
|
||||||
|
bool parseBasicBlocks();
|
||||||
bool parse(MachineInstr *&MI);
|
bool parse(MachineInstr *&MI);
|
||||||
bool parseStandaloneMBB(MachineBasicBlock *&MBB);
|
bool parseStandaloneMBB(MachineBasicBlock *&MBB);
|
||||||
bool parseStandaloneNamedRegister(unsigned &Reg);
|
bool parseStandaloneNamedRegister(unsigned &Reg);
|
||||||
bool parseStandaloneVirtualRegister(unsigned &Reg);
|
bool parseStandaloneVirtualRegister(unsigned &Reg);
|
||||||
bool parseStandaloneIRBlockReference(const BasicBlock *&BB);
|
|
||||||
|
bool
|
||||||
|
parseBasicBlockDefinition(DenseMap<unsigned, MachineBasicBlock *> &MBBSlots);
|
||||||
|
bool parseBasicBlock(MachineBasicBlock &MBB);
|
||||||
|
bool parseBasicBlockLiveins(MachineBasicBlock &MBB);
|
||||||
|
bool parseBasicBlockSuccessors(MachineBasicBlock &MBB);
|
||||||
|
|
||||||
bool parseRegister(unsigned &Reg);
|
bool parseRegister(unsigned &Reg);
|
||||||
bool parseRegisterFlag(unsigned &Flags);
|
bool parseRegisterFlag(unsigned &Flags);
|
||||||
|
@ -149,6 +157,10 @@ private:
|
||||||
/// Otherwise report an error and return true.
|
/// Otherwise report an error and return true.
|
||||||
bool expectAndConsume(MIToken::TokenKind TokenKind);
|
bool expectAndConsume(MIToken::TokenKind TokenKind);
|
||||||
|
|
||||||
|
/// If the current token is of the given kind, consume it and return true.
|
||||||
|
/// Otherwise return false.
|
||||||
|
bool consumeIfPresent(MIToken::TokenKind TokenKind);
|
||||||
|
|
||||||
void initNames2InstrOpCodes();
|
void initNames2InstrOpCodes();
|
||||||
|
|
||||||
/// Try to convert an instruction name to an opcode. Return true if the
|
/// Try to convert an instruction name to an opcode. Return true if the
|
||||||
|
@ -217,10 +229,17 @@ bool MIParser::error(const Twine &Msg) { return error(Token.location(), Msg); }
|
||||||
|
|
||||||
bool MIParser::error(StringRef::iterator Loc, const Twine &Msg) {
|
bool MIParser::error(StringRef::iterator Loc, const Twine &Msg) {
|
||||||
assert(Loc >= Source.data() && Loc <= (Source.data() + Source.size()));
|
assert(Loc >= Source.data() && Loc <= (Source.data() + Source.size()));
|
||||||
Error = SMDiagnostic(
|
const MemoryBuffer &Buffer = *SM.getMemoryBuffer(SM.getMainFileID());
|
||||||
SM, SMLoc(),
|
if (Loc >= Buffer.getBufferStart() && Loc <= Buffer.getBufferEnd()) {
|
||||||
SM.getMemoryBuffer(SM.getMainFileID())->getBufferIdentifier(), 1,
|
// Create an ordinary diagnostic when the source manager's buffer is the
|
||||||
Loc - Source.data(), SourceMgr::DK_Error, Msg.str(), Source, None, None);
|
// source string.
|
||||||
|
Error = SM.GetMessage(SMLoc::getFromPointer(Loc), SourceMgr::DK_Error, Msg);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// Create a diagnostic for a YAML string literal.
|
||||||
|
Error = SMDiagnostic(SM, SMLoc(), Buffer.getBufferIdentifier(), 1,
|
||||||
|
Loc - Source.data(), SourceMgr::DK_Error, Msg.str(),
|
||||||
|
Source, None, None);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -230,6 +249,8 @@ static const char *toString(MIToken::TokenKind TokenKind) {
|
||||||
return "','";
|
return "','";
|
||||||
case MIToken::equal:
|
case MIToken::equal:
|
||||||
return "'='";
|
return "'='";
|
||||||
|
case MIToken::colon:
|
||||||
|
return "':'";
|
||||||
case MIToken::lparen:
|
case MIToken::lparen:
|
||||||
return "'('";
|
return "'('";
|
||||||
case MIToken::rparen:
|
case MIToken::rparen:
|
||||||
|
@ -246,9 +267,236 @@ bool MIParser::expectAndConsume(MIToken::TokenKind TokenKind) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MIParser::parse(MachineInstr *&MI) {
|
bool MIParser::consumeIfPresent(MIToken::TokenKind TokenKind) {
|
||||||
|
if (Token.isNot(TokenKind))
|
||||||
|
return false;
|
||||||
lex();
|
lex();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MIParser::parseBasicBlockDefinition(
|
||||||
|
DenseMap<unsigned, MachineBasicBlock *> &MBBSlots) {
|
||||||
|
assert(Token.is(MIToken::MachineBasicBlockLabel));
|
||||||
|
unsigned ID = 0;
|
||||||
|
if (getUnsigned(ID))
|
||||||
|
return true;
|
||||||
|
auto Loc = Token.location();
|
||||||
|
auto Name = Token.stringValue();
|
||||||
|
lex();
|
||||||
|
bool HasAddressTaken = false;
|
||||||
|
bool IsLandingPad = false;
|
||||||
|
unsigned Alignment = 0;
|
||||||
|
BasicBlock *BB = nullptr;
|
||||||
|
if (consumeIfPresent(MIToken::lparen)) {
|
||||||
|
do {
|
||||||
|
// TODO: Report an error when multiple same attributes are specified.
|
||||||
|
switch (Token.kind()) {
|
||||||
|
case MIToken::kw_address_taken:
|
||||||
|
HasAddressTaken = true;
|
||||||
|
lex();
|
||||||
|
break;
|
||||||
|
case MIToken::kw_landing_pad:
|
||||||
|
IsLandingPad = true;
|
||||||
|
lex();
|
||||||
|
break;
|
||||||
|
case MIToken::kw_align:
|
||||||
|
if (parseAlignment(Alignment))
|
||||||
|
return true;
|
||||||
|
break;
|
||||||
|
case MIToken::IRBlock:
|
||||||
|
// TODO: Report an error when both name and ir block are specified.
|
||||||
|
if (parseIRBlock(BB, *MF.getFunction()))
|
||||||
|
return true;
|
||||||
|
lex();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} while (consumeIfPresent(MIToken::comma));
|
||||||
|
if (expectAndConsume(MIToken::rparen))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (expectAndConsume(MIToken::colon))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if (!Name.empty()) {
|
||||||
|
BB = dyn_cast_or_null<BasicBlock>(
|
||||||
|
MF.getFunction()->getValueSymbolTable().lookup(Name));
|
||||||
|
if (!BB)
|
||||||
|
return error(Loc, Twine("basic block '") + Name +
|
||||||
|
"' is not defined in the function '" +
|
||||||
|
MF.getName() + "'");
|
||||||
|
}
|
||||||
|
auto *MBB = MF.CreateMachineBasicBlock(BB);
|
||||||
|
MF.insert(MF.end(), MBB);
|
||||||
|
bool WasInserted = MBBSlots.insert(std::make_pair(ID, MBB)).second;
|
||||||
|
if (!WasInserted)
|
||||||
|
return error(Loc, Twine("redefinition of machine basic block with id #") +
|
||||||
|
Twine(ID));
|
||||||
|
if (Alignment)
|
||||||
|
MBB->setAlignment(Alignment);
|
||||||
|
if (HasAddressTaken)
|
||||||
|
MBB->setHasAddressTaken();
|
||||||
|
MBB->setIsLandingPad(IsLandingPad);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MIParser::parseBasicBlockDefinitions(
|
||||||
|
DenseMap<unsigned, MachineBasicBlock *> &MBBSlots) {
|
||||||
|
lex();
|
||||||
|
// Skip until the first machine basic block.
|
||||||
|
while (Token.is(MIToken::Newline))
|
||||||
|
lex();
|
||||||
|
if (Token.isErrorOrEOF())
|
||||||
|
return Token.isError();
|
||||||
|
if (Token.isNot(MIToken::MachineBasicBlockLabel))
|
||||||
|
return error("expected a basic block definition before instructions");
|
||||||
|
do {
|
||||||
|
if (parseBasicBlockDefinition(MBBSlots))
|
||||||
|
return true;
|
||||||
|
bool IsAfterNewline = false;
|
||||||
|
// Skip until the next machine basic block.
|
||||||
|
while (true) {
|
||||||
|
if ((Token.is(MIToken::MachineBasicBlockLabel) && IsAfterNewline) ||
|
||||||
|
Token.isErrorOrEOF())
|
||||||
|
break;
|
||||||
|
else if (Token.is(MIToken::MachineBasicBlockLabel))
|
||||||
|
return error("basic block definition should be located at the start of "
|
||||||
|
"the line");
|
||||||
|
if (Token.is(MIToken::Newline))
|
||||||
|
IsAfterNewline = true;
|
||||||
|
else
|
||||||
|
IsAfterNewline = false;
|
||||||
|
lex();
|
||||||
|
}
|
||||||
|
} while (!Token.isErrorOrEOF());
|
||||||
|
return Token.isError();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MIParser::parseBasicBlockLiveins(MachineBasicBlock &MBB) {
|
||||||
|
assert(Token.is(MIToken::kw_liveins));
|
||||||
|
lex();
|
||||||
|
if (expectAndConsume(MIToken::colon))
|
||||||
|
return true;
|
||||||
|
if (Token.isNewlineOrEOF()) // Allow an empty list of liveins.
|
||||||
|
return false;
|
||||||
|
do {
|
||||||
|
if (Token.isNot(MIToken::NamedRegister))
|
||||||
|
return error("expected a named register");
|
||||||
|
unsigned Reg = 0;
|
||||||
|
if (parseRegister(Reg))
|
||||||
|
return true;
|
||||||
|
MBB.addLiveIn(Reg);
|
||||||
|
lex();
|
||||||
|
} while (consumeIfPresent(MIToken::comma));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MIParser::parseBasicBlockSuccessors(MachineBasicBlock &MBB) {
|
||||||
|
assert(Token.is(MIToken::kw_successors));
|
||||||
|
lex();
|
||||||
|
if (expectAndConsume(MIToken::colon))
|
||||||
|
return true;
|
||||||
|
if (Token.isNewlineOrEOF()) // Allow an empty list of successors.
|
||||||
|
return false;
|
||||||
|
do {
|
||||||
|
if (Token.isNot(MIToken::MachineBasicBlock))
|
||||||
|
return error("expected a machine basic block reference");
|
||||||
|
MachineBasicBlock *SuccMBB = nullptr;
|
||||||
|
if (parseMBBReference(SuccMBB))
|
||||||
|
return true;
|
||||||
|
lex();
|
||||||
|
unsigned Weight = 0;
|
||||||
|
if (consumeIfPresent(MIToken::lparen)) {
|
||||||
|
if (Token.isNot(MIToken::IntegerLiteral))
|
||||||
|
return error("expected an integer literal after '('");
|
||||||
|
if (getUnsigned(Weight))
|
||||||
|
return true;
|
||||||
|
lex();
|
||||||
|
if (expectAndConsume(MIToken::rparen))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
MBB.addSuccessor(SuccMBB, Weight);
|
||||||
|
} while (consumeIfPresent(MIToken::comma));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MIParser::parseBasicBlock(MachineBasicBlock &MBB) {
|
||||||
|
// Skip the definition.
|
||||||
|
assert(Token.is(MIToken::MachineBasicBlockLabel));
|
||||||
|
lex();
|
||||||
|
if (consumeIfPresent(MIToken::lparen)) {
|
||||||
|
while (Token.isNot(MIToken::rparen) && !Token.isErrorOrEOF())
|
||||||
|
lex();
|
||||||
|
consumeIfPresent(MIToken::rparen);
|
||||||
|
}
|
||||||
|
consumeIfPresent(MIToken::colon);
|
||||||
|
|
||||||
|
// Parse the liveins and successors.
|
||||||
|
// N.B: Multiple lists of successors and liveins are allowed and they're
|
||||||
|
// merged into one.
|
||||||
|
// Example:
|
||||||
|
// liveins: %edi
|
||||||
|
// liveins: %esi
|
||||||
|
//
|
||||||
|
// is equivalent to
|
||||||
|
// liveins: %edi, %esi
|
||||||
|
while (true) {
|
||||||
|
if (Token.is(MIToken::kw_successors)) {
|
||||||
|
if (parseBasicBlockSuccessors(MBB))
|
||||||
|
return true;
|
||||||
|
} else if (Token.is(MIToken::kw_liveins)) {
|
||||||
|
if (parseBasicBlockLiveins(MBB))
|
||||||
|
return true;
|
||||||
|
} else if (consumeIfPresent(MIToken::Newline)) {
|
||||||
|
continue;
|
||||||
|
} else
|
||||||
|
break;
|
||||||
|
if (!Token.isNewlineOrEOF())
|
||||||
|
return error("expected line break at the end of a list");
|
||||||
|
lex();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Parse the instructions.
|
||||||
|
while (true) {
|
||||||
|
if (Token.is(MIToken::MachineBasicBlockLabel) || Token.is(MIToken::Eof))
|
||||||
|
return false;
|
||||||
|
else if (consumeIfPresent(MIToken::Newline))
|
||||||
|
continue;
|
||||||
|
MachineInstr *MI = nullptr;
|
||||||
|
if (parse(MI))
|
||||||
|
return true;
|
||||||
|
MBB.insert(MBB.end(), MI);
|
||||||
|
assert(Token.isNewlineOrEOF() && "MI is not fully parsed");
|
||||||
|
lex();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MIParser::parseBasicBlocks() {
|
||||||
|
lex();
|
||||||
|
// Skip until the first machine basic block.
|
||||||
|
while (Token.is(MIToken::Newline))
|
||||||
|
lex();
|
||||||
|
if (Token.isErrorOrEOF())
|
||||||
|
return Token.isError();
|
||||||
|
// The first parsing pass should have verified that this token is a MBB label
|
||||||
|
// in the 'parseBasicBlockDefinitions' method.
|
||||||
|
assert(Token.is(MIToken::MachineBasicBlockLabel));
|
||||||
|
do {
|
||||||
|
MachineBasicBlock *MBB = nullptr;
|
||||||
|
if (parseMBBReference(MBB))
|
||||||
|
return true;
|
||||||
|
if (parseBasicBlock(*MBB))
|
||||||
|
return true;
|
||||||
|
// The method 'parseBasicBlock' should parse the whole block until the next
|
||||||
|
// block or the end of file.
|
||||||
|
assert(Token.is(MIToken::MachineBasicBlockLabel) || Token.is(MIToken::Eof));
|
||||||
|
} while (Token.isNot(MIToken::Eof));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MIParser::parse(MachineInstr *&MI) {
|
||||||
// Parse any register operands before '='
|
// Parse any register operands before '='
|
||||||
MachineOperand MO = MachineOperand::CreateImm(0);
|
MachineOperand MO = MachineOperand::CreateImm(0);
|
||||||
SmallVector<MachineOperandWithLocation, 8> Operands;
|
SmallVector<MachineOperandWithLocation, 8> Operands;
|
||||||
|
@ -271,13 +519,13 @@ bool MIParser::parse(MachineInstr *&MI) {
|
||||||
// TODO: Parse the bundle instruction flags.
|
// TODO: Parse the bundle instruction flags.
|
||||||
|
|
||||||
// Parse the remaining machine operands.
|
// Parse the remaining machine operands.
|
||||||
while (Token.isNot(MIToken::Eof) && Token.isNot(MIToken::kw_debug_location) &&
|
while (!Token.isNewlineOrEOF() && Token.isNot(MIToken::kw_debug_location) &&
|
||||||
Token.isNot(MIToken::coloncolon)) {
|
Token.isNot(MIToken::coloncolon)) {
|
||||||
auto Loc = Token.location();
|
auto Loc = Token.location();
|
||||||
if (parseMachineOperandAndTargetFlags(MO))
|
if (parseMachineOperandAndTargetFlags(MO))
|
||||||
return true;
|
return true;
|
||||||
Operands.push_back(MachineOperandWithLocation(MO, Loc, Token.location()));
|
Operands.push_back(MachineOperandWithLocation(MO, Loc, Token.location()));
|
||||||
if (Token.is(MIToken::Eof) || Token.is(MIToken::coloncolon))
|
if (Token.isNewlineOrEOF() || Token.is(MIToken::coloncolon))
|
||||||
break;
|
break;
|
||||||
if (Token.isNot(MIToken::comma))
|
if (Token.isNot(MIToken::comma))
|
||||||
return error("expected ',' before the next machine operand");
|
return error("expected ',' before the next machine operand");
|
||||||
|
@ -299,12 +547,12 @@ bool MIParser::parse(MachineInstr *&MI) {
|
||||||
SmallVector<MachineMemOperand *, 2> MemOperands;
|
SmallVector<MachineMemOperand *, 2> MemOperands;
|
||||||
if (Token.is(MIToken::coloncolon)) {
|
if (Token.is(MIToken::coloncolon)) {
|
||||||
lex();
|
lex();
|
||||||
while (Token.isNot(MIToken::Eof)) {
|
while (!Token.isNewlineOrEOF()) {
|
||||||
MachineMemOperand *MemOp = nullptr;
|
MachineMemOperand *MemOp = nullptr;
|
||||||
if (parseMachineMemoryOperand(MemOp))
|
if (parseMachineMemoryOperand(MemOp))
|
||||||
return true;
|
return true;
|
||||||
MemOperands.push_back(MemOp);
|
MemOperands.push_back(MemOp);
|
||||||
if (Token.is(MIToken::Eof))
|
if (Token.isNewlineOrEOF())
|
||||||
break;
|
break;
|
||||||
if (Token.isNot(MIToken::comma))
|
if (Token.isNot(MIToken::comma))
|
||||||
return error("expected ',' before the next machine memory operand");
|
return error("expected ',' before the next machine memory operand");
|
||||||
|
@ -370,23 +618,6 @@ bool MIParser::parseStandaloneVirtualRegister(unsigned &Reg) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MIParser::parseStandaloneIRBlockReference(const BasicBlock *&BB) {
|
|
||||||
lex();
|
|
||||||
if (Token.isNot(MIToken::IRBlock))
|
|
||||||
return error("expected an IR block reference");
|
|
||||||
unsigned SlotNumber = 0;
|
|
||||||
if (getUnsigned(SlotNumber))
|
|
||||||
return true;
|
|
||||||
BB = getIRBlock(SlotNumber);
|
|
||||||
if (!BB)
|
|
||||||
return error(Twine("use of undefined IR block '%ir-block.") +
|
|
||||||
Twine(SlotNumber) + "'");
|
|
||||||
lex();
|
|
||||||
if (Token.isNot(MIToken::Eof))
|
|
||||||
return error("expected end of string after the IR block reference");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static const char *printImplicitRegisterFlag(const MachineOperand &MO) {
|
static const char *printImplicitRegisterFlag(const MachineOperand &MO) {
|
||||||
assert(MO.isImplicit());
|
assert(MO.isImplicit());
|
||||||
return MO.isDef() ? "implicit-def" : "implicit";
|
return MO.isDef() ? "implicit-def" : "implicit";
|
||||||
|
@ -621,7 +852,8 @@ bool MIParser::getUnsigned(unsigned &Result) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MIParser::parseMBBReference(MachineBasicBlock *&MBB) {
|
bool MIParser::parseMBBReference(MachineBasicBlock *&MBB) {
|
||||||
assert(Token.is(MIToken::MachineBasicBlock));
|
assert(Token.is(MIToken::MachineBasicBlock) ||
|
||||||
|
Token.is(MIToken::MachineBasicBlockLabel));
|
||||||
unsigned Number;
|
unsigned Number;
|
||||||
if (getUnsigned(Number))
|
if (getUnsigned(Number))
|
||||||
return true;
|
return true;
|
||||||
|
@ -1406,11 +1638,27 @@ bool MIParser::getDirectTargetFlag(StringRef Name, unsigned &Flag) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool llvm::parseMachineInstr(MachineInstr *&MI, SourceMgr &SM,
|
bool llvm::parseMachineBasicBlockDefinitions(MachineFunction &MF, StringRef Src,
|
||||||
MachineFunction &MF, StringRef Src,
|
PerFunctionMIParsingState &PFS,
|
||||||
const PerFunctionMIParsingState &PFS,
|
const SlotMapping &IRSlots,
|
||||||
const SlotMapping &IRSlots, SMDiagnostic &Error) {
|
SMDiagnostic &Error) {
|
||||||
return MIParser(SM, MF, Error, Src, PFS, IRSlots).parse(MI);
|
SourceMgr SM;
|
||||||
|
SM.AddNewSourceBuffer(
|
||||||
|
MemoryBuffer::getMemBuffer(Src, "", /*RequiresNullTerminator=*/false),
|
||||||
|
SMLoc());
|
||||||
|
return MIParser(SM, MF, Error, Src, PFS, IRSlots)
|
||||||
|
.parseBasicBlockDefinitions(PFS.MBBSlots);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool llvm::parseMachineInstructions(MachineFunction &MF, StringRef Src,
|
||||||
|
const PerFunctionMIParsingState &PFS,
|
||||||
|
const SlotMapping &IRSlots,
|
||||||
|
SMDiagnostic &Error) {
|
||||||
|
SourceMgr SM;
|
||||||
|
SM.AddNewSourceBuffer(
|
||||||
|
MemoryBuffer::getMemBuffer(Src, "", /*RequiresNullTerminator=*/false),
|
||||||
|
SMLoc());
|
||||||
|
return MIParser(SM, MF, Error, Src, PFS, IRSlots).parseBasicBlocks();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool llvm::parseMBBReference(MachineBasicBlock *&MBB, SourceMgr &SM,
|
bool llvm::parseMBBReference(MachineBasicBlock *&MBB, SourceMgr &SM,
|
||||||
|
@ -1437,12 +1685,3 @@ bool llvm::parseVirtualRegisterReference(unsigned &Reg, SourceMgr &SM,
|
||||||
return MIParser(SM, MF, Error, Src, PFS, IRSlots)
|
return MIParser(SM, MF, Error, Src, PFS, IRSlots)
|
||||||
.parseStandaloneVirtualRegister(Reg);
|
.parseStandaloneVirtualRegister(Reg);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool llvm::parseIRBlockReference(const BasicBlock *&BB, SourceMgr &SM,
|
|
||||||
MachineFunction &MF, StringRef Src,
|
|
||||||
const PerFunctionMIParsingState &PFS,
|
|
||||||
const SlotMapping &IRSlots,
|
|
||||||
SMDiagnostic &Error) {
|
|
||||||
return MIParser(SM, MF, Error, Src, PFS, IRSlots)
|
|
||||||
.parseStandaloneIRBlockReference(BB);
|
|
||||||
}
|
|
||||||
|
|
|
@ -36,9 +36,36 @@ struct PerFunctionMIParsingState {
|
||||||
DenseMap<unsigned, unsigned> JumpTableSlots;
|
DenseMap<unsigned, unsigned> JumpTableSlots;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool parseMachineInstr(MachineInstr *&MI, SourceMgr &SM, MachineFunction &MF,
|
/// Parse the machine basic block definitions, and skip the machine
|
||||||
StringRef Src, const PerFunctionMIParsingState &PFS,
|
/// instructions.
|
||||||
const SlotMapping &IRSlots, SMDiagnostic &Error);
|
///
|
||||||
|
/// This function runs the first parsing pass on the machine function's body.
|
||||||
|
/// It parses only the machine basic block definitions and creates the machine
|
||||||
|
/// basic blocks in the given machine function.
|
||||||
|
///
|
||||||
|
/// The machine instructions aren't parsed during the first pass because all
|
||||||
|
/// the machine basic blocks aren't defined yet - this makes it impossible to
|
||||||
|
/// resolve the machine basic block references.
|
||||||
|
///
|
||||||
|
/// Return true if an error occurred.
|
||||||
|
bool parseMachineBasicBlockDefinitions(MachineFunction &MF, StringRef Src,
|
||||||
|
PerFunctionMIParsingState &PFS,
|
||||||
|
const SlotMapping &IRSlots,
|
||||||
|
SMDiagnostic &Error);
|
||||||
|
|
||||||
|
/// Parse the machine instructions.
|
||||||
|
///
|
||||||
|
/// This function runs the second parsing pass on the machine function's body.
|
||||||
|
/// It skips the machine basic block definitions and parses only the machine
|
||||||
|
/// instructions and basic block attributes like liveins and successors.
|
||||||
|
///
|
||||||
|
/// The second parsing pass assumes that the first parsing pass already ran
|
||||||
|
/// on the given source string.
|
||||||
|
///
|
||||||
|
/// Return true if an error occurred.
|
||||||
|
bool parseMachineInstructions(MachineFunction &MF, StringRef Src,
|
||||||
|
const PerFunctionMIParsingState &PFS,
|
||||||
|
const SlotMapping &IRSlots, SMDiagnostic &Error);
|
||||||
|
|
||||||
bool parseMBBReference(MachineBasicBlock *&MBB, SourceMgr &SM,
|
bool parseMBBReference(MachineBasicBlock *&MBB, SourceMgr &SM,
|
||||||
MachineFunction &MF, StringRef Src,
|
MachineFunction &MF, StringRef Src,
|
||||||
|
@ -57,11 +84,6 @@ bool parseVirtualRegisterReference(unsigned &Reg, SourceMgr &SM,
|
||||||
const SlotMapping &IRSlots,
|
const SlotMapping &IRSlots,
|
||||||
SMDiagnostic &Error);
|
SMDiagnostic &Error);
|
||||||
|
|
||||||
bool parseIRBlockReference(const BasicBlock *&BB, SourceMgr &SM,
|
|
||||||
MachineFunction &MF, StringRef Src,
|
|
||||||
const PerFunctionMIParsingState &PFS,
|
|
||||||
const SlotMapping &IRSlots, SMDiagnostic &Error);
|
|
||||||
|
|
||||||
} // end namespace llvm
|
} // end namespace llvm
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -96,13 +96,6 @@ public:
|
||||||
/// Return true if error occurred.
|
/// Return true if error occurred.
|
||||||
bool initializeMachineFunction(MachineFunction &MF);
|
bool initializeMachineFunction(MachineFunction &MF);
|
||||||
|
|
||||||
/// Initialize the machine basic block using it's YAML representation.
|
|
||||||
///
|
|
||||||
/// Return true if an error occurred.
|
|
||||||
bool initializeMachineBasicBlock(MachineFunction &MF, MachineBasicBlock &MBB,
|
|
||||||
const yaml::MachineBasicBlock &YamlMBB,
|
|
||||||
const PerFunctionMIParsingState &PFS);
|
|
||||||
|
|
||||||
bool initializeRegisterInfo(MachineFunction &MF,
|
bool initializeRegisterInfo(MachineFunction &MF,
|
||||||
const yaml::MachineFunction &YamlMF,
|
const yaml::MachineFunction &YamlMF,
|
||||||
PerFunctionMIParsingState &PFS);
|
PerFunctionMIParsingState &PFS);
|
||||||
|
@ -294,36 +287,15 @@ bool MIRParserImpl::initializeMachineFunction(MachineFunction &MF) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto &F = *MF.getFunction();
|
SMDiagnostic Error;
|
||||||
for (const auto &YamlMBB : YamlMF.BasicBlocks) {
|
if (parseMachineBasicBlockDefinitions(MF, YamlMF.Body.Value.Value, PFS,
|
||||||
const BasicBlock *BB = nullptr;
|
IRSlots, Error)) {
|
||||||
const yaml::StringValue &Name = YamlMBB.Name;
|
reportDiagnostic(
|
||||||
const yaml::StringValue &IRBlock = YamlMBB.IRBlock;
|
diagFromBlockStringDiag(Error, YamlMF.Body.Value.SourceRange));
|
||||||
if (!Name.Value.empty()) {
|
return true;
|
||||||
BB = dyn_cast_or_null<BasicBlock>(
|
|
||||||
F.getValueSymbolTable().lookup(Name.Value));
|
|
||||||
if (!BB)
|
|
||||||
return error(Name.SourceRange.Start,
|
|
||||||
Twine("basic block '") + Name.Value +
|
|
||||||
"' is not defined in the function '" + MF.getName() +
|
|
||||||
"'");
|
|
||||||
}
|
|
||||||
if (!IRBlock.Value.empty()) {
|
|
||||||
// TODO: Report an error when both name and ir block are specified.
|
|
||||||
SMDiagnostic Error;
|
|
||||||
if (parseIRBlockReference(BB, SM, MF, IRBlock.Value, PFS, IRSlots, Error))
|
|
||||||
return error(Error, IRBlock.SourceRange);
|
|
||||||
}
|
|
||||||
auto *MBB = MF.CreateMachineBasicBlock(BB);
|
|
||||||
MF.insert(MF.end(), MBB);
|
|
||||||
bool WasInserted =
|
|
||||||
PFS.MBBSlots.insert(std::make_pair(YamlMBB.ID, MBB)).second;
|
|
||||||
if (!WasInserted)
|
|
||||||
return error(Twine("redefinition of machine basic block with id #") +
|
|
||||||
Twine(YamlMBB.ID));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (YamlMF.BasicBlocks.empty())
|
if (MF.empty())
|
||||||
return error(Twine("machine function '") + Twine(MF.getName()) +
|
return error(Twine("machine function '") + Twine(MF.getName()) +
|
||||||
"' requires at least one machine basic block in its body");
|
"' requires at least one machine basic block in its body");
|
||||||
// Initialize the frame information after creating all the MBBs so that the
|
// Initialize the frame information after creating all the MBBs so that the
|
||||||
|
@ -335,13 +307,13 @@ bool MIRParserImpl::initializeMachineFunction(MachineFunction &MF) {
|
||||||
if (!YamlMF.JumpTableInfo.Entries.empty() &&
|
if (!YamlMF.JumpTableInfo.Entries.empty() &&
|
||||||
initializeJumpTableInfo(MF, YamlMF.JumpTableInfo, PFS))
|
initializeJumpTableInfo(MF, YamlMF.JumpTableInfo, PFS))
|
||||||
return true;
|
return true;
|
||||||
// Initialize the machine basic blocks after creating them all so that the
|
// Parse the machine instructions after creating all of the MBBs so that the
|
||||||
// machine instructions parser can resolve the MBB references.
|
// parser can resolve the MBB references.
|
||||||
unsigned I = 0;
|
if (parseMachineInstructions(MF, YamlMF.Body.Value.Value, PFS, IRSlots,
|
||||||
for (const auto &YamlMBB : YamlMF.BasicBlocks) {
|
Error)) {
|
||||||
if (initializeMachineBasicBlock(MF, *MF.getBlockNumbered(I++), YamlMBB,
|
reportDiagnostic(
|
||||||
PFS))
|
diagFromBlockStringDiag(Error, YamlMF.Body.Value.SourceRange));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
inferRegisterInfo(MF, YamlMF);
|
inferRegisterInfo(MF, YamlMF);
|
||||||
// FIXME: This is a temporary workaround until the reserved registers can be
|
// FIXME: This is a temporary workaround until the reserved registers can be
|
||||||
|
@ -351,53 +323,6 @@ bool MIRParserImpl::initializeMachineFunction(MachineFunction &MF) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MIRParserImpl::initializeMachineBasicBlock(
|
|
||||||
MachineFunction &MF, MachineBasicBlock &MBB,
|
|
||||||
const yaml::MachineBasicBlock &YamlMBB,
|
|
||||||
const PerFunctionMIParsingState &PFS) {
|
|
||||||
MBB.setAlignment(YamlMBB.Alignment);
|
|
||||||
if (YamlMBB.AddressTaken)
|
|
||||||
MBB.setHasAddressTaken();
|
|
||||||
MBB.setIsLandingPad(YamlMBB.IsLandingPad);
|
|
||||||
SMDiagnostic Error;
|
|
||||||
// Parse the successors.
|
|
||||||
const auto &Weights = YamlMBB.SuccessorWeights;
|
|
||||||
bool HasWeights = !Weights.empty();
|
|
||||||
if (HasWeights && Weights.size() != YamlMBB.Successors.size()) {
|
|
||||||
bool IsFew = Weights.size() < YamlMBB.Successors.size();
|
|
||||||
return error(IsFew ? Weights.back().SourceRange.End
|
|
||||||
: Weights[YamlMBB.Successors.size()].SourceRange.Start,
|
|
||||||
Twine("too ") + (IsFew ? "few" : "many") +
|
|
||||||
" successor weights, expected " +
|
|
||||||
Twine(YamlMBB.Successors.size()) + ", have " +
|
|
||||||
Twine(Weights.size()));
|
|
||||||
}
|
|
||||||
size_t SuccessorIndex = 0;
|
|
||||||
for (const auto &MBBSource : YamlMBB.Successors) {
|
|
||||||
MachineBasicBlock *SuccMBB = nullptr;
|
|
||||||
if (parseMBBReference(SuccMBB, MBBSource, MF, PFS))
|
|
||||||
return true;
|
|
||||||
// TODO: Report an error when adding the same successor more than once.
|
|
||||||
MBB.addSuccessor(SuccMBB, HasWeights ? Weights[SuccessorIndex++].Value : 0);
|
|
||||||
}
|
|
||||||
// Parse the liveins.
|
|
||||||
for (const auto &LiveInSource : YamlMBB.LiveIns) {
|
|
||||||
unsigned Reg = 0;
|
|
||||||
if (parseNamedRegisterReference(Reg, SM, MF, LiveInSource.Value, PFS,
|
|
||||||
IRSlots, Error))
|
|
||||||
return error(Error, LiveInSource.SourceRange);
|
|
||||||
MBB.addLiveIn(Reg);
|
|
||||||
}
|
|
||||||
// Parse the instructions.
|
|
||||||
for (const auto &MISource : YamlMBB.Instructions) {
|
|
||||||
MachineInstr *MI = nullptr;
|
|
||||||
if (parseMachineInstr(MI, SM, MF, MISource.Value, PFS, IRSlots, Error))
|
|
||||||
return error(Error, MISource.SourceRange);
|
|
||||||
MBB.insert(MBB.end(), MI);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool MIRParserImpl::initializeRegisterInfo(MachineFunction &MF,
|
bool MIRParserImpl::initializeRegisterInfo(MachineFunction &MF,
|
||||||
const yaml::MachineFunction &YamlMF,
|
const yaml::MachineFunction &YamlMF,
|
||||||
PerFunctionMIParsingState &PFS) {
|
PerFunctionMIParsingState &PFS) {
|
||||||
|
|
|
@ -83,8 +83,6 @@ public:
|
||||||
const MachineConstantPool &ConstantPool);
|
const MachineConstantPool &ConstantPool);
|
||||||
void convert(ModuleSlotTracker &MST, yaml::MachineJumpTable &YamlJTI,
|
void convert(ModuleSlotTracker &MST, yaml::MachineJumpTable &YamlJTI,
|
||||||
const MachineJumpTableInfo &JTI);
|
const MachineJumpTableInfo &JTI);
|
||||||
void convert(ModuleSlotTracker &MST, yaml::MachineBasicBlock &YamlMBB,
|
|
||||||
const MachineBasicBlock &MBB);
|
|
||||||
void convertStackObjects(yaml::MachineFunction &MF,
|
void convertStackObjects(yaml::MachineFunction &MF,
|
||||||
const MachineFrameInfo &MFI,
|
const MachineFrameInfo &MFI,
|
||||||
const TargetRegisterInfo *TRI);
|
const TargetRegisterInfo *TRI);
|
||||||
|
@ -93,10 +91,6 @@ private:
|
||||||
void initRegisterMaskIds(const MachineFunction &MF);
|
void initRegisterMaskIds(const MachineFunction &MF);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end namespace llvm
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
/// This class prints out the machine instructions using the MIR serialization
|
/// This class prints out the machine instructions using the MIR serialization
|
||||||
/// format.
|
/// format.
|
||||||
class MIPrinter {
|
class MIPrinter {
|
||||||
|
@ -112,6 +106,8 @@ public:
|
||||||
: OS(OS), MST(MST), RegisterMaskIds(RegisterMaskIds),
|
: OS(OS), MST(MST), RegisterMaskIds(RegisterMaskIds),
|
||||||
StackObjectOperandMapping(StackObjectOperandMapping) {}
|
StackObjectOperandMapping(StackObjectOperandMapping) {}
|
||||||
|
|
||||||
|
void print(const MachineBasicBlock &MBB);
|
||||||
|
|
||||||
void print(const MachineInstr &MI);
|
void print(const MachineInstr &MI);
|
||||||
void printMBBReference(const MachineBasicBlock &MBB);
|
void printMBBReference(const MachineBasicBlock &MBB);
|
||||||
void printIRBlockReference(const BasicBlock &BB);
|
void printIRBlockReference(const BasicBlock &BB);
|
||||||
|
@ -125,7 +121,7 @@ public:
|
||||||
void print(const MCCFIInstruction &CFI, const TargetRegisterInfo *TRI);
|
void print(const MCCFIInstruction &CFI, const TargetRegisterInfo *TRI);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end anonymous namespace
|
} // end namespace llvm
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
namespace yaml {
|
namespace yaml {
|
||||||
|
@ -181,11 +177,16 @@ void MIRPrinter::print(const MachineFunction &MF) {
|
||||||
convert(YamlMF, *ConstantPool);
|
convert(YamlMF, *ConstantPool);
|
||||||
if (const auto *JumpTableInfo = MF.getJumpTableInfo())
|
if (const auto *JumpTableInfo = MF.getJumpTableInfo())
|
||||||
convert(MST, YamlMF.JumpTableInfo, *JumpTableInfo);
|
convert(MST, YamlMF.JumpTableInfo, *JumpTableInfo);
|
||||||
|
raw_string_ostream StrOS(YamlMF.Body.Value.Value);
|
||||||
|
bool IsNewlineNeeded = false;
|
||||||
for (const auto &MBB : MF) {
|
for (const auto &MBB : MF) {
|
||||||
yaml::MachineBasicBlock YamlMBB;
|
if (IsNewlineNeeded)
|
||||||
convert(MST, YamlMBB, MBB);
|
StrOS << "\n";
|
||||||
YamlMF.BasicBlocks.push_back(YamlMBB);
|
MIPrinter(StrOS, MST, RegisterMaskIds, StackObjectOperandMapping)
|
||||||
|
.print(MBB);
|
||||||
|
IsNewlineNeeded = true;
|
||||||
}
|
}
|
||||||
|
StrOS.flush();
|
||||||
yaml::Output Out(OS);
|
yaml::Output Out(OS);
|
||||||
Out << YamlMF;
|
Out << YamlMF;
|
||||||
}
|
}
|
||||||
|
@ -364,57 +365,6 @@ void MIRPrinter::convert(ModuleSlotTracker &MST,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MIRPrinter::convert(ModuleSlotTracker &MST,
|
|
||||||
yaml::MachineBasicBlock &YamlMBB,
|
|
||||||
const MachineBasicBlock &MBB) {
|
|
||||||
assert(MBB.getNumber() >= 0 && "Invalid MBB number");
|
|
||||||
YamlMBB.ID = (unsigned)MBB.getNumber();
|
|
||||||
if (const auto *BB = MBB.getBasicBlock()) {
|
|
||||||
if (BB->hasName()) {
|
|
||||||
YamlMBB.Name.Value = BB->getName();
|
|
||||||
} else {
|
|
||||||
int Slot = MST.getLocalSlot(BB);
|
|
||||||
if (Slot == -1)
|
|
||||||
YamlMBB.IRBlock.Value = "<badref>";
|
|
||||||
else
|
|
||||||
YamlMBB.IRBlock.Value = (Twine("%ir-block.") + Twine(Slot)).str();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
YamlMBB.Alignment = MBB.getAlignment();
|
|
||||||
YamlMBB.AddressTaken = MBB.hasAddressTaken();
|
|
||||||
YamlMBB.IsLandingPad = MBB.isLandingPad();
|
|
||||||
for (const auto *SuccMBB : MBB.successors()) {
|
|
||||||
std::string Str;
|
|
||||||
raw_string_ostream StrOS(Str);
|
|
||||||
MIPrinter(StrOS, MST, RegisterMaskIds, StackObjectOperandMapping)
|
|
||||||
.printMBBReference(*SuccMBB);
|
|
||||||
YamlMBB.Successors.push_back(StrOS.str());
|
|
||||||
}
|
|
||||||
if (MBB.hasSuccessorWeights()) {
|
|
||||||
for (auto I = MBB.succ_begin(), E = MBB.succ_end(); I != E; ++I)
|
|
||||||
YamlMBB.SuccessorWeights.push_back(
|
|
||||||
yaml::UnsignedValue(MBB.getSuccWeight(I)));
|
|
||||||
}
|
|
||||||
// Print the live in registers.
|
|
||||||
const auto *TRI = MBB.getParent()->getSubtarget().getRegisterInfo();
|
|
||||||
assert(TRI && "Expected target register info");
|
|
||||||
for (auto I = MBB.livein_begin(), E = MBB.livein_end(); I != E; ++I) {
|
|
||||||
std::string Str;
|
|
||||||
raw_string_ostream StrOS(Str);
|
|
||||||
printReg(*I, StrOS, TRI);
|
|
||||||
YamlMBB.LiveIns.push_back(StrOS.str());
|
|
||||||
}
|
|
||||||
// Print the machine instructions.
|
|
||||||
YamlMBB.Instructions.reserve(MBB.size());
|
|
||||||
std::string Str;
|
|
||||||
for (const auto &MI : MBB) {
|
|
||||||
raw_string_ostream StrOS(Str);
|
|
||||||
MIPrinter(StrOS, MST, RegisterMaskIds, StackObjectOperandMapping).print(MI);
|
|
||||||
YamlMBB.Instructions.push_back(StrOS.str());
|
|
||||||
Str.clear();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void MIRPrinter::initRegisterMaskIds(const MachineFunction &MF) {
|
void MIRPrinter::initRegisterMaskIds(const MachineFunction &MF) {
|
||||||
const auto *TRI = MF.getSubtarget().getRegisterInfo();
|
const auto *TRI = MF.getSubtarget().getRegisterInfo();
|
||||||
unsigned I = 0;
|
unsigned I = 0;
|
||||||
|
@ -422,6 +372,80 @@ void MIRPrinter::initRegisterMaskIds(const MachineFunction &MF) {
|
||||||
RegisterMaskIds.insert(std::make_pair(Mask, I++));
|
RegisterMaskIds.insert(std::make_pair(Mask, I++));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MIPrinter::print(const MachineBasicBlock &MBB) {
|
||||||
|
assert(MBB.getNumber() >= 0 && "Invalid MBB number");
|
||||||
|
OS << "bb." << MBB.getNumber();
|
||||||
|
bool HasAttributes = false;
|
||||||
|
if (const auto *BB = MBB.getBasicBlock()) {
|
||||||
|
if (BB->hasName()) {
|
||||||
|
OS << "." << BB->getName();
|
||||||
|
} else {
|
||||||
|
HasAttributes = true;
|
||||||
|
OS << " (";
|
||||||
|
int Slot = MST.getLocalSlot(BB);
|
||||||
|
if (Slot == -1)
|
||||||
|
OS << "<ir-block badref>";
|
||||||
|
else
|
||||||
|
OS << (Twine("%ir-block.") + Twine(Slot)).str();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (MBB.hasAddressTaken()) {
|
||||||
|
OS << (HasAttributes ? ", " : " (");
|
||||||
|
OS << "address-taken";
|
||||||
|
HasAttributes = true;
|
||||||
|
}
|
||||||
|
if (MBB.isLandingPad()) {
|
||||||
|
OS << (HasAttributes ? ", " : " (");
|
||||||
|
OS << "landing-pad";
|
||||||
|
HasAttributes = true;
|
||||||
|
}
|
||||||
|
if (MBB.getAlignment()) {
|
||||||
|
OS << (HasAttributes ? ", " : " (");
|
||||||
|
OS << "align " << MBB.getAlignment();
|
||||||
|
HasAttributes = true;
|
||||||
|
}
|
||||||
|
if (HasAttributes)
|
||||||
|
OS << ")";
|
||||||
|
OS << ":\n";
|
||||||
|
|
||||||
|
bool HasLineAttributes = false;
|
||||||
|
// Print the successors
|
||||||
|
if (!MBB.succ_empty()) {
|
||||||
|
OS.indent(2) << "successors: ";
|
||||||
|
for (auto I = MBB.succ_begin(), E = MBB.succ_end(); I != E; ++I) {
|
||||||
|
if (I != MBB.succ_begin())
|
||||||
|
OS << ", ";
|
||||||
|
printMBBReference(**I);
|
||||||
|
if (MBB.hasSuccessorWeights())
|
||||||
|
OS << '(' << MBB.getSuccWeight(I) << ')';
|
||||||
|
}
|
||||||
|
OS << "\n";
|
||||||
|
HasLineAttributes = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Print the live in registers.
|
||||||
|
const auto *TRI = MBB.getParent()->getSubtarget().getRegisterInfo();
|
||||||
|
assert(TRI && "Expected target register info");
|
||||||
|
if (!MBB.livein_empty()) {
|
||||||
|
OS.indent(2) << "liveins: ";
|
||||||
|
for (auto I = MBB.livein_begin(), E = MBB.livein_end(); I != E; ++I) {
|
||||||
|
if (I != MBB.livein_begin())
|
||||||
|
OS << ", ";
|
||||||
|
printReg(*I, OS, TRI);
|
||||||
|
}
|
||||||
|
OS << "\n";
|
||||||
|
HasLineAttributes = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (HasLineAttributes)
|
||||||
|
OS << "\n";
|
||||||
|
for (const auto &MI : MBB) {
|
||||||
|
OS.indent(2);
|
||||||
|
print(MI);
|
||||||
|
OS << "\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void MIPrinter::print(const MachineInstr &MI) {
|
void MIPrinter::print(const MachineInstr &MI) {
|
||||||
const auto &SubTarget = MI.getParent()->getParent()->getSubtarget();
|
const auto &SubTarget = MI.getParent()->getParent()->getSubtarget();
|
||||||
const auto *TRI = SubTarget.getRegisterInfo();
|
const auto *TRI = SubTarget.getRegisterInfo();
|
||||||
|
|
|
@ -15,18 +15,17 @@
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: trivial_fp_func
|
name: trivial_fp_func
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
liveins: %lr, %fp, %lr, %fp
|
||||||
liveins: [ '%lr', '%fp', '%lr', '%fp' ]
|
|
||||||
instructions:
|
%sp = frame-setup STPXpre killed %fp, killed %lr, %sp, -2
|
||||||
- '%sp = frame-setup STPXpre killed %fp, killed %lr, %sp, -2'
|
%fp = frame-setup ADDXri %sp, 0, 0
|
||||||
- '%fp = frame-setup ADDXri %sp, 0, 0'
|
; CHECK: CFI_INSTRUCTION .cfi_def_cfa %w29, 16
|
||||||
# CHECK: CFI_INSTRUCTION .cfi_def_cfa %w29, 16
|
frame-setup CFI_INSTRUCTION .cfi_def_cfa %w29, 16
|
||||||
- 'frame-setup CFI_INSTRUCTION .cfi_def_cfa %w29, 16'
|
frame-setup CFI_INSTRUCTION .cfi_offset %w30, -8
|
||||||
- 'frame-setup CFI_INSTRUCTION .cfi_offset %w30, -8'
|
frame-setup CFI_INSTRUCTION .cfi_offset %w29, -16
|
||||||
- 'frame-setup CFI_INSTRUCTION .cfi_offset %w29, -16'
|
BL @foo, csr_aarch64_aapcs, implicit-def dead %lr, implicit %sp, implicit-def %sp
|
||||||
- 'BL @foo, csr_aarch64_aapcs, implicit-def dead %lr, implicit %sp, implicit-def %sp'
|
%sp, %fp, %lr = LDPXpost %sp, 2
|
||||||
- '%sp, %fp, %lr = LDPXpost %sp, 2'
|
RET_ReallyLR
|
||||||
- RET_ReallyLR
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -15,15 +15,14 @@
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: trivial_fp_func
|
name: trivial_fp_func
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
liveins: %lr, %fp, %lr, %fp
|
||||||
liveins: [ '%lr', '%fp', '%lr', '%fp' ]
|
|
||||||
instructions:
|
%sp = frame-setup STPXpre killed %fp, killed %lr, %sp, -2
|
||||||
- '%sp = frame-setup STPXpre killed %fp, killed %lr, %sp, -2'
|
%fp = frame-setup ADDXri %sp, 0, 0
|
||||||
- '%fp = frame-setup ADDXri %sp, 0, 0'
|
BL @foo, csr_aarch64_aapcs, implicit-def dead %lr, implicit %sp, implicit-def %sp
|
||||||
- 'BL @foo, csr_aarch64_aapcs, implicit-def dead %lr, implicit %sp, implicit-def %sp'
|
; CHECK: %sp, %fp, %lr = LDPXpost %sp, 2
|
||||||
# CHECK: %sp, %fp, %lr = LDPXpost %sp, 2
|
%sp, %fp, %lr = LDPXpost %sp, 2
|
||||||
- '%sp, %fp, %lr = LDPXpost %sp, 2'
|
RET_ReallyLR
|
||||||
- RET_ReallyLR
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -38,28 +38,27 @@ liveins:
|
||||||
- { reg: '%sgpr0_sgpr1' }
|
- { reg: '%sgpr0_sgpr1' }
|
||||||
frameInfo:
|
frameInfo:
|
||||||
maxAlignment: 8
|
maxAlignment: 8
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
liveins: %sgpr0_sgpr1
|
||||||
liveins: [ '%sgpr0_sgpr1' ]
|
|
||||||
instructions:
|
%sgpr2_sgpr3 = S_GETPC_B64
|
||||||
- '%sgpr2_sgpr3 = S_GETPC_B64'
|
; CHECK: [[@LINE+1]]:45: expected the name of the target index
|
||||||
# CHECK: [[@LINE+1]]:50: expected the name of the target index
|
%sgpr2 = S_ADD_U32 %sgpr2, target-index(0), implicit-def %scc, implicit-def %scc
|
||||||
- '%sgpr2 = S_ADD_U32 %sgpr2, target-index(0), implicit-def %scc, implicit-def %scc'
|
%sgpr3 = S_ADDC_U32 %sgpr3, 0, implicit-def %scc, implicit %scc, implicit-def %scc, implicit %scc
|
||||||
- '%sgpr3 = S_ADDC_U32 %sgpr3, 0, implicit-def %scc, implicit %scc, implicit-def %scc, implicit %scc'
|
%sgpr4_sgpr5 = S_LSHR_B64 %sgpr2_sgpr3, 32, implicit-def dead %scc
|
||||||
- '%sgpr4_sgpr5 = S_LSHR_B64 %sgpr2_sgpr3, 32, implicit-def dead %scc'
|
%sgpr6 = S_LOAD_DWORD_IMM %sgpr0_sgpr1, 11
|
||||||
- '%sgpr6 = S_LOAD_DWORD_IMM %sgpr0_sgpr1, 11'
|
%sgpr7 = S_ASHR_I32 %sgpr6, 31, implicit-def dead %scc
|
||||||
- '%sgpr7 = S_ASHR_I32 %sgpr6, 31, implicit-def dead %scc'
|
%sgpr6_sgpr7 = S_LSHL_B64 %sgpr6_sgpr7, 2, implicit-def dead %scc
|
||||||
- '%sgpr6_sgpr7 = S_LSHL_B64 %sgpr6_sgpr7, 2, implicit-def dead %scc'
|
%sgpr2 = S_ADD_U32 %sgpr2, @float_gv, implicit-def %scc
|
||||||
- '%sgpr2 = S_ADD_U32 %sgpr2, @float_gv, implicit-def %scc'
|
%sgpr3 = S_ADDC_U32 %sgpr4, 0, implicit-def dead %scc, implicit %scc
|
||||||
- '%sgpr3 = S_ADDC_U32 %sgpr4, 0, implicit-def dead %scc, implicit %scc'
|
%sgpr4 = S_ADD_U32 %sgpr2, %sgpr6, implicit-def %scc
|
||||||
- '%sgpr4 = S_ADD_U32 %sgpr2, %sgpr6, implicit-def %scc'
|
%sgpr5 = S_ADDC_U32 %sgpr3, %sgpr7, implicit-def dead %scc, implicit %scc
|
||||||
- '%sgpr5 = S_ADDC_U32 %sgpr3, %sgpr7, implicit-def dead %scc, implicit %scc'
|
%sgpr2 = S_LOAD_DWORD_IMM %sgpr4_sgpr5, 0
|
||||||
- '%sgpr2 = S_LOAD_DWORD_IMM %sgpr4_sgpr5, 0'
|
%sgpr4_sgpr5 = S_LOAD_DWORDX2_IMM killed %sgpr0_sgpr1, 9
|
||||||
- '%sgpr4_sgpr5 = S_LOAD_DWORDX2_IMM killed %sgpr0_sgpr1, 9'
|
%sgpr7 = S_MOV_B32 61440
|
||||||
- '%sgpr7 = S_MOV_B32 61440'
|
%sgpr6 = S_MOV_B32 -1
|
||||||
- '%sgpr6 = S_MOV_B32 -1'
|
%vgpr0 = V_MOV_B32_e32 killed %sgpr2, implicit %exec
|
||||||
- '%vgpr0 = V_MOV_B32_e32 killed %sgpr2, implicit %exec'
|
BUFFER_STORE_DWORD_OFFSET killed %vgpr0, %sgpr4_sgpr5_sgpr6_sgpr7, 0, 0, 0, 0, 0, implicit %exec
|
||||||
- 'BUFFER_STORE_DWORD_OFFSET killed %vgpr0, %sgpr4_sgpr5_sgpr6_sgpr7, 0, 0, 0, 0, 0, implicit %exec'
|
S_ENDPGM
|
||||||
- S_ENDPGM
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -38,28 +38,27 @@ liveins:
|
||||||
- { reg: '%sgpr0_sgpr1' }
|
- { reg: '%sgpr0_sgpr1' }
|
||||||
frameInfo:
|
frameInfo:
|
||||||
maxAlignment: 8
|
maxAlignment: 8
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
liveins: %sgpr0_sgpr1
|
||||||
liveins: [ '%sgpr0_sgpr1' ]
|
|
||||||
instructions:
|
%sgpr2_sgpr3 = S_GETPC_B64
|
||||||
- '%sgpr2_sgpr3 = S_GETPC_B64'
|
; CHECK: [[@LINE+1]]:45: use of undefined target index 'constdata-start'
|
||||||
# CHECK: [[@LINE+1]]:50: use of undefined target index 'constdata-start'
|
%sgpr2 = S_ADD_U32 %sgpr2, target-index(constdata-start), implicit-def %scc, implicit-def %scc
|
||||||
- '%sgpr2 = S_ADD_U32 %sgpr2, target-index(constdata-start), implicit-def %scc, implicit-def %scc'
|
%sgpr3 = S_ADDC_U32 %sgpr3, 0, implicit-def %scc, implicit %scc, implicit-def %scc, implicit %scc
|
||||||
- '%sgpr3 = S_ADDC_U32 %sgpr3, 0, implicit-def %scc, implicit %scc, implicit-def %scc, implicit %scc'
|
%sgpr4_sgpr5 = S_LSHR_B64 %sgpr2_sgpr3, 32, implicit-def dead %scc
|
||||||
- '%sgpr4_sgpr5 = S_LSHR_B64 %sgpr2_sgpr3, 32, implicit-def dead %scc'
|
%sgpr6 = S_LOAD_DWORD_IMM %sgpr0_sgpr1, 11
|
||||||
- '%sgpr6 = S_LOAD_DWORD_IMM %sgpr0_sgpr1, 11'
|
%sgpr7 = S_ASHR_I32 %sgpr6, 31, implicit-def dead %scc
|
||||||
- '%sgpr7 = S_ASHR_I32 %sgpr6, 31, implicit-def dead %scc'
|
%sgpr6_sgpr7 = S_LSHL_B64 %sgpr6_sgpr7, 2, implicit-def dead %scc
|
||||||
- '%sgpr6_sgpr7 = S_LSHL_B64 %sgpr6_sgpr7, 2, implicit-def dead %scc'
|
%sgpr2 = S_ADD_U32 %sgpr2, @float_gv, implicit-def %scc
|
||||||
- '%sgpr2 = S_ADD_U32 %sgpr2, @float_gv, implicit-def %scc'
|
%sgpr3 = S_ADDC_U32 %sgpr4, 0, implicit-def dead %scc, implicit %scc
|
||||||
- '%sgpr3 = S_ADDC_U32 %sgpr4, 0, implicit-def dead %scc, implicit %scc'
|
%sgpr4 = S_ADD_U32 %sgpr2, %sgpr6, implicit-def %scc
|
||||||
- '%sgpr4 = S_ADD_U32 %sgpr2, %sgpr6, implicit-def %scc'
|
%sgpr5 = S_ADDC_U32 %sgpr3, %sgpr7, implicit-def dead %scc, implicit %scc
|
||||||
- '%sgpr5 = S_ADDC_U32 %sgpr3, %sgpr7, implicit-def dead %scc, implicit %scc'
|
%sgpr2 = S_LOAD_DWORD_IMM %sgpr4_sgpr5, 0
|
||||||
- '%sgpr2 = S_LOAD_DWORD_IMM %sgpr4_sgpr5, 0'
|
%sgpr4_sgpr5 = S_LOAD_DWORDX2_IMM killed %sgpr0_sgpr1, 9
|
||||||
- '%sgpr4_sgpr5 = S_LOAD_DWORDX2_IMM killed %sgpr0_sgpr1, 9'
|
%sgpr7 = S_MOV_B32 61440
|
||||||
- '%sgpr7 = S_MOV_B32 61440'
|
%sgpr6 = S_MOV_B32 -1
|
||||||
- '%sgpr6 = S_MOV_B32 -1'
|
%vgpr0 = V_MOV_B32_e32 killed %sgpr2, implicit %exec
|
||||||
- '%vgpr0 = V_MOV_B32_e32 killed %sgpr2, implicit %exec'
|
BUFFER_STORE_DWORD_OFFSET killed %vgpr0, %sgpr4_sgpr5_sgpr6_sgpr7, 0, 0, 0, 0, 0, implicit %exec
|
||||||
- 'BUFFER_STORE_DWORD_OFFSET killed %vgpr0, %sgpr4_sgpr5_sgpr6_sgpr7, 0, 0, 0, 0, 0, implicit %exec'
|
S_ENDPGM
|
||||||
- S_ENDPGM
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -47,30 +47,29 @@ liveins:
|
||||||
- { reg: '%sgpr0_sgpr1' }
|
- { reg: '%sgpr0_sgpr1' }
|
||||||
frameInfo:
|
frameInfo:
|
||||||
maxAlignment: 8
|
maxAlignment: 8
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
liveins: %sgpr0_sgpr1
|
||||||
liveins: [ '%sgpr0_sgpr1' ]
|
|
||||||
instructions:
|
%sgpr2_sgpr3 = S_GETPC_B64
|
||||||
- '%sgpr2_sgpr3 = S_GETPC_B64'
|
; CHECK: %sgpr2 = S_ADD_U32 %sgpr2, target-index(amdgpu-constdata-start), implicit-def %scc, implicit-def %scc
|
||||||
# CHECK: %sgpr2 = S_ADD_U32 %sgpr2, target-index(amdgpu-constdata-start), implicit-def %scc, implicit-def %scc
|
%sgpr2 = S_ADD_U32 %sgpr2, target-index(amdgpu-constdata-start), implicit-def %scc, implicit-def %scc
|
||||||
- '%sgpr2 = S_ADD_U32 %sgpr2, target-index(amdgpu-constdata-start), implicit-def %scc, implicit-def %scc'
|
%sgpr3 = S_ADDC_U32 %sgpr3, 0, implicit-def %scc, implicit %scc, implicit-def %scc, implicit %scc
|
||||||
- '%sgpr3 = S_ADDC_U32 %sgpr3, 0, implicit-def %scc, implicit %scc, implicit-def %scc, implicit %scc'
|
%sgpr4_sgpr5 = S_LSHR_B64 %sgpr2_sgpr3, 32, implicit-def dead %scc
|
||||||
- '%sgpr4_sgpr5 = S_LSHR_B64 %sgpr2_sgpr3, 32, implicit-def dead %scc'
|
%sgpr6 = S_LOAD_DWORD_IMM %sgpr0_sgpr1, 11
|
||||||
- '%sgpr6 = S_LOAD_DWORD_IMM %sgpr0_sgpr1, 11'
|
%sgpr7 = S_ASHR_I32 %sgpr6, 31, implicit-def dead %scc
|
||||||
- '%sgpr7 = S_ASHR_I32 %sgpr6, 31, implicit-def dead %scc'
|
%sgpr6_sgpr7 = S_LSHL_B64 %sgpr6_sgpr7, 2, implicit-def dead %scc
|
||||||
- '%sgpr6_sgpr7 = S_LSHL_B64 %sgpr6_sgpr7, 2, implicit-def dead %scc'
|
%sgpr2 = S_ADD_U32 %sgpr2, @float_gv, implicit-def %scc
|
||||||
- '%sgpr2 = S_ADD_U32 %sgpr2, @float_gv, implicit-def %scc'
|
%sgpr3 = S_ADDC_U32 %sgpr4, 0, implicit-def dead %scc, implicit %scc
|
||||||
- '%sgpr3 = S_ADDC_U32 %sgpr4, 0, implicit-def dead %scc, implicit %scc'
|
%sgpr4 = S_ADD_U32 %sgpr2, %sgpr6, implicit-def %scc
|
||||||
- '%sgpr4 = S_ADD_U32 %sgpr2, %sgpr6, implicit-def %scc'
|
%sgpr5 = S_ADDC_U32 %sgpr3, %sgpr7, implicit-def dead %scc, implicit %scc
|
||||||
- '%sgpr5 = S_ADDC_U32 %sgpr3, %sgpr7, implicit-def dead %scc, implicit %scc'
|
%sgpr2 = S_LOAD_DWORD_IMM %sgpr4_sgpr5, 0
|
||||||
- '%sgpr2 = S_LOAD_DWORD_IMM %sgpr4_sgpr5, 0'
|
%sgpr4_sgpr5 = S_LOAD_DWORDX2_IMM killed %sgpr0_sgpr1, 9
|
||||||
- '%sgpr4_sgpr5 = S_LOAD_DWORDX2_IMM killed %sgpr0_sgpr1, 9'
|
%sgpr7 = S_MOV_B32 61440
|
||||||
- '%sgpr7 = S_MOV_B32 61440'
|
%sgpr6 = S_MOV_B32 -1
|
||||||
- '%sgpr6 = S_MOV_B32 -1'
|
%vgpr0 = V_MOV_B32_e32 killed %sgpr2, implicit %exec
|
||||||
- '%vgpr0 = V_MOV_B32_e32 killed %sgpr2, implicit %exec'
|
BUFFER_STORE_DWORD_OFFSET killed %vgpr0, %sgpr4_sgpr5_sgpr6_sgpr7, 0, 0, 0, 0, 0, implicit %exec
|
||||||
- 'BUFFER_STORE_DWORD_OFFSET killed %vgpr0, %sgpr4_sgpr5_sgpr6_sgpr7, 0, 0, 0, 0, 0, implicit %exec'
|
S_ENDPGM
|
||||||
- S_ENDPGM
|
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: float2
|
name: float2
|
||||||
|
@ -79,28 +78,27 @@ liveins:
|
||||||
- { reg: '%sgpr0_sgpr1' }
|
- { reg: '%sgpr0_sgpr1' }
|
||||||
frameInfo:
|
frameInfo:
|
||||||
maxAlignment: 8
|
maxAlignment: 8
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
liveins: %sgpr0_sgpr1
|
||||||
liveins: [ '%sgpr0_sgpr1' ]
|
|
||||||
instructions:
|
%sgpr2_sgpr3 = S_GETPC_B64
|
||||||
- '%sgpr2_sgpr3 = S_GETPC_B64'
|
; CHECK: %sgpr2 = S_ADD_U32 %sgpr2, target-index(amdgpu-constdata-start) + 1, implicit-def %scc, implicit-def %scc
|
||||||
# CHECK: %sgpr2 = S_ADD_U32 %sgpr2, target-index(amdgpu-constdata-start) + 1, implicit-def %scc, implicit-def %scc
|
%sgpr2 = S_ADD_U32 %sgpr2, target-index(amdgpu-constdata-start) + 1, implicit-def %scc, implicit-def %scc
|
||||||
- '%sgpr2 = S_ADD_U32 %sgpr2, target-index(amdgpu-constdata-start) + 1, implicit-def %scc, implicit-def %scc'
|
%sgpr3 = S_ADDC_U32 %sgpr3, 0, implicit-def %scc, implicit %scc, implicit-def %scc, implicit %scc
|
||||||
- '%sgpr3 = S_ADDC_U32 %sgpr3, 0, implicit-def %scc, implicit %scc, implicit-def %scc, implicit %scc'
|
%sgpr4_sgpr5 = S_LSHR_B64 %sgpr2_sgpr3, 32, implicit-def dead %scc
|
||||||
- '%sgpr4_sgpr5 = S_LSHR_B64 %sgpr2_sgpr3, 32, implicit-def dead %scc'
|
%sgpr6 = S_LOAD_DWORD_IMM %sgpr0_sgpr1, 11
|
||||||
- '%sgpr6 = S_LOAD_DWORD_IMM %sgpr0_sgpr1, 11'
|
%sgpr7 = S_ASHR_I32 %sgpr6, 31, implicit-def dead %scc
|
||||||
- '%sgpr7 = S_ASHR_I32 %sgpr6, 31, implicit-def dead %scc'
|
%sgpr6_sgpr7 = S_LSHL_B64 %sgpr6_sgpr7, 2, implicit-def dead %scc
|
||||||
- '%sgpr6_sgpr7 = S_LSHL_B64 %sgpr6_sgpr7, 2, implicit-def dead %scc'
|
%sgpr2 = S_ADD_U32 %sgpr2, @float_gv, implicit-def %scc
|
||||||
- '%sgpr2 = S_ADD_U32 %sgpr2, @float_gv, implicit-def %scc'
|
%sgpr3 = S_ADDC_U32 %sgpr4, 0, implicit-def dead %scc, implicit %scc
|
||||||
- '%sgpr3 = S_ADDC_U32 %sgpr4, 0, implicit-def dead %scc, implicit %scc'
|
%sgpr4 = S_ADD_U32 %sgpr2, %sgpr6, implicit-def %scc
|
||||||
- '%sgpr4 = S_ADD_U32 %sgpr2, %sgpr6, implicit-def %scc'
|
%sgpr5 = S_ADDC_U32 %sgpr3, %sgpr7, implicit-def dead %scc, implicit %scc
|
||||||
- '%sgpr5 = S_ADDC_U32 %sgpr3, %sgpr7, implicit-def dead %scc, implicit %scc'
|
%sgpr2 = S_LOAD_DWORD_IMM %sgpr4_sgpr5, 0
|
||||||
- '%sgpr2 = S_LOAD_DWORD_IMM %sgpr4_sgpr5, 0'
|
%sgpr4_sgpr5 = S_LOAD_DWORDX2_IMM killed %sgpr0_sgpr1, 9
|
||||||
- '%sgpr4_sgpr5 = S_LOAD_DWORDX2_IMM killed %sgpr0_sgpr1, 9'
|
%sgpr7 = S_MOV_B32 61440
|
||||||
- '%sgpr7 = S_MOV_B32 61440'
|
%sgpr6 = S_MOV_B32 -1
|
||||||
- '%sgpr6 = S_MOV_B32 -1'
|
%vgpr0 = V_MOV_B32_e32 killed %sgpr2, implicit %exec
|
||||||
- '%vgpr0 = V_MOV_B32_e32 killed %sgpr2, implicit %exec'
|
BUFFER_STORE_DWORD_OFFSET killed %vgpr0, %sgpr4_sgpr5_sgpr6_sgpr7, 0, 0, 0, 0, 0, implicit %exec
|
||||||
- 'BUFFER_STORE_DWORD_OFFSET killed %vgpr0, %sgpr4_sgpr5_sgpr6_sgpr7, 0, 0, 0, 0, 0, implicit %exec'
|
S_ENDPGM
|
||||||
- S_ENDPGM
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -13,37 +13,37 @@
|
||||||
ret i32 0
|
ret i32 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
define i32 @test() {
|
||||||
|
start:
|
||||||
|
ret i32 0
|
||||||
|
}
|
||||||
|
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
# CHECK: name: foo
|
# CHECK-LABEL: name: foo
|
||||||
# CHECK: body:
|
# CHECK: body:
|
||||||
# CHECK-NEXT: - id: 0
|
# CHECK-NEXT: bb.0.entry:
|
||||||
# CHECK-NEXT: name: entry
|
|
||||||
# CHECK-NEXT: alignment: 0
|
|
||||||
# CHECK-NEXT: isLandingPad: false
|
|
||||||
# CHECK-NEXT: addressTaken: false
|
|
||||||
name: foo
|
name: foo
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
# CHECK: name: bar
|
# CHECK-LABEL: name: bar
|
||||||
# CHECK: body:
|
# CHECK: body:
|
||||||
# CHECK-NEXT: - id: 0
|
# CHECK-NEXT: bb.0.start (align 4):
|
||||||
# CHECK-NEXT: name: start
|
# CHECK: bb.1 (address-taken):
|
||||||
# CHECK-NEXT: alignment: 4
|
|
||||||
# CHECK-NEXT: isLandingPad: false
|
|
||||||
# CHECK-NEXT: addressTaken: false
|
|
||||||
# CHECK-NEXT: - id: 1
|
|
||||||
# CHECK-NEXT: alignment: 0
|
|
||||||
# CHECK-NEXT: isLandingPad: false
|
|
||||||
# CHECK-NEXT: addressTaken: true
|
|
||||||
name: bar
|
name: bar
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.start (align 4):
|
||||||
name: start
|
bb.1 (address-taken):
|
||||||
alignment: 4
|
...
|
||||||
- id: 1
|
---
|
||||||
addressTaken: true
|
# CHECK-LABEL: name: test
|
||||||
|
# CHECK: body:
|
||||||
|
# CHECK-NEXT: bb.0.start (address-taken, align 4):
|
||||||
|
# CHECK: bb.1 (address-taken, align 4):
|
||||||
|
name: test
|
||||||
|
body: |
|
||||||
|
bb.0.start (align 4, address-taken):
|
||||||
|
bb.1 (address-taken, align 4):
|
||||||
...
|
...
|
||||||
|
|
|
@ -3,14 +3,14 @@
|
||||||
--- |
|
--- |
|
||||||
|
|
||||||
define i32 @foo() {
|
define i32 @foo() {
|
||||||
|
entry:
|
||||||
ret i32 0
|
ret i32 0
|
||||||
}
|
}
|
||||||
|
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: foo
|
name: foo
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
; CHECK: [[@LINE+1]]:13: expected ':'
|
||||||
# CHECK: [[@LINE+1]]:19: expected an IR block reference
|
bb.0.entry
|
||||||
ir-block: '0'
|
|
||||||
...
|
...
|
|
@ -1,29 +0,0 @@
|
||||||
# RUN: not llc -start-after branch-folder -stop-after branch-folder -o /dev/null %s 2>&1 | FileCheck %s
|
|
||||||
|
|
||||||
--- |
|
|
||||||
|
|
||||||
define i32 @foo(i32 %a) {
|
|
||||||
entry:
|
|
||||||
%0 = icmp sle i32 %a, 10
|
|
||||||
br i1 %0, label %less, label %exit
|
|
||||||
|
|
||||||
less:
|
|
||||||
ret i32 0
|
|
||||||
|
|
||||||
exit:
|
|
||||||
ret i32 %a
|
|
||||||
}
|
|
||||||
|
|
||||||
...
|
|
||||||
---
|
|
||||||
name: foo
|
|
||||||
body:
|
|
||||||
- id: 0
|
|
||||||
name: entry
|
|
||||||
# CHECK: [[@LINE+1]]:46: expected end of string after the machine basic block reference
|
|
||||||
successors: [ '%bb.1.less', '%bb.2.exit 2' ]
|
|
||||||
- id: 1
|
|
||||||
name: less
|
|
||||||
- id: 2
|
|
||||||
name: exit
|
|
||||||
...
|
|
|
@ -17,13 +17,12 @@
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: foo
|
name: foo
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
; CHECK: [[@LINE+1]]:29: expected a machine basic block reference
|
||||||
# CHECK: [[@LINE+1]]:35: expected a machine basic block reference
|
successors: %bb.1.less, 2
|
||||||
successors: [ '%bb.1.less', '2' ]
|
|
||||||
- id: 1
|
bb.1.less:
|
||||||
name: less
|
|
||||||
- id: 2
|
bb.2.exit:
|
||||||
name: exit
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -44,9 +44,8 @@ tracksRegLiveness: true
|
||||||
# CHECK: body
|
# CHECK: body
|
||||||
frameInfo:
|
frameInfo:
|
||||||
maxAlignment: 4
|
maxAlignment: 4
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: test2
|
name: test2
|
||||||
|
@ -84,8 +83,7 @@ frameInfo:
|
||||||
hasOpaqueSPAdjustment: true
|
hasOpaqueSPAdjustment: true
|
||||||
hasVAStart: true
|
hasVAStart: true
|
||||||
hasMustTailInVarArgFunc: true
|
hasMustTailInVarArgFunc: true
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
|
@ -36,19 +36,18 @@ jumpTable:
|
||||||
entries:
|
entries:
|
||||||
- id: 0
|
- id: 0
|
||||||
blocks: [ '%bb.3.lbl1', '%bb.4.lbl2', '%bb.5.lbl3', '%bb.6.lbl4' ]
|
blocks: [ '%bb.3.lbl1', '%bb.4.lbl2', '%bb.5.lbl3', '%bb.6.lbl4' ]
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
|
||||||
- id: 1
|
bb.1.entry:
|
||||||
name: entry
|
|
||||||
- id: 2
|
bb.2.def:
|
||||||
name: def
|
|
||||||
- id: 3
|
bb.3.lbl1:
|
||||||
name: lbl1
|
|
||||||
- id: 4
|
bb.4.lbl2:
|
||||||
name: lbl2
|
|
||||||
- id: 5
|
bb.5.lbl3:
|
||||||
name: lbl3
|
|
||||||
- id: 6
|
bb.6.lbl4:
|
||||||
name: lbl4
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -32,6 +32,6 @@
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: foo
|
name: foo
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0:
|
||||||
...
|
...
|
||||||
|
|
|
@ -4,6 +4,6 @@
|
||||||
---
|
---
|
||||||
# CHECK: name: foo
|
# CHECK: name: foo
|
||||||
name: foo
|
name: foo
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0:
|
||||||
...
|
...
|
||||||
|
|
|
@ -11,9 +11,7 @@
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: foo
|
name: foo
|
||||||
body:
|
body: |
|
||||||
# CHECK: id: 0
|
; CHECK: bb.0 (%ir-block.0):
|
||||||
# CHECK: ir-block: '%ir-block.0'
|
bb.0 (%ir-block.0):
|
||||||
- id: 0
|
|
||||||
ir-block: '%ir-block.0'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -10,8 +10,9 @@
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: foo
|
name: foo
|
||||||
body:
|
body: |
|
||||||
# CHECK: redefinition of machine basic block with id #0
|
; CHECK: [[@LINE+3]]:3: redefinition of machine basic block with id #0
|
||||||
- id: 0
|
bb.0:
|
||||||
- id: 0
|
|
||||||
|
bb.0:
|
||||||
...
|
...
|
||||||
|
|
|
@ -9,8 +9,7 @@
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: foo
|
name: foo
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
; CHECK: [[@LINE+1]]:9: use of undefined IR block '%ir-block.10'
|
||||||
# CHECK: [[@LINE+1]]:19: use of undefined IR block '%ir-block.10'
|
bb.0 (%ir-block.10):
|
||||||
ir-block: '%ir-block.10'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -12,8 +12,7 @@
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: foo
|
name: foo
|
||||||
body:
|
body: |
|
||||||
# CHECK: [[@LINE+2]]:18: basic block 'entrie' is not defined in the function 'foo'
|
; CHECK: [[@LINE+1]]:3: basic block 'entrie' is not defined in the function 'foo'
|
||||||
- id: 0
|
bb.0.entrie:
|
||||||
name: entrie
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -12,12 +12,12 @@
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: foo
|
name: foo
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0:
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
# CHECK: function 'faa' isn't defined in the provided LLVM IR
|
# CHECK: function 'faa' isn't defined in the provided LLVM IR
|
||||||
name: faa
|
name: faa
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0:
|
||||||
...
|
...
|
||||||
|
|
|
@ -16,11 +16,11 @@
|
||||||
---
|
---
|
||||||
# CHECK: [[@LINE+1]]:1: missing required key 'name'
|
# CHECK: [[@LINE+1]]:1: missing required key 'name'
|
||||||
nme: foo
|
nme: foo
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0:
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: bar
|
name: bar
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0:
|
||||||
...
|
...
|
||||||
|
|
|
@ -27,8 +27,8 @@
|
||||||
# CHECK-NEXT: hasInlineAsm: false
|
# CHECK-NEXT: hasInlineAsm: false
|
||||||
# CHECK: ...
|
# CHECK: ...
|
||||||
name: foo
|
name: foo
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0:
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
# CHECK: name: bar
|
# CHECK: name: bar
|
||||||
|
@ -37,8 +37,8 @@ body:
|
||||||
# CHECK-NEXT: hasInlineAsm: false
|
# CHECK-NEXT: hasInlineAsm: false
|
||||||
# CHECK: ...
|
# CHECK: ...
|
||||||
name: bar
|
name: bar
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0:
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
# CHECK: name: func
|
# CHECK: name: func
|
||||||
|
@ -48,8 +48,8 @@ body:
|
||||||
# CHECK: ...
|
# CHECK: ...
|
||||||
name: func
|
name: func
|
||||||
alignment: 8
|
alignment: 8
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0:
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
# CHECK: name: func2
|
# CHECK: name: func2
|
||||||
|
@ -61,6 +61,6 @@ name: func2
|
||||||
alignment: 16
|
alignment: 16
|
||||||
exposesReturnsTwice: true
|
exposesReturnsTwice: true
|
||||||
hasInlineAsm: true
|
hasInlineAsm: true
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0:
|
||||||
...
|
...
|
||||||
|
|
|
@ -22,8 +22,8 @@
|
||||||
# CHECK-NEXT: tracksSubRegLiveness: false
|
# CHECK-NEXT: tracksSubRegLiveness: false
|
||||||
# CHECK: ...
|
# CHECK: ...
|
||||||
name: foo
|
name: foo
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0:
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
# CHECK: name: bar
|
# CHECK: name: bar
|
||||||
|
@ -35,6 +35,6 @@ name: bar
|
||||||
isSSA: false
|
isSSA: false
|
||||||
tracksRegLiveness: true
|
tracksRegLiveness: true
|
||||||
tracksSubRegLiveness: true
|
tracksSubRegLiveness: true
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0:
|
||||||
...
|
...
|
||||||
|
|
|
@ -14,13 +14,11 @@ name: test
|
||||||
registers:
|
registers:
|
||||||
- { id: 0, class: float32regs }
|
- { id: 0, class: float32regs }
|
||||||
- { id: 1, class: float32regs }
|
- { id: 1, class: float32regs }
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
%0 = LD_f32_avar 0, 4, 1, 2, 32, $test_param_0
|
||||||
instructions:
|
; CHECK: [[@LINE+1]]:33: expected a floating point literal
|
||||||
- '%0 = LD_f32_avar 0, 4, 1, 2, 32, $test_param_0'
|
%1 = FADD_rnf32ri %0, float 3
|
||||||
# CHECK: [[@LINE+1]]:38: expected a floating point literal
|
StoreRetvalF32 %1, 0
|
||||||
- '%1 = FADD_rnf32ri %0, float 3'
|
Return
|
||||||
- 'StoreRetvalF32 %1, 0'
|
|
||||||
- Return
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -38,22 +38,20 @@ registers:
|
||||||
- { id: 5, class: float32regs }
|
- { id: 5, class: float32regs }
|
||||||
- { id: 6, class: float32regs }
|
- { id: 6, class: float32regs }
|
||||||
- { id: 7, class: float32regs }
|
- { id: 7, class: float32regs }
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
%0 = LD_f32_avar 0, 4, 1, 2, 32, $test_param_0
|
||||||
instructions:
|
%1 = CVT_f64_f32 %0, 0
|
||||||
- '%0 = LD_f32_avar 0, 4, 1, 2, 32, $test_param_0'
|
%2 = LD_i32_avar 0, 4, 1, 0, 32, $test_param_1
|
||||||
- '%1 = CVT_f64_f32 %0, 0'
|
; CHECK: %3 = FADD_rnf64ri %1, double 3.250000e+00
|
||||||
- '%2 = LD_i32_avar 0, 4, 1, 0, 32, $test_param_1'
|
%3 = FADD_rnf64ri %1, double 3.250000e+00
|
||||||
# CHECK: %3 = FADD_rnf64ri %1, double 3.250000e+00
|
%4 = CVT_f32_f64 %3, 5
|
||||||
- '%3 = FADD_rnf64ri %1, double 3.250000e+00'
|
%5 = CVT_f32_s32 %2, 5
|
||||||
- '%4 = CVT_f32_f64 %3, 5'
|
; CHECK: %6 = FADD_rnf32ri %5, float 6.250000e+00
|
||||||
- '%5 = CVT_f32_s32 %2, 5'
|
%6 = FADD_rnf32ri %5, float 6.250000e+00
|
||||||
# CHECK: %6 = FADD_rnf32ri %5, float 6.250000e+00
|
%7 = FMUL_rnf32rr %6, %4
|
||||||
- '%6 = FADD_rnf32ri %5, float 6.250000e+00'
|
StoreRetvalF32 %7, 0
|
||||||
- '%7 = FMUL_rnf32rr %6, %4'
|
Return
|
||||||
- 'StoreRetvalF32 %7, 0'
|
|
||||||
- Return
|
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: test2
|
name: test2
|
||||||
|
@ -66,20 +64,18 @@ registers:
|
||||||
- { id: 5, class: float32regs }
|
- { id: 5, class: float32regs }
|
||||||
- { id: 6, class: float32regs }
|
- { id: 6, class: float32regs }
|
||||||
- { id: 7, class: float32regs }
|
- { id: 7, class: float32regs }
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
%0 = LD_f32_avar 0, 4, 1, 2, 32, $test2_param_0
|
||||||
instructions:
|
%1 = CVT_f64_f32 %0, 0
|
||||||
- '%0 = LD_f32_avar 0, 4, 1, 2, 32, $test2_param_0'
|
%2 = LD_i32_avar 0, 4, 1, 0, 32, $test2_param_1
|
||||||
- '%1 = CVT_f64_f32 %0, 0'
|
; CHECK: %3 = FADD_rnf64ri %1, double 0x7FF8000000000000
|
||||||
- '%2 = LD_i32_avar 0, 4, 1, 0, 32, $test2_param_1'
|
%3 = FADD_rnf64ri %1, double 0x7FF8000000000000
|
||||||
# CHECK: %3 = FADD_rnf64ri %1, double 0x7FF8000000000000
|
%4 = CVT_f32_f64 %3, 5
|
||||||
- '%3 = FADD_rnf64ri %1, double 0x7FF8000000000000'
|
%5 = CVT_f32_s32 %2, 5
|
||||||
- '%4 = CVT_f32_f64 %3, 5'
|
; CHECK: %6 = FADD_rnf32ri %5, float 0x7FF8000000000000
|
||||||
- '%5 = CVT_f32_s32 %2, 5'
|
%6 = FADD_rnf32ri %5, float 0x7FF8000000000000
|
||||||
# CHECK: %6 = FADD_rnf32ri %5, float 0x7FF8000000000000
|
%7 = FMUL_rnf32rr %6, %4
|
||||||
- '%6 = FADD_rnf32ri %5, float 0x7FF8000000000000'
|
StoreRetvalF32 %7, 0
|
||||||
- '%7 = FMUL_rnf32rr %6, %4'
|
Return
|
||||||
- 'StoreRetvalF32 %7, 0'
|
|
||||||
- Return
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -14,13 +14,11 @@ name: test
|
||||||
registers:
|
registers:
|
||||||
- { id: 0, class: float32regs }
|
- { id: 0, class: float32regs }
|
||||||
- { id: 1, class: float32regs }
|
- { id: 1, class: float32regs }
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
%0 = LD_f32_avar 0, 4, 1, 2, 32, $test_param_0
|
||||||
instructions:
|
; CHECK: [[@LINE+1]]:33: floating point constant does not have type 'float'
|
||||||
- '%0 = LD_f32_avar 0, 4, 1, 2, 32, $test_param_0'
|
%1 = FADD_rnf32ri %0, float 0xH3C00
|
||||||
# CHECK: [[@LINE+1]]:38: floating point constant does not have type 'float'
|
StoreRetvalF32 %1, 0
|
||||||
- '%1 = FADD_rnf32ri %0, float 0xH3C00'
|
Return
|
||||||
- 'StoreRetvalF32 %1, 0'
|
|
||||||
- Return
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -9,17 +9,54 @@
|
||||||
ret i32 %c
|
ret i32 %c
|
||||||
}
|
}
|
||||||
|
|
||||||
|
define i32 @test2(i32 %a, i32 %b) {
|
||||||
|
body:
|
||||||
|
%c = add i32 %a, %b
|
||||||
|
ret i32 %c
|
||||||
|
}
|
||||||
|
|
||||||
|
define i32 @test3() {
|
||||||
|
body:
|
||||||
|
ret i32 0
|
||||||
|
}
|
||||||
|
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: test
|
name: test
|
||||||
body:
|
body: |
|
||||||
# CHECK: name: body
|
; CHECK-LABEL: bb.0.body:
|
||||||
# CHECK: liveins: [ '%edi', '%esi' ]
|
; CHECK-NEXT: liveins: %edi, %esi
|
||||||
# CHECK-NEXT: instructions:
|
bb.0.body:
|
||||||
- id: 0
|
liveins: %edi, %esi
|
||||||
name: body
|
|
||||||
liveins: [ '%edi', '%esi' ]
|
%eax = LEA64_32r killed %rdi, 1, killed %rsi, 0, _
|
||||||
instructions:
|
RETQ %eax
|
||||||
- '%eax = LEA64_32r killed %rdi, 1, killed %rsi, 0, _'
|
...
|
||||||
- 'RETQ %eax'
|
---
|
||||||
|
name: test2
|
||||||
|
body: |
|
||||||
|
; CHECK-LABEL: name: test2
|
||||||
|
; Verify that we can have multiple lists of liveins that will be merged into
|
||||||
|
; one.
|
||||||
|
; CHECK: bb.0.body:
|
||||||
|
; CHECK-NEXT: liveins: %edi, %esi
|
||||||
|
bb.0.body:
|
||||||
|
liveins: %edi
|
||||||
|
liveins: %esi
|
||||||
|
|
||||||
|
%eax = LEA64_32r killed %rdi, 1, killed %rsi, 0, _
|
||||||
|
RETQ %eax
|
||||||
|
...
|
||||||
|
---
|
||||||
|
name: test3
|
||||||
|
body: |
|
||||||
|
; Verify that we can have an empty list of liveins.
|
||||||
|
; CHECK-LABEL: name: test3
|
||||||
|
; CHECK: bb.0.body:
|
||||||
|
; CHECK-NEXT: %eax = MOV32r0 implicit-def dead %eflags
|
||||||
|
bb.0.body:
|
||||||
|
liveins:
|
||||||
|
|
||||||
|
%eax = MOV32r0 implicit-def dead %eflags
|
||||||
|
RETQ killed %eax
|
||||||
...
|
...
|
||||||
|
|
|
@ -0,0 +1,41 @@
|
||||||
|
# RUN: not llc -march=x86-64 -start-after branch-folder -stop-after branch-folder -o /dev/null %s 2>&1 | FileCheck %s
|
||||||
|
|
||||||
|
--- |
|
||||||
|
|
||||||
|
define i32 @foo(i32 %a) {
|
||||||
|
entry:
|
||||||
|
%0 = icmp sle i32 %a, 10
|
||||||
|
br i1 %0, label %less, label %exit
|
||||||
|
|
||||||
|
less: ; preds = %entry
|
||||||
|
ret i32 0
|
||||||
|
|
||||||
|
exit: ; preds = %entry
|
||||||
|
ret i32 %a
|
||||||
|
}
|
||||||
|
|
||||||
|
...
|
||||||
|
---
|
||||||
|
name: foo
|
||||||
|
tracksRegLiveness: true
|
||||||
|
liveins:
|
||||||
|
- { reg: '%edi' }
|
||||||
|
body: |
|
||||||
|
bb.0.entry:
|
||||||
|
successors: %bb.1.less, %bb.2.exit
|
||||||
|
liveins: %edi 44
|
||||||
|
|
||||||
|
CMP32ri8 %edi, 10, implicit-def %eflags
|
||||||
|
JG_1 %bb.2.exit, implicit killed %eflags
|
||||||
|
|
||||||
|
; CHECK: [[@LINE+1]]:8: basic block definition should be located at the start of the line
|
||||||
|
less bb.1:
|
||||||
|
%eax = MOV32r0 implicit-def dead %eflags
|
||||||
|
RETQ killed %eax
|
||||||
|
|
||||||
|
bb.2.exit:
|
||||||
|
liveins: %edi
|
||||||
|
|
||||||
|
%eax = COPY killed %edi
|
||||||
|
RETQ killed %eax
|
||||||
|
...
|
|
@ -54,84 +54,68 @@
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: test
|
name: test
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
successors: %bb.1.block
|
||||||
successors: [ '%bb.1.block' ]
|
; CHECK: %rax = LEA64r %rip, 1, _, blockaddress(@test, %ir-block.block), _
|
||||||
instructions:
|
%rax = LEA64r %rip, 1, _, blockaddress(@test, %ir-block.block), _
|
||||||
# CHECK: %rax = LEA64r %rip, 1, _, blockaddress(@test, %ir-block.block), _
|
MOV64mr %rip, 1, _, @addr, _, killed %rax
|
||||||
- '%rax = LEA64r %rip, 1, _, blockaddress(@test, %ir-block.block), _'
|
JMP64m %rip, 1, _, @addr, _
|
||||||
- 'MOV64mr %rip, 1, _, @addr, _, killed %rax'
|
|
||||||
- 'JMP64m %rip, 1, _, @addr, _'
|
bb.1.block (address-taken):
|
||||||
- id: 1
|
RETQ
|
||||||
name: block
|
|
||||||
addressTaken: true
|
|
||||||
instructions:
|
|
||||||
- RETQ
|
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: test2
|
name: test2
|
||||||
tracksRegLiveness: true
|
tracksRegLiveness: true
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
successors: %bb.1
|
||||||
successors: [ '%bb.1' ]
|
; CHECK: %rax = LEA64r %rip, 1, _, blockaddress(@test2, %ir-block."quoted block"), _
|
||||||
instructions:
|
%rax = LEA64r %rip, 1, _, blockaddress(@test2, %ir-block."quoted block"), _
|
||||||
# CHECK: %rax = LEA64r %rip, 1, _, blockaddress(@test2, %ir-block."quoted block"), _
|
MOV64mr %rip, 1, _, @addr, _, killed %rax
|
||||||
- '%rax = LEA64r %rip, 1, _, blockaddress(@test2, %ir-block."quoted block"), _'
|
JMP64m %rip, 1, _, @addr, _
|
||||||
- 'MOV64mr %rip, 1, _, @addr, _, killed %rax'
|
|
||||||
- 'JMP64m %rip, 1, _, @addr, _'
|
bb.1 (address-taken):
|
||||||
- id: 1
|
RETQ
|
||||||
addressTaken: true
|
|
||||||
instructions:
|
|
||||||
- RETQ
|
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: slot_in_other_function
|
name: slot_in_other_function
|
||||||
tracksRegLiveness: true
|
tracksRegLiveness: true
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
liveins: %rdi
|
||||||
liveins: [ '%rdi' ]
|
; CHECK-LABEL: name: slot_in_other_function
|
||||||
instructions:
|
; CHECK: %rax = LEA64r %rip, 1, _, blockaddress(@test3, %ir-block.0), _
|
||||||
# CHECK: name: slot_in_other_function
|
%rax = LEA64r %rip, 1, _, blockaddress(@test3, %ir-block.0), _
|
||||||
# CHECK: %rax = LEA64r %rip, 1, _, blockaddress(@test3, %ir-block.0), _
|
MOV64mr killed %rdi, 1, _, 0, _, killed %rax
|
||||||
- '%rax = LEA64r %rip, 1, _, blockaddress(@test3, %ir-block.0), _'
|
RETQ
|
||||||
- 'MOV64mr killed %rdi, 1, _, 0, _, killed %rax'
|
|
||||||
- RETQ
|
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: test3
|
name: test3
|
||||||
tracksRegLiveness: true
|
tracksRegLiveness: true
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
successors: %bb.1
|
||||||
successors: [ '%bb.1' ]
|
; CHECK-LABEL: name: test3
|
||||||
instructions:
|
; CHECK: %rax = LEA64r %rip, 1, _, blockaddress(@test3, %ir-block.0), _
|
||||||
# CHECK: name: test3
|
%rax = LEA64r %rip, 1, _, blockaddress(@test3, %ir-block.0), _
|
||||||
# CHECK: %rax = LEA64r %rip, 1, _, blockaddress(@test3, %ir-block.0), _
|
MOV64mr %rip, 1, _, @addr, _, killed %rax
|
||||||
- '%rax = LEA64r %rip, 1, _, blockaddress(@test3, %ir-block.0), _'
|
JMP64m %rip, 1, _, @addr, _
|
||||||
- 'MOV64mr %rip, 1, _, @addr, _, killed %rax'
|
|
||||||
- 'JMP64m %rip, 1, _, @addr, _'
|
bb.1 (address-taken):
|
||||||
- id: 1
|
RETQ
|
||||||
addressTaken: true
|
|
||||||
instructions:
|
|
||||||
- RETQ
|
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: test4
|
name: test4
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
successors: %bb.1.block
|
||||||
successors: [ '%bb.1.block' ]
|
; CHECK: %rax = LEA64r %rip, 1, _, blockaddress(@test, %ir-block.block) + 2, _
|
||||||
instructions:
|
%rax = LEA64r %rip, 1, _, blockaddress(@test, %ir-block.block) + 2, _
|
||||||
# CHECK: %rax = LEA64r %rip, 1, _, blockaddress(@test, %ir-block.block) + 2, _
|
MOV64mr %rip, 1, _, @addr, _, killed %rax
|
||||||
- '%rax = LEA64r %rip, 1, _, blockaddress(@test, %ir-block.block) + 2, _'
|
JMP64m %rip, 1, _, @addr, _
|
||||||
- 'MOV64mr %rip, 1, _, @addr, _, killed %rax'
|
|
||||||
- 'JMP64m %rip, 1, _, @addr, _'
|
bb.1.block (address-taken):
|
||||||
- id: 1
|
RETQ
|
||||||
name: block
|
|
||||||
addressTaken: true
|
|
||||||
instructions:
|
|
||||||
- RETQ
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -34,13 +34,12 @@
|
||||||
---
|
---
|
||||||
name: compute
|
name: compute
|
||||||
tracksRegLiveness: true
|
tracksRegLiveness: true
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.body:
|
||||||
name: body
|
liveins: %edi
|
||||||
liveins: [ '%edi' ]
|
|
||||||
instructions:
|
%eax = COPY killed %edi
|
||||||
- '%eax = COPY killed %edi'
|
RETQ killed %eax
|
||||||
- 'RETQ killed %eax'
|
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: func
|
name: func
|
||||||
|
@ -60,39 +59,37 @@ fixedStack:
|
||||||
stack:
|
stack:
|
||||||
- { id: 0, name: b, offset: -20, size: 4, alignment: 4 }
|
- { id: 0, name: b, offset: -20, size: 4, alignment: 4 }
|
||||||
- { id: 1, offset: -24, size: 4, alignment: 4, callee-saved-register: '%edi' }
|
- { id: 1, offset: -24, size: 4, alignment: 4, callee-saved-register: '%edi' }
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
successors: %bb.1.check
|
||||||
successors: [ '%bb.1.check' ]
|
liveins: %edi, %rbx
|
||||||
liveins: [ '%edi', '%rbx' ]
|
|
||||||
instructions:
|
frame-setup PUSH64r killed %rbx, implicit-def %rsp, implicit %rsp
|
||||||
- 'frame-setup PUSH64r killed %rbx, implicit-def %rsp, implicit %rsp'
|
%rsp = frame-setup SUB64ri8 %rsp, 16, implicit-def dead %eflags
|
||||||
- '%rsp = frame-setup SUB64ri8 %rsp, 16, implicit-def dead %eflags'
|
%ebx = COPY %edi
|
||||||
- '%ebx = COPY %edi'
|
MOV32mr %rsp, 1, _, 12, _, %ebx
|
||||||
- 'MOV32mr %rsp, 1, _, 12, _, %ebx'
|
|
||||||
- id: 1
|
bb.1.check:
|
||||||
name: check
|
successors: %bb.2.loop, %bb.3.exit
|
||||||
successors: [ '%bb.2.loop', '%bb.3.exit' ]
|
liveins: %ebx
|
||||||
liveins: [ '%ebx' ]
|
|
||||||
instructions:
|
CMP32ri8 %ebx, 10, implicit-def %eflags
|
||||||
- 'CMP32ri8 %ebx, 10, implicit-def %eflags'
|
JG_1 %bb.3.exit, implicit killed %eflags
|
||||||
- 'JG_1 %bb.3.exit, implicit killed %eflags'
|
JMP_1 %bb.2.loop
|
||||||
- 'JMP_1 %bb.2.loop'
|
|
||||||
- id: 2
|
bb.2.loop:
|
||||||
name: loop
|
successors: %bb.1.check
|
||||||
successors: [ '%bb.1.check' ]
|
liveins: %ebx
|
||||||
liveins: [ '%ebx' ]
|
|
||||||
instructions:
|
%edi = MOV32rm %rsp, 1, _, 12, _
|
||||||
- '%edi = MOV32rm %rsp, 1, _, 12, _'
|
CALL64pcrel32 @compute, csr_64, implicit %rsp, implicit %edi, implicit-def %rsp, implicit-def %eax
|
||||||
- 'CALL64pcrel32 @compute, csr_64, implicit %rsp, implicit %edi, implicit-def %rsp, implicit-def %eax'
|
%eax = DEC32r killed %eax, implicit-def dead %eflags
|
||||||
- '%eax = DEC32r killed %eax, implicit-def dead %eflags'
|
MOV32mr %rsp, 1, _, 12, _, killed %eax
|
||||||
- 'MOV32mr %rsp, 1, _, 12, _, killed %eax'
|
JMP_1 %bb.1.check
|
||||||
- 'JMP_1 %bb.1.check'
|
|
||||||
- id: 3
|
bb.3.exit:
|
||||||
name: exit
|
%eax = MOV32r0 implicit-def dead %eflags
|
||||||
instructions:
|
%rsp = ADD64ri8 %rsp, 16, implicit-def dead %eflags
|
||||||
- '%eax = MOV32r0 implicit-def dead %eflags'
|
%rbx = POP64r implicit-def %rsp, implicit %rsp
|
||||||
- '%rsp = ADD64ri8 %rsp, 16, implicit-def dead %eflags'
|
RETQ %eax
|
||||||
- '%rbx = POP64r implicit-def %rsp, implicit %rsp'
|
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -18,14 +18,12 @@ frameInfo:
|
||||||
stackSize: 4040
|
stackSize: 4040
|
||||||
stack:
|
stack:
|
||||||
- { id: 0, name: tmp, offset: -4176, size: 4168, alignment: 4 }
|
- { id: 0, name: tmp, offset: -4176, size: 4168, alignment: 4 }
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
%rsp = SUB64ri32 %rsp, 4040, implicit-def dead %eflags
|
||||||
instructions:
|
; CHECK: CFI_INSTRUCTION .cfi_def_cfa_offset 4048
|
||||||
- '%rsp = SUB64ri32 %rsp, 4040, implicit-def dead %eflags'
|
CFI_INSTRUCTION .cfi_def_cfa_offset 4048
|
||||||
# CHECK: CFI_INSTRUCTION .cfi_def_cfa_offset 4048
|
%rsp = ADD64ri32 %rsp, 4040, implicit-def dead %eflags
|
||||||
- 'CFI_INSTRUCTION .cfi_def_cfa_offset 4048'
|
RETQ
|
||||||
- '%rsp = ADD64ri32 %rsp, 4040, implicit-def dead %eflags'
|
|
||||||
- 'RETQ'
|
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
|
@ -19,15 +19,14 @@ frameInfo:
|
||||||
stackSize: 8
|
stackSize: 8
|
||||||
fixedStack:
|
fixedStack:
|
||||||
- { id: 0, type: spill-slot, offset: -16, size: 8, alignment: 16 }
|
- { id: 0, type: spill-slot, offset: -16, size: 8, alignment: 16 }
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
liveins: %rbp
|
||||||
liveins: [ '%rbp' ]
|
|
||||||
instructions:
|
PUSH64r killed %rbp, implicit-def %rsp, implicit %rsp
|
||||||
- 'PUSH64r killed %rbp, implicit-def %rsp, implicit %rsp'
|
CFI_INSTRUCTION .cfi_def_cfa_offset 16
|
||||||
- 'CFI_INSTRUCTION .cfi_def_cfa_offset 16'
|
CFI_INSTRUCTION .cfi_offset %rbp, -16
|
||||||
- 'CFI_INSTRUCTION .cfi_offset %rbp, -16'
|
%rbp = MOV64rr %rsp
|
||||||
- '%rbp = MOV64rr %rsp'
|
; CHECK: CFI_INSTRUCTION .cfi_def_cfa_register %rbp
|
||||||
# CHECK: CFI_INSTRUCTION .cfi_def_cfa_register %rbp
|
CFI_INSTRUCTION .cfi_def_cfa_register %rbp
|
||||||
- 'CFI_INSTRUCTION .cfi_def_cfa_register %rbp'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -26,23 +26,22 @@ frameInfo:
|
||||||
hasCalls: true
|
hasCalls: true
|
||||||
fixedStack:
|
fixedStack:
|
||||||
- { id: 0, type: spill-slot, offset: -16, size: 8, alignment: 16 }
|
- { id: 0, type: spill-slot, offset: -16, size: 8, alignment: 16 }
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
liveins: %ecx, %edi, %edx, %esi, %rbx
|
||||||
liveins: [ '%ecx', '%edi', '%edx', '%esi', '%rbx' ]
|
|
||||||
instructions:
|
PUSH64r killed %rbx, implicit-def %rsp, implicit %rsp
|
||||||
- 'PUSH64r killed %rbx, implicit-def %rsp, implicit %rsp'
|
CFI_INSTRUCTION .cfi_def_cfa_offset 16
|
||||||
- 'CFI_INSTRUCTION .cfi_def_cfa_offset 16'
|
; CHECK: CFI_INSTRUCTION .cfi_offset %rbx, -16
|
||||||
# CHECK: CFI_INSTRUCTION .cfi_offset %rbx, -16
|
CFI_INSTRUCTION .cfi_offset %rbx, -16
|
||||||
- 'CFI_INSTRUCTION .cfi_offset %rbx, -16'
|
%ebx = COPY %edi, implicit-def %rbx
|
||||||
- '%ebx = COPY %edi, implicit-def %rbx'
|
%ebx = ADD32rr %ebx, killed %esi, implicit-def dead %eflags
|
||||||
- '%ebx = ADD32rr %ebx, killed %esi, implicit-def dead %eflags'
|
%ebx = ADD32rr %ebx, killed %edx, implicit-def dead %eflags
|
||||||
- '%ebx = ADD32rr %ebx, killed %edx, implicit-def dead %eflags'
|
%ebx = ADD32rr %ebx, killed %ecx, implicit-def dead %eflags
|
||||||
- '%ebx = ADD32rr %ebx, killed %ecx, implicit-def dead %eflags'
|
%edi = COPY %ebx
|
||||||
- '%edi = COPY %ebx'
|
CALL64pcrel32 @foo, csr_64, implicit %rsp, implicit %edi, implicit-def %rsp
|
||||||
- 'CALL64pcrel32 @foo, csr_64, implicit %rsp, implicit %edi, implicit-def %rsp'
|
%eax = LEA64_32r killed %rbx, 1, %rbx, 0, _
|
||||||
- '%eax = LEA64_32r killed %rbx, 1, %rbx, 0, _'
|
%rbx = POP64r implicit-def %rsp, implicit %rsp
|
||||||
- '%rbx = POP64r implicit-def %rsp, implicit %rsp'
|
RETQ %eax
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
|
@ -17,11 +17,9 @@ constants:
|
||||||
# CHECK: [[@LINE+1]]:18: redefinition of constant pool item '%const.0'
|
# CHECK: [[@LINE+1]]:18: redefinition of constant pool item '%const.0'
|
||||||
- id: 0
|
- id: 0
|
||||||
value: 'double 3.250000e+00'
|
value: 'double 3.250000e+00'
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
%xmm0 = ADDSDrm killed %xmm0, %rip, 1, _, %const.0, _
|
||||||
instructions:
|
RETQ %xmm0
|
||||||
- '%xmm0 = ADDSDrm killed %xmm0, %rip, 1, _, %const.0, _'
|
|
||||||
- 'RETQ %xmm0'
|
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
|
@ -57,17 +57,15 @@ constants:
|
||||||
- id: 1
|
- id: 1
|
||||||
value: 'float 6.250000e+00'
|
value: 'float 6.250000e+00'
|
||||||
alignment: 4
|
alignment: 4
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
; CHECK: %xmm0 = ADDSDrm killed %xmm0, %rip, 1, _, %const.0, _
|
||||||
instructions:
|
; CHECK-NEXT: %xmm1 = ADDSSrm killed %xmm1, %rip, 1, _, %const.1, _
|
||||||
# CHECK: %xmm0 = ADDSDrm killed %xmm0, %rip, 1, _, %const.0, _
|
%xmm0 = ADDSDrm killed %xmm0, %rip, 1, _, %const.0, _
|
||||||
# CHECK-NEXT: %xmm1 = ADDSSrm killed %xmm1, %rip, 1, _, %const.1, _
|
%xmm1 = ADDSSrm killed %xmm1, %rip, 1, _, %const.1, _
|
||||||
- '%xmm0 = ADDSDrm killed %xmm0, %rip, 1, _, %const.0, _'
|
%xmm1 = CVTSS2SDrr killed %xmm1
|
||||||
- '%xmm1 = ADDSSrm killed %xmm1, %rip, 1, _, %const.1, _'
|
%xmm0 = MULSDrr killed %xmm0, killed %xmm1
|
||||||
- '%xmm1 = CVTSS2SDrr killed %xmm1'
|
RETQ %xmm0
|
||||||
- '%xmm0 = MULSDrr killed %xmm0, killed %xmm1'
|
|
||||||
- 'RETQ %xmm0'
|
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
# Verify that alignment can be inferred:
|
# Verify that alignment can be inferred:
|
||||||
|
@ -85,15 +83,13 @@ constants:
|
||||||
value: 'double 3.250000e+00'
|
value: 'double 3.250000e+00'
|
||||||
- id: 1
|
- id: 1
|
||||||
value: 'float 6.250000e+00'
|
value: 'float 6.250000e+00'
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
%xmm0 = ADDSDrm killed %xmm0, %rip, 1, _, %const.0, _
|
||||||
instructions:
|
%xmm1 = ADDSSrm killed %xmm1, %rip, 1, _, %const.1, _
|
||||||
- '%xmm0 = ADDSDrm killed %xmm0, %rip, 1, _, %const.0, _'
|
%xmm1 = CVTSS2SDrr killed %xmm1
|
||||||
- '%xmm1 = ADDSSrm killed %xmm1, %rip, 1, _, %const.1, _'
|
%xmm0 = MULSDrr killed %xmm0, killed %xmm1
|
||||||
- '%xmm1 = CVTSS2SDrr killed %xmm1'
|
RETQ %xmm0
|
||||||
- '%xmm0 = MULSDrr killed %xmm0, killed %xmm1'
|
|
||||||
- 'RETQ %xmm0'
|
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
# Verify that the non-standard alignments are respected:
|
# Verify that the non-standard alignments are respected:
|
||||||
|
@ -113,17 +109,15 @@ constants:
|
||||||
- id: 1
|
- id: 1
|
||||||
value: 'float 6.250000e+00'
|
value: 'float 6.250000e+00'
|
||||||
alignment: 1
|
alignment: 1
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
; CHECK: %xmm0 = ADDSDrm killed %xmm0, %rip, 1, _, %const.0, _
|
||||||
instructions:
|
; CHECK-NEXT: %xmm1 = ADDSSrm killed %xmm1, %rip, 1, _, %const.1, _
|
||||||
# CHECK: %xmm0 = ADDSDrm killed %xmm0, %rip, 1, _, %const.0, _
|
%xmm0 = ADDSDrm killed %xmm0, %rip, 1, _, %const.0, _
|
||||||
# CHECK-NEXT: %xmm1 = ADDSSrm killed %xmm1, %rip, 1, _, %const.1, _
|
%xmm1 = ADDSSrm killed %xmm1, %rip, 1, _, %const.1, _
|
||||||
- '%xmm0 = ADDSDrm killed %xmm0, %rip, 1, _, %const.0, _'
|
%xmm1 = CVTSS2SDrr killed %xmm1
|
||||||
- '%xmm1 = ADDSSrm killed %xmm1, %rip, 1, _, %const.1, _'
|
%xmm0 = MULSDrr killed %xmm0, killed %xmm1
|
||||||
- '%xmm1 = CVTSS2SDrr killed %xmm1'
|
RETQ %xmm0
|
||||||
- '%xmm0 = MULSDrr killed %xmm0, killed %xmm1'
|
|
||||||
- 'RETQ %xmm0'
|
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
# CHECK: name: test4
|
# CHECK: name: test4
|
||||||
|
@ -133,15 +127,13 @@ constants:
|
||||||
value: 'double 3.250000e+00'
|
value: 'double 3.250000e+00'
|
||||||
- id: 1
|
- id: 1
|
||||||
value: 'float 6.250000e+00'
|
value: 'float 6.250000e+00'
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
; CHECK: %xmm0 = ADDSDrm killed %xmm0, %rip, 1, _, %const.1 - 12, _
|
||||||
instructions:
|
; CHECK-NEXT: %xmm1 = ADDSSrm killed %xmm1, %rip, 1, _, %const.0 + 8, _
|
||||||
# CHECK: %xmm0 = ADDSDrm killed %xmm0, %rip, 1, _, %const.1 - 12, _
|
%xmm0 = ADDSDrm killed %xmm0, %rip, 1, _, %const.1 - 12, _
|
||||||
# CHECK-NEXT: %xmm1 = ADDSSrm killed %xmm1, %rip, 1, _, %const.0 + 8, _
|
%xmm1 = ADDSSrm killed %xmm1, %rip, 1, _, %const.0 + 8, _
|
||||||
- '%xmm0 = ADDSDrm killed %xmm0, %rip, 1, _, %const.1 - 12, _'
|
%xmm1 = CVTSS2SDrr killed %xmm1
|
||||||
- '%xmm1 = ADDSSrm killed %xmm1, %rip, 1, _, %const.0 + 8, _'
|
%xmm0 = MULSDrr killed %xmm0, killed %xmm1
|
||||||
- '%xmm1 = CVTSS2SDrr killed %xmm1'
|
RETQ %xmm0
|
||||||
- '%xmm0 = MULSDrr killed %xmm0, killed %xmm1'
|
|
||||||
- 'RETQ %xmm0'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -17,11 +17,9 @@ constants:
|
||||||
- id: 0
|
- id: 0
|
||||||
# CHECK: [[@LINE+1]]:19: expected type
|
# CHECK: [[@LINE+1]]:19: expected type
|
||||||
value: 'dub 3.250000e+00'
|
value: 'dub 3.250000e+00'
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
%xmm0 = ADDSDrm killed %xmm0, %rip, 1, _, %const.0, _
|
||||||
instructions:
|
RETQ %xmm0
|
||||||
- '%xmm0 = ADDSDrm killed %xmm0, %rip, 1, _, %const.0, _'
|
|
||||||
- 'RETQ %xmm0'
|
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
|
@ -15,12 +15,10 @@
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: foo
|
name: foo
|
||||||
body:
|
body: |
|
||||||
# CHECK: name: body
|
; CHECK: bb.0.body:
|
||||||
- id: 0
|
bb.0.body:
|
||||||
name: body
|
; CHECK: %eax = IMUL32rri8 %edi, 11, implicit-def dead %eflags
|
||||||
instructions:
|
%eax = IMUL32rri8 %edi, 11, implicit-def dead %eflags
|
||||||
# CHECK: - '%eax = IMUL32rri8 %edi, 11, implicit-def dead %eflags'
|
RETQ %eax
|
||||||
- '%eax = IMUL32rri8 %edi, 11, implicit-def dead %eflags'
|
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -16,14 +16,12 @@ name: volatile_inc
|
||||||
tracksRegLiveness: true
|
tracksRegLiveness: true
|
||||||
liveins:
|
liveins:
|
||||||
- { reg: '%rdi' }
|
- { reg: '%rdi' }
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
liveins: %rdi
|
||||||
liveins: [ '%rdi' ]
|
; CHECK: [[@LINE+1]]:50: duplicate 'volatile' memory operand flag
|
||||||
instructions:
|
%eax = MOV32rm %rdi, 1, _, 0, _ :: (volatile volatile load 4 from %ir.x)
|
||||||
# CHECK: [[@LINE+1]]:55: duplicate 'volatile' memory operand flag
|
%eax = INC32r killed %eax, implicit-def dead %eflags
|
||||||
- '%eax = MOV32rm %rdi, 1, _, 0, _ :: (volatile volatile load 4 from %ir.x)'
|
MOV32mr killed %rdi, 1, _, 0, _, %eax :: (volatile store 4 into %ir.x)
|
||||||
- '%eax = INC32r killed %eax, implicit-def dead %eflags'
|
RETQ %eax
|
||||||
- 'MOV32mr killed %rdi, 1, _, 0, _, %eax :: (volatile store 4 into %ir.x)'
|
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -17,22 +17,19 @@
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: foo
|
name: foo
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
successors: %bb.1.less, %bb.2.exit
|
||||||
successors: [ '%bb.1.less', '%bb.2.exit' ]
|
|
||||||
instructions:
|
CMP32ri8 %edi, 10, implicit-def %eflags
|
||||||
- 'CMP32ri8 %edi, 10, implicit-def %eflags'
|
; CHECK: [[@LINE+1]]:31: duplicate 'implicit' register flag
|
||||||
# CHECK: [[@LINE+1]]:36: duplicate 'implicit' register flag
|
JG_1 %bb.2.exit, implicit implicit %eflags
|
||||||
- 'JG_1 %bb.2.exit, implicit implicit %eflags'
|
|
||||||
- id: 1
|
bb.1.less:
|
||||||
name: less
|
%eax = MOV32r0 implicit-def %eflags
|
||||||
instructions:
|
RETQ %eax
|
||||||
- '%eax = MOV32r0 implicit-def %eflags'
|
|
||||||
- 'RETQ %eax'
|
bb.2.exit:
|
||||||
- id: 2
|
%eax = COPY %edi
|
||||||
name: exit
|
RETQ %eax
|
||||||
instructions:
|
|
||||||
- '%eax = COPY %edi'
|
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -28,19 +28,18 @@ frameInfo:
|
||||||
stackSize: 8
|
stackSize: 8
|
||||||
adjustsStack: true
|
adjustsStack: true
|
||||||
hasCalls: true
|
hasCalls: true
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
liveins: %edi, %esi
|
||||||
liveins: [ '%edi', '%esi' ]
|
|
||||||
instructions:
|
frame-setup PUSH64r undef %rax, implicit-def %rsp, implicit %rsp
|
||||||
- 'frame-setup PUSH64r undef %rax, implicit-def %rsp, implicit %rsp'
|
CFI_INSTRUCTION .cfi_def_cfa_offset 16
|
||||||
- CFI_INSTRUCTION .cfi_def_cfa_offset 16
|
%ecx = COPY %edi
|
||||||
- '%ecx = COPY %edi'
|
%ecx = ADD32rr killed %ecx, killed %esi, implicit-def dead %eflags
|
||||||
- '%ecx = ADD32rr killed %ecx, killed %esi, implicit-def dead %eflags'
|
; CHECK: INLINEASM $nop, 1, 12, implicit-def dead early-clobber %ax, 12, implicit-def dead early-clobber %di
|
||||||
# CHECK: INLINEASM $nop, 1, 12, implicit-def dead early-clobber %ax, 12, implicit-def dead early-clobber %di
|
INLINEASM $nop, 1, 12, implicit-def dead early-clobber %ax, 12, implicit-def dead early-clobber %di
|
||||||
- 'INLINEASM $nop, 1, 12, implicit-def dead early-clobber %ax, 12, implicit-def dead early-clobber %di'
|
%edi = COPY killed %ecx
|
||||||
- '%edi = COPY killed %ecx'
|
CALL64pcrel32 @foo, csr_64, implicit %rsp, implicit %edi, implicit-def %rsp
|
||||||
- 'CALL64pcrel32 @foo, csr_64, implicit %rsp, implicit %edi, implicit-def %rsp'
|
%rax = POP64r implicit-def %rsp, implicit %rsp
|
||||||
- '%rax = POP64r implicit-def %rsp, implicit %rsp'
|
RETQ
|
||||||
- RETQ
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -16,17 +16,15 @@ name: memory_alignment
|
||||||
tracksRegLiveness: true
|
tracksRegLiveness: true
|
||||||
liveins:
|
liveins:
|
||||||
- { reg: '%rdi' }
|
- { reg: '%rdi' }
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
liveins: %rdi
|
||||||
liveins: [ '%rdi' ]
|
; CHECK: [[@LINE+1]]:65: expected 'align'
|
||||||
instructions:
|
%xmm0 = MOVAPSrm %rdi, 1, _, 0, _ :: (load 16 from %ir.vec, 32)
|
||||||
# CHECK: [[@LINE+1]]:70: expected 'align'
|
%xmm1 = MOVAPSrm %rdi, 1, _, 16, _ :: (load 16 from %ir.vec + 16, align 32)
|
||||||
- '%xmm0 = MOVAPSrm %rdi, 1, _, 0, _ :: (load 16 from %ir.vec, 32)'
|
%xmm2 = FsFLD0SS
|
||||||
- '%xmm1 = MOVAPSrm %rdi, 1, _, 16, _ :: (load 16 from %ir.vec + 16, align 32)'
|
%xmm1 = MOVSSrr killed %xmm1, killed %xmm2
|
||||||
- '%xmm2 = FsFLD0SS'
|
MOVAPSmr %rdi, 1, _, 0, _, killed %xmm0 :: (store 16 into %ir.vec, align 32)
|
||||||
- '%xmm1 = MOVSSrr killed %xmm1, killed %xmm2'
|
MOVAPSmr killed %rdi, 1, _, 16, _, killed %xmm1 :: (store 16 into %ir.vec + 16, align 32)
|
||||||
- 'MOVAPSmr %rdi, 1, _, 0, _, killed %xmm0 :: (store 16 into %ir.vec, align 32)'
|
RETQ
|
||||||
- 'MOVAPSmr killed %rdi, 1, _, 16, _, killed %xmm1 :: (store 16 into %ir.vec + 16, align 32)'
|
|
||||||
- RETQ
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -16,17 +16,15 @@ name: memory_alignment
|
||||||
tracksRegLiveness: true
|
tracksRegLiveness: true
|
||||||
liveins:
|
liveins:
|
||||||
- { reg: '%rdi' }
|
- { reg: '%rdi' }
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
liveins: %rdi
|
||||||
liveins: [ '%rdi' ]
|
; CHECK: [[@LINE+1]]:70: expected an integer literal after 'align'
|
||||||
instructions:
|
%xmm0 = MOVAPSrm %rdi, 1, _, 0, _ :: (load 16 from %ir.vec, align)
|
||||||
# CHECK: [[@LINE+1]]:75: expected an integer literal after 'align'
|
%xmm1 = MOVAPSrm %rdi, 1, _, 16, _ :: (load 16 from %ir.vec + 16, align 32)
|
||||||
- '%xmm0 = MOVAPSrm %rdi, 1, _, 0, _ :: (load 16 from %ir.vec, align)'
|
%xmm2 = FsFLD0SS
|
||||||
- '%xmm1 = MOVAPSrm %rdi, 1, _, 16, _ :: (load 16 from %ir.vec + 16, align 32)'
|
%xmm1 = MOVSSrr killed %xmm1, killed %xmm2
|
||||||
- '%xmm2 = FsFLD0SS'
|
MOVAPSmr %rdi, 1, _, 0, _, killed %xmm0 :: (store 16 into %ir.vec, align 32)
|
||||||
- '%xmm1 = MOVSSrr killed %xmm1, killed %xmm2'
|
MOVAPSmr killed %rdi, 1, _, 16, _, killed %xmm1 :: (store 16 into %ir.vec + 16, align 32)
|
||||||
- 'MOVAPSmr %rdi, 1, _, 0, _, killed %xmm0 :: (store 16 into %ir.vec, align 32)'
|
RETQ
|
||||||
- 'MOVAPSmr killed %rdi, 1, _, 16, _, killed %xmm1 :: (store 16 into %ir.vec + 16, align 32)'
|
|
||||||
- RETQ
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -0,0 +1,40 @@
|
||||||
|
# RUN: not llc -march=x86-64 -start-after branch-folder -stop-after branch-folder -o /dev/null %s 2>&1 | FileCheck %s
|
||||||
|
|
||||||
|
--- |
|
||||||
|
|
||||||
|
define i32 @foo(i32 %a) {
|
||||||
|
entry:
|
||||||
|
%0 = icmp sle i32 %a, 10
|
||||||
|
br i1 %0, label %less, label %exit
|
||||||
|
|
||||||
|
less: ; preds = %entry
|
||||||
|
ret i32 0
|
||||||
|
|
||||||
|
exit: ; preds = %entry
|
||||||
|
ret i32 %a
|
||||||
|
}
|
||||||
|
|
||||||
|
...
|
||||||
|
---
|
||||||
|
name: foo
|
||||||
|
tracksRegLiveness: true
|
||||||
|
liveins:
|
||||||
|
- { reg: '%edi' }
|
||||||
|
body: |
|
||||||
|
; CHECK: [[@LINE+1]]:3: expected a basic block definition before instructions
|
||||||
|
successors: %bb.1.less, %bb.2.exit
|
||||||
|
liveins: %edi 44
|
||||||
|
|
||||||
|
CMP32ri8 %edi, 10, implicit-def %eflags
|
||||||
|
JG_1 %bb.2.exit, implicit killed %eflags
|
||||||
|
|
||||||
|
bb.1.less:
|
||||||
|
%eax = MOV32r0 implicit-def dead %eflags
|
||||||
|
RETQ killed %eax
|
||||||
|
|
||||||
|
bb.2.exit:
|
||||||
|
liveins: %edi
|
||||||
|
|
||||||
|
%eax = COPY killed %edi
|
||||||
|
RETQ killed %eax
|
||||||
|
...
|
|
@ -17,18 +17,14 @@
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: test
|
name: test
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
successors: %bb.1.block
|
||||||
successors: [ '%bb.1.block' ]
|
; CHECK: [[@LINE+1]]:51: expected an IR block reference
|
||||||
instructions:
|
%rax = LEA64r %rip, 1, _, blockaddress(@test, _), _
|
||||||
# CHECK: [[@LINE+1]]:56: expected an IR block reference
|
MOV64mr %rip, 1, _, @addr, _, killed %rax
|
||||||
- '%rax = LEA64r %rip, 1, _, blockaddress(@test, _), _'
|
JMP64m %rip, 1, _, @addr, _
|
||||||
- 'MOV64mr %rip, 1, _, @addr, _, killed %rax'
|
|
||||||
- 'JMP64m %rip, 1, _, @addr, _'
|
bb.1.block (address-taken):
|
||||||
- id: 1
|
RETQ
|
||||||
name: block
|
|
||||||
addressTaken: true
|
|
||||||
instructions:
|
|
||||||
- RETQ
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -24,21 +24,19 @@ frameInfo:
|
||||||
hasCalls: true
|
hasCalls: true
|
||||||
fixedStack:
|
fixedStack:
|
||||||
- { id: 0, type: spill-slot, offset: -16, size: 8, alignment: 16 }
|
- { id: 0, type: spill-slot, offset: -16, size: 8, alignment: 16 }
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
PUSH64r killed %rbx, implicit-def %rsp, implicit %rsp
|
||||||
instructions:
|
CFI_INSTRUCTION .cfi_def_cfa_offset 16
|
||||||
- 'PUSH64r killed %rbx, implicit-def %rsp, implicit %rsp'
|
; CHECK: [[@LINE+1]]:38: expected ','
|
||||||
- 'CFI_INSTRUCTION .cfi_def_cfa_offset 16'
|
CFI_INSTRUCTION .cfi_offset %rbx -16
|
||||||
# CHECK: [[@LINE+1]]:43: expected ','
|
%ebx = COPY %edi, implicit-def %rbx
|
||||||
- 'CFI_INSTRUCTION .cfi_offset %rbx -16'
|
%ebx = ADD32rr %ebx, killed %esi, implicit-def dead %eflags
|
||||||
- '%ebx = COPY %edi, implicit-def %rbx'
|
%ebx = ADD32rr %ebx, killed %edx, implicit-def dead %eflags
|
||||||
- '%ebx = ADD32rr %ebx, killed %esi, implicit-def dead %eflags'
|
%ebx = ADD32rr %ebx, killed %ecx, implicit-def dead %eflags
|
||||||
- '%ebx = ADD32rr %ebx, killed %edx, implicit-def dead %eflags'
|
%edi = COPY %ebx
|
||||||
- '%ebx = ADD32rr %ebx, killed %ecx, implicit-def dead %eflags'
|
CALL64pcrel32 @foo, csr_64, implicit %rsp, implicit %edi, implicit-def %rsp
|
||||||
- '%edi = COPY %ebx'
|
%eax = LEA64_32r killed %rbx, 1, %rbx, 0, _
|
||||||
- 'CALL64pcrel32 @foo, csr_64, implicit %rsp, implicit %edi, implicit-def %rsp'
|
%rbx = POP64r implicit-def %rsp, implicit %rsp
|
||||||
- '%eax = LEA64_32r killed %rbx, 1, %rbx, 0, _'
|
RETQ %eax
|
||||||
- '%rbx = POP64r implicit-def %rsp, implicit %rsp'
|
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -16,12 +16,10 @@ name: test
|
||||||
tracksRegLiveness: true
|
tracksRegLiveness: true
|
||||||
liveins:
|
liveins:
|
||||||
- { reg: '%rdi' }
|
- { reg: '%rdi' }
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry2:
|
||||||
name: entry2
|
liveins: %rdi
|
||||||
liveins: [ '%rdi' ]
|
; CHECK: [[@LINE+1]]:87: expected ',' before the next machine memory operand
|
||||||
instructions:
|
INC32m killed %rdi, 1, _, 0, _, implicit-def dead %eflags :: (store 4 into %ir.a) (load 4 from %ir.a)
|
||||||
# CHECK: [[@LINE+1]]:92: expected ',' before the next machine memory operand
|
RETQ
|
||||||
- 'INC32m killed %rdi, 1, _, 0, _, implicit-def dead %eflags :: (store 4 into %ir.a) (load 4 from %ir.a)'
|
|
||||||
- RETQ
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -19,20 +19,16 @@
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: foo
|
name: foo
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
%eax = MOV32rm %rdi, 1, _, 0, _
|
||||||
instructions:
|
CMP32ri8 %eax, 10, implicit-def %eflags
|
||||||
- '%eax = MOV32rm %rdi, 1, _, 0, _'
|
; CHECK: [[@LINE+1]]:22: expected an implicit register operand 'implicit %eflags'
|
||||||
- 'CMP32ri8 %eax, 10, implicit-def %eflags'
|
JG_1 %bb.2.exit, implicit %eax
|
||||||
# CHECK: [[@LINE+1]]:26: expected an implicit register operand 'implicit %eflags'
|
|
||||||
- 'JG_1 %bb.2.exit, implicit %eax'
|
bb.1.less:
|
||||||
- id: 1
|
%eax = MOV32r0 implicit-def %eflags
|
||||||
name: less
|
|
||||||
instructions:
|
bb.2.exit:
|
||||||
- '%eax = MOV32r0 implicit-def %eflags'
|
RETQ %eax
|
||||||
- id: 2
|
|
||||||
name: exit
|
|
||||||
instructions:
|
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -19,20 +19,16 @@
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: foo
|
name: foo
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
%eax = MOV32rm %rdi, 1, _, 0, _
|
||||||
instructions:
|
CMP32ri8 %eax, 10, implicit-def %eflags
|
||||||
- '%eax = MOV32rm %rdi, 1, _, 0, _'
|
; CHECK: [[@LINE+1]]:22: expected an implicit register operand 'implicit %eflags'
|
||||||
- 'CMP32ri8 %eax, 10, implicit-def %eflags'
|
JG_1 %bb.2.exit, implicit-def %eflags
|
||||||
# CHECK: [[@LINE+1]]:26: expected an implicit register operand 'implicit %eflags'
|
|
||||||
- 'JG_1 %bb.2.exit, implicit-def %eflags'
|
bb.1.less:
|
||||||
- id: 1
|
%eax = MOV32r0 implicit-def %eflags
|
||||||
name: less
|
|
||||||
instructions:
|
bb.2.exit:
|
||||||
- '%eax = MOV32r0 implicit-def %eflags'
|
RETQ %eax
|
||||||
- id: 2
|
|
||||||
name: exit
|
|
||||||
instructions:
|
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -14,13 +14,11 @@ name: test
|
||||||
tracksRegLiveness: true
|
tracksRegLiveness: true
|
||||||
liveins:
|
liveins:
|
||||||
- { reg: '%rdi' }
|
- { reg: '%rdi' }
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
liveins: %rdi
|
||||||
liveins: [ '%rdi' ]
|
; CHECK: [[@LINE+1]]:55: expected 'from'
|
||||||
instructions:
|
%eax = MOV32rm killed %rdi, 1, _, 0, _ :: (load 4 %ir.a)
|
||||||
# CHECK: [[@LINE+1]]:60: expected 'from'
|
RETQ %eax
|
||||||
- '%eax = MOV32rm killed %rdi, 1, _, 0, _ :: (load 4 %ir.a)'
|
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
|
@ -17,18 +17,14 @@
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: test
|
name: test
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
successors: %bb.1.block
|
||||||
successors: [ '%bb.1.block' ]
|
; CHECK: [[@LINE+1]]:44: expected an IR function reference
|
||||||
instructions:
|
%rax = LEA64r %rip, 1, _, blockaddress(@addr, %ir-block.block), _
|
||||||
# CHECK: [[@LINE+1]]:49: expected an IR function reference
|
MOV64mr %rip, 1, _, @addr, _, killed %rax
|
||||||
- '%rax = LEA64r %rip, 1, _, blockaddress(@addr, %ir-block.block), _'
|
JMP64m %rip, 1, _, @addr, _
|
||||||
- 'MOV64mr %rip, 1, _, @addr, _, killed %rax'
|
|
||||||
- 'JMP64m %rip, 1, _, @addr, _'
|
bb.1.block (address-taken):
|
||||||
- id: 1
|
RETQ
|
||||||
name: block
|
|
||||||
addressTaken: true
|
|
||||||
instructions:
|
|
||||||
- RETQ
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -17,18 +17,14 @@
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: test
|
name: test
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
successors: %bb.1.block
|
||||||
successors: [ '%bb.1.block' ]
|
; CHECK: [[@LINE+1]]:44: expected a global value
|
||||||
instructions:
|
%rax = LEA64r %rip, 1, _, blockaddress(0, %ir-block.block), _
|
||||||
# CHECK: [[@LINE+1]]:49: expected a global value
|
MOV64mr %rip, 1, _, @addr, _, killed %rax
|
||||||
- '%rax = LEA64r %rip, 1, _, blockaddress(0, %ir-block.block), _'
|
JMP64m %rip, 1, _, @addr, _
|
||||||
- 'MOV64mr %rip, 1, _, @addr, _, killed %rax'
|
|
||||||
- 'JMP64m %rip, 1, _, @addr, _'
|
bb.1.block (address-taken):
|
||||||
- id: 1
|
RETQ
|
||||||
name: block
|
|
||||||
addressTaken: true
|
|
||||||
instructions:
|
|
||||||
- RETQ
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -14,13 +14,11 @@
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: inc
|
name: inc
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
; CHECK: [[@LINE+1]]:37: expected an integer literal after '+'
|
||||||
instructions:
|
%rax = MOV64rm %rip, 1, _, @G + , _
|
||||||
# CHECK: [[@LINE+1]]:42: expected an integer literal after '+'
|
%eax = MOV32rm %rax, 1, _, 0, _
|
||||||
- '%rax = MOV64rm %rip, 1, _, @G + , _'
|
%eax = INC32r %eax, implicit-def %eflags
|
||||||
- '%eax = MOV32rm %rax, 1, _, 0, _'
|
RETQ %eax
|
||||||
- '%eax = INC32r %eax, implicit-def %eflags'
|
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
# RUN: not llc -march=x86-64 -start-after branch-folder -stop-after branch-folder -o /dev/null %s 2>&1 | FileCheck %s
|
||||||
|
|
||||||
|
--- |
|
||||||
|
|
||||||
|
define i32 @foo(i32 %a) {
|
||||||
|
entry:
|
||||||
|
%0 = icmp sle i32 %a, 10
|
||||||
|
br i1 %0, label %less, label %exit
|
||||||
|
|
||||||
|
less:
|
||||||
|
ret i32 0
|
||||||
|
|
||||||
|
exit:
|
||||||
|
ret i32 %a
|
||||||
|
}
|
||||||
|
|
||||||
|
...
|
||||||
|
---
|
||||||
|
name: foo
|
||||||
|
body: |
|
||||||
|
bb.0.entry:
|
||||||
|
; CHECK: [[@LINE+1]]:29: expected an integer literal after '('
|
||||||
|
successors: %bb.1.less (_), %bb.2.exit(32)
|
||||||
|
liveins: %edi
|
||||||
|
|
||||||
|
CMP32ri8 %edi, 10, implicit-def %eflags
|
||||||
|
JG_1 %bb.2.exit, implicit killed %eflags
|
||||||
|
|
||||||
|
bb.1.less:
|
||||||
|
%eax = MOV32r0 implicit-def dead %eflags
|
||||||
|
RETQ killed %eax
|
||||||
|
|
||||||
|
bb.2.exit:
|
||||||
|
liveins: %edi
|
||||||
|
|
||||||
|
%eax = COPY killed %edi
|
||||||
|
RETQ killed %eax
|
||||||
|
...
|
|
@ -14,12 +14,10 @@ name: test
|
||||||
tracksRegLiveness: true
|
tracksRegLiveness: true
|
||||||
liveins:
|
liveins:
|
||||||
- { reg: '%rdi' }
|
- { reg: '%rdi' }
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
liveins: %rdi
|
||||||
liveins: [ '%rdi' ]
|
; CHECK: [[@LINE+1]]:48: expected 'load' or 'store' memory operation
|
||||||
instructions:
|
%eax = MOV32rm killed %rdi, 1, _, 0, _ :: (4 from %ir.a)
|
||||||
# CHECK: [[@LINE+1]]:53: expected 'load' or 'store' memory operation
|
RETQ %eax
|
||||||
- '%eax = MOV32rm killed %rdi, 1, _, 0, _ :: (4 from %ir.a)'
|
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -10,12 +10,10 @@
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: foo
|
name: foo
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
; CHECK: [[@LINE+1]]:20: expected a machine operand
|
||||||
instructions:
|
%eax = XOR32rr =
|
||||||
# CHECK: [[@LINE+1]]:24: expected a machine operand
|
RETQ %eax
|
||||||
- '%eax = XOR32rr ='
|
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
|
@ -48,14 +48,12 @@ frameInfo:
|
||||||
maxAlignment: 4
|
maxAlignment: 4
|
||||||
stack:
|
stack:
|
||||||
- { id: 0, name: x.addr, size: 4, alignment: 4 }
|
- { id: 0, name: x.addr, size: 4, alignment: 4 }
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
%0 = COPY %edi
|
||||||
instructions:
|
; CHECK: [[@LINE+1]]:46: expected a metadata node after 'debug-location'
|
||||||
- '%0 = COPY %edi'
|
DBG_VALUE _, 0, !12, !13, debug-location 14
|
||||||
# CHECK: [[@LINE+1]]:51: expected a metadata node after 'debug-location'
|
MOV32mr %stack.x.addr, 1, _, 0, _, %0
|
||||||
- 'DBG_VALUE _, 0, !12, !13, debug-location 14'
|
%eax = COPY %0
|
||||||
- 'MOV32mr %stack.x.addr, 1, _, 0, _, %0'
|
RETQ %eax
|
||||||
- '%eax = COPY %0'
|
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -48,14 +48,12 @@ frameInfo:
|
||||||
maxAlignment: 4
|
maxAlignment: 4
|
||||||
stack:
|
stack:
|
||||||
- { id: 0, name: x.addr, size: 4, alignment: 4 }
|
- { id: 0, name: x.addr, size: 4, alignment: 4 }
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
%0 = COPY %edi
|
||||||
instructions:
|
; CHECK: [[@LINE+1]]:28: expected metadata id after '!'
|
||||||
- '%0 = COPY %edi'
|
DBG_VALUE _, 0, !12, ! _
|
||||||
# CHECK: [[@LINE+1]]:33: expected metadata id after '!'
|
MOV32mr %stack.0.x.addr, 1, _, 0, _, %0
|
||||||
- 'DBG_VALUE _, 0, !12, ! _'
|
%eax = COPY %0
|
||||||
- 'MOV32mr %stack.0.x.addr, 1, _, 0, _, %0'
|
RETQ %eax
|
||||||
- '%eax = COPY %0'
|
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -17,14 +17,13 @@ registers:
|
||||||
# CHECK: [[@LINE+1]]:48: expected a named register
|
# CHECK: [[@LINE+1]]:48: expected a named register
|
||||||
- { id: 1, class: gr32, preferred-register: '%0' }
|
- { id: 1, class: gr32, preferred-register: '%0' }
|
||||||
- { id: 2, class: gr32, preferred-register: '%edi' }
|
- { id: 2, class: gr32, preferred-register: '%edi' }
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.body:
|
||||||
name: body
|
liveins: %edi, %esi
|
||||||
liveins: [ '%edi', '%esi' ]
|
|
||||||
instructions:
|
%1 = COPY %esi
|
||||||
- '%1 = COPY %esi'
|
%2 = COPY %edi
|
||||||
- '%2 = COPY %edi'
|
%2 = IMUL32rr %2, %1, implicit-def dead %eflags
|
||||||
- '%2 = IMUL32rr %2, %1, implicit-def dead %eflags'
|
%eax = COPY %2
|
||||||
- '%eax = COPY %2'
|
RETQ killed %eax
|
||||||
- 'RETQ killed %eax'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -32,13 +32,12 @@
|
||||||
---
|
---
|
||||||
name: compute
|
name: compute
|
||||||
tracksRegLiveness: true
|
tracksRegLiveness: true
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.body:
|
||||||
name: body
|
liveins: %edi
|
||||||
liveins: [ '%edi' ]
|
|
||||||
instructions:
|
%eax = COPY killed %edi
|
||||||
- '%eax = COPY killed %edi'
|
RETQ killed %eax
|
||||||
- 'RETQ killed %eax'
|
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: func
|
name: func
|
||||||
|
@ -53,39 +52,37 @@ fixedStack:
|
||||||
- { id: 0, type: spill-slot, offset: -16, size: 8, alignment: 16, callee-saved-register: '%0' }
|
- { id: 0, type: spill-slot, offset: -16, size: 8, alignment: 16, callee-saved-register: '%0' }
|
||||||
stack:
|
stack:
|
||||||
- { id: 0, name: b, offset: -20, size: 4, alignment: 4 }
|
- { id: 0, name: b, offset: -20, size: 4, alignment: 4 }
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
successors: %bb.1.check
|
||||||
successors: [ '%bb.1.check' ]
|
liveins: %edi, %rbx
|
||||||
liveins: [ '%edi', '%rbx' ]
|
|
||||||
instructions:
|
frame-setup PUSH64r killed %rbx, implicit-def %rsp, implicit %rsp
|
||||||
- 'frame-setup PUSH64r killed %rbx, implicit-def %rsp, implicit %rsp'
|
%rsp = frame-setup SUB64ri8 %rsp, 16, implicit-def dead %eflags
|
||||||
- '%rsp = frame-setup SUB64ri8 %rsp, 16, implicit-def dead %eflags'
|
%ebx = COPY %edi
|
||||||
- '%ebx = COPY %edi'
|
MOV32mr %rsp, 1, _, 12, _, %ebx
|
||||||
- 'MOV32mr %rsp, 1, _, 12, _, %ebx'
|
|
||||||
- id: 1
|
bb.1.check:
|
||||||
name: check
|
successors: %bb.2.loop, %bb.3.exit
|
||||||
successors: [ '%bb.2.loop', '%bb.3.exit' ]
|
liveins: %ebx
|
||||||
liveins: [ '%ebx' ]
|
|
||||||
instructions:
|
CMP32ri8 %ebx, 10, implicit-def %eflags
|
||||||
- 'CMP32ri8 %ebx, 10, implicit-def %eflags'
|
JG_1 %bb.3.exit, implicit killed %eflags
|
||||||
- 'JG_1 %bb.3.exit, implicit killed %eflags'
|
JMP_1 %bb.2.loop
|
||||||
- 'JMP_1 %bb.2.loop'
|
|
||||||
- id: 2
|
bb.2.loop:
|
||||||
name: loop
|
successors: %bb.1.check
|
||||||
successors: [ '%bb.1.check' ]
|
liveins: %ebx
|
||||||
liveins: [ '%ebx' ]
|
|
||||||
instructions:
|
%edi = MOV32rm %rsp, 1, _, 12, _
|
||||||
- '%edi = MOV32rm %rsp, 1, _, 12, _'
|
CALL64pcrel32 @compute, csr_64, implicit %rsp, implicit %edi, implicit-def %rsp, implicit-def %eax
|
||||||
- 'CALL64pcrel32 @compute, csr_64, implicit %rsp, implicit %edi, implicit-def %rsp, implicit-def %eax'
|
%eax = DEC32r killed %eax, implicit-def dead %eflags
|
||||||
- '%eax = DEC32r killed %eax, implicit-def dead %eflags'
|
MOV32mr %rsp, 1, _, 12, _, killed %eax
|
||||||
- 'MOV32mr %rsp, 1, _, 12, _, killed %eax'
|
JMP_1 %bb.1.check
|
||||||
- 'JMP_1 %bb.1.check'
|
|
||||||
- id: 3
|
bb.3.exit:
|
||||||
name: exit
|
%eax = MOV32r0 implicit-def dead %eflags
|
||||||
instructions:
|
%rsp = ADD64ri8 %rsp, 16, implicit-def dead %eflags
|
||||||
- '%eax = MOV32r0 implicit-def dead %eflags'
|
%rbx = POP64r implicit-def %rsp, implicit %rsp
|
||||||
- '%rsp = ADD64ri8 %rsp, 16, implicit-def dead %eflags'
|
RETQ %eax
|
||||||
- '%rbx = POP64r implicit-def %rsp, implicit %rsp'
|
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -17,12 +17,11 @@ registers:
|
||||||
liveins:
|
liveins:
|
||||||
# CHECK: [[@LINE+1]]:13: expected a named register
|
# CHECK: [[@LINE+1]]:13: expected a named register
|
||||||
- { reg: '%0' }
|
- { reg: '%0' }
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.body:
|
||||||
name: body
|
liveins: %edi
|
||||||
liveins: [ '%edi' ]
|
|
||||||
instructions:
|
%0 = COPY %edi
|
||||||
- '%0 = COPY %edi'
|
%eax = COPY %0
|
||||||
- '%eax = COPY %0'
|
RETQ %eax
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -10,12 +10,11 @@
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: test
|
name: test
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.body:
|
||||||
name: body
|
; CHECK: [[@LINE+1]]:14: expected a named register
|
||||||
# CHECK: [[@LINE+1]]:21: expected a named register
|
liveins: %0
|
||||||
liveins: [ '%0' ]
|
|
||||||
instructions:
|
%eax = COPY %edi
|
||||||
- '%eax = COPY %edi'
|
RETQ %eax
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -0,0 +1,41 @@
|
||||||
|
# RUN: not llc -march=x86-64 -start-after branch-folder -stop-after branch-folder -o /dev/null %s 2>&1 | FileCheck %s
|
||||||
|
|
||||||
|
--- |
|
||||||
|
|
||||||
|
define i32 @foo(i32 %a) {
|
||||||
|
entry:
|
||||||
|
%0 = icmp sle i32 %a, 10
|
||||||
|
br i1 %0, label %less, label %exit
|
||||||
|
|
||||||
|
less: ; preds = %entry
|
||||||
|
ret i32 0
|
||||||
|
|
||||||
|
exit: ; preds = %entry
|
||||||
|
ret i32 %a
|
||||||
|
}
|
||||||
|
|
||||||
|
...
|
||||||
|
---
|
||||||
|
name: foo
|
||||||
|
tracksRegLiveness: true
|
||||||
|
liveins:
|
||||||
|
- { reg: '%edi' }
|
||||||
|
body: |
|
||||||
|
bb.0.entry:
|
||||||
|
successors: %bb.1.less, %bb.2.exit
|
||||||
|
; CHECK: [[@LINE+1]]:19: expected line break at the end of a list
|
||||||
|
liveins: %edi 44
|
||||||
|
|
||||||
|
CMP32ri8 %edi, 10, implicit-def %eflags
|
||||||
|
JG_1 %bb.2.exit, implicit killed %eflags
|
||||||
|
|
||||||
|
bb.1.less:
|
||||||
|
%eax = MOV32r0 implicit-def dead %eflags
|
||||||
|
RETQ killed %eax
|
||||||
|
|
||||||
|
bb.2.exit:
|
||||||
|
liveins: %edi
|
||||||
|
|
||||||
|
%eax = COPY killed %edi
|
||||||
|
RETQ killed %eax
|
||||||
|
...
|
|
@ -18,20 +18,16 @@
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: foo
|
name: foo
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
%eax = MOV32rm %rdi, 1, _, 0, _
|
||||||
instructions:
|
CMP32ri8 %eax, 10, implicit-def %eflags
|
||||||
- '%eax = MOV32rm %rdi, 1, _, 0, _'
|
; CHECK: [[@LINE+1]]:14: expected a number after '%bb.'
|
||||||
- 'CMP32ri8 %eax, 10, implicit-def %eflags'
|
JG_1 %bb.nah, implicit %eflags
|
||||||
# CHECK: [[@LINE+1]]:18: expected a number after '%bb.'
|
|
||||||
- 'JG_1 %bb.nah, implicit %eflags'
|
bb.1.true:
|
||||||
- id: 1
|
%eax = MOV32r0 implicit-def %eflags
|
||||||
name: yes
|
|
||||||
instructions:
|
bb.2.nah:
|
||||||
- '%eax = MOV32r0 implicit-def %eflags'
|
RETQ %eax
|
||||||
- id: 2
|
|
||||||
name: nah
|
|
||||||
instructions:
|
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -16,14 +16,12 @@ frameInfo:
|
||||||
stackSize: 4040
|
stackSize: 4040
|
||||||
stack:
|
stack:
|
||||||
- { id: 0, name: tmp, offset: -4176, size: 4168, alignment: 4 }
|
- { id: 0, name: tmp, offset: -4176, size: 4168, alignment: 4 }
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
%rsp = SUB64ri32 %rsp, 4040, implicit-def dead %eflags
|
||||||
instructions:
|
; CHECK: [[@LINE+1]]:41: expected a cfi offset
|
||||||
- '%rsp = SUB64ri32 %rsp, 4040, implicit-def dead %eflags'
|
CFI_INSTRUCTION .cfi_def_cfa_offset _
|
||||||
# CHECK: [[@LINE+1]]:46: expected a cfi offset
|
%rsp = ADD64ri32 %rsp, 4040, implicit-def dead %eflags
|
||||||
- 'CFI_INSTRUCTION .cfi_def_cfa_offset _'
|
RETQ
|
||||||
- '%rsp = ADD64ri32 %rsp, 4040, implicit-def dead %eflags'
|
|
||||||
- 'RETQ'
|
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
|
@ -14,13 +14,11 @@ name: test
|
||||||
tracksRegLiveness: true
|
tracksRegLiveness: true
|
||||||
liveins:
|
liveins:
|
||||||
- { reg: '%rdi' }
|
- { reg: '%rdi' }
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
liveins: %rdi
|
||||||
liveins: [ '%rdi' ]
|
; CHECK: [[@LINE+1]]:60: expected a pointer IR value
|
||||||
instructions:
|
%eax = MOV32rm killed %rdi, 1, _, 0, _ :: (load 4 from %ir.b)
|
||||||
# CHECK: [[@LINE+1]]:65: expected a pointer IR value
|
RETQ %eax
|
||||||
- '%eax = MOV32rm killed %rdi, 1, _, 0, _ :: (load 4 from %ir.b)'
|
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
|
@ -16,17 +16,15 @@ name: memory_alignment
|
||||||
tracksRegLiveness: true
|
tracksRegLiveness: true
|
||||||
liveins:
|
liveins:
|
||||||
- { reg: '%rdi' }
|
- { reg: '%rdi' }
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
liveins: %rdi
|
||||||
liveins: [ '%rdi' ]
|
; CHECK: [[@LINE+1]]:71: expected an integer literal after 'align'
|
||||||
instructions:
|
%xmm0 = MOVAPSrm %rdi, 1, _, 0, _ :: (load 16 from %ir.vec, align -32)
|
||||||
# CHECK: [[@LINE+1]]:76: expected an integer literal after 'align'
|
%xmm1 = MOVAPSrm %rdi, 1, _, 16, _ :: (load 16 from %ir.vec + 16, align 32)
|
||||||
- '%xmm0 = MOVAPSrm %rdi, 1, _, 0, _ :: (load 16 from %ir.vec, align -32)'
|
%xmm2 = FsFLD0SS
|
||||||
- '%xmm1 = MOVAPSrm %rdi, 1, _, 16, _ :: (load 16 from %ir.vec + 16, align 32)'
|
%xmm1 = MOVSSrr killed %xmm1, killed %xmm2
|
||||||
- '%xmm2 = FsFLD0SS'
|
MOVAPSmr %rdi, 1, _, 0, _, killed %xmm0 :: (store 16 into %ir.vec, align 32)
|
||||||
- '%xmm1 = MOVSSrr killed %xmm1, killed %xmm2'
|
MOVAPSmr killed %rdi, 1, _, 16, _, killed %xmm1 :: (store 16 into %ir.vec + 16, align 32)
|
||||||
- 'MOVAPSmr %rdi, 1, _, 0, _, killed %xmm0 :: (store 16 into %ir.vec, align 32)'
|
RETQ
|
||||||
- 'MOVAPSmr killed %rdi, 1, _, 16, _, killed %xmm1 :: (store 16 into %ir.vec + 16, align 32)'
|
|
||||||
- RETQ
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -24,21 +24,19 @@ frameInfo:
|
||||||
hasCalls: true
|
hasCalls: true
|
||||||
fixedStack:
|
fixedStack:
|
||||||
- { id: 0, type: spill-slot, offset: -16, size: 8, alignment: 16 }
|
- { id: 0, type: spill-slot, offset: -16, size: 8, alignment: 16 }
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
PUSH64r killed %rbx, implicit-def %rsp, implicit %rsp
|
||||||
instructions:
|
CFI_INSTRUCTION .cfi_def_cfa_offset 16
|
||||||
- 'PUSH64r killed %rbx, implicit-def %rsp, implicit %rsp'
|
; CHECK: [[@LINE+1]]:33: expected a cfi register
|
||||||
- 'CFI_INSTRUCTION .cfi_def_cfa_offset 16'
|
CFI_INSTRUCTION .cfi_offset %0, -16
|
||||||
# CHECK: [[@LINE+1]]:38: expected a cfi register
|
%ebx = COPY %edi, implicit-def %rbx
|
||||||
- 'CFI_INSTRUCTION .cfi_offset %0, -16'
|
%ebx = ADD32rr %ebx, killed %esi, implicit-def dead %eflags
|
||||||
- '%ebx = COPY %edi, implicit-def %rbx'
|
%ebx = ADD32rr %ebx, killed %edx, implicit-def dead %eflags
|
||||||
- '%ebx = ADD32rr %ebx, killed %esi, implicit-def dead %eflags'
|
%ebx = ADD32rr %ebx, killed %ecx, implicit-def dead %eflags
|
||||||
- '%ebx = ADD32rr %ebx, killed %edx, implicit-def dead %eflags'
|
%edi = COPY %ebx
|
||||||
- '%ebx = ADD32rr %ebx, killed %ecx, implicit-def dead %eflags'
|
CALL64pcrel32 @foo, csr_64, implicit %rsp, implicit %edi, implicit-def %rsp
|
||||||
- '%edi = COPY %ebx'
|
%eax = LEA64_32r killed %rbx, 1, %rbx, 0, _
|
||||||
- 'CALL64pcrel32 @foo, csr_64, implicit %rsp, implicit %edi, implicit-def %rsp'
|
%rbx = POP64r implicit-def %rsp, implicit %rsp
|
||||||
- '%eax = LEA64_32r killed %rbx, 1, %rbx, 0, _'
|
RETQ %eax
|
||||||
- '%rbx = POP64r implicit-def %rsp, implicit %rsp'
|
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -12,11 +12,9 @@
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: foo
|
name: foo
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
; CHECK: [[@LINE+1]]:33: expected a register after register flags
|
||||||
instructions:
|
%eax = MOV32r0 implicit-def 2
|
||||||
# CHECK: [[@LINE+1]]:37: expected a register after register flags
|
RETQ %eax
|
||||||
- '%eax = MOV32r0 implicit-def 2'
|
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -14,13 +14,11 @@ name: test
|
||||||
tracksRegLiveness: true
|
tracksRegLiveness: true
|
||||||
liveins:
|
liveins:
|
||||||
- { reg: '%rdi' }
|
- { reg: '%rdi' }
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
liveins: %rdi
|
||||||
liveins: [ '%rdi' ]
|
; CHECK: [[@LINE+1]]:53: expected the size integer literal after memory operation
|
||||||
instructions:
|
%eax = MOV32rm killed %rdi, 1, _, 0, _ :: (load from %ir.a)
|
||||||
# CHECK: [[@LINE+1]]:58: expected the size integer literal after memory operation
|
RETQ %eax
|
||||||
- '%eax = MOV32rm killed %rdi, 1, _, 0, _ :: (load from %ir.a)'
|
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
|
@ -16,14 +16,12 @@ registers:
|
||||||
- { id: 0, class: gr32 }
|
- { id: 0, class: gr32 }
|
||||||
- { id: 1, class: gr8 }
|
- { id: 1, class: gr8 }
|
||||||
- { id: 2, class: gr8 }
|
- { id: 2, class: gr8 }
|
||||||
body:
|
body: |
|
||||||
- name: entry
|
bb.0.entry:
|
||||||
id: 0
|
%0 = COPY %edi
|
||||||
instructions:
|
; CHECK: [[@LINE+1]]:20: expected a subregister index after ':'
|
||||||
- '%0 = COPY %edi'
|
%1 = COPY %0 : 42
|
||||||
# CHECK: [[@LINE+1]]:25: expected a subregister index after ':'
|
%2 = AND8ri %1, 1, implicit-def %eflags
|
||||||
- '%1 = COPY %0 : 42'
|
%al = COPY %2
|
||||||
- '%2 = AND8ri %1, 1, implicit-def %eflags'
|
RETQ %al
|
||||||
- '%al = COPY %2'
|
|
||||||
- 'RETQ %al'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -14,13 +14,11 @@
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: inc
|
name: inc
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
; CHECK: [[@LINE+1]]:46: expected the name of the target flag
|
||||||
instructions:
|
%rax = MOV64rm %rip, 1, _, target-flags( ) @G, _
|
||||||
# CHECK: [[@LINE+1]]:51: expected the name of the target flag
|
%eax = MOV32rm killed %rax, 1, _, 0, _
|
||||||
- '%rax = MOV64rm %rip, 1, _, target-flags( ) @G, _'
|
%eax = INC32r killed %eax, implicit-def dead %eflags
|
||||||
- '%eax = MOV32rm killed %rax, 1, _, 0, _'
|
RETQ %eax
|
||||||
- '%eax = INC32r killed %eax, implicit-def dead %eflags'
|
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -14,13 +14,11 @@ name: test
|
||||||
tracksRegLiveness: true
|
tracksRegLiveness: true
|
||||||
liveins:
|
liveins:
|
||||||
- { reg: '%rdi' }
|
- { reg: '%rdi' }
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
liveins: %rdi
|
||||||
liveins: [ '%rdi' ]
|
; CHECK: [[@LINE+1]]:60: expected an IR value reference
|
||||||
instructions:
|
%eax = MOV32rm killed %rdi, 1, _, 0, _ :: (load 4 from a)
|
||||||
# CHECK: [[@LINE+1]]:65: expected an IR value reference
|
RETQ %eax
|
||||||
- '%eax = MOV32rm killed %rdi, 1, _, 0, _ :: (load 4 from a)'
|
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
|
@ -17,12 +17,11 @@ registers:
|
||||||
liveins:
|
liveins:
|
||||||
# CHECK: [[@LINE+1]]:34: expected a virtual register
|
# CHECK: [[@LINE+1]]:34: expected a virtual register
|
||||||
- { reg: '%edi', virtual-reg: '%edi' }
|
- { reg: '%edi', virtual-reg: '%edi' }
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.body:
|
||||||
name: body
|
liveins: %edi
|
||||||
liveins: [ '%edi' ]
|
|
||||||
instructions:
|
%0 = COPY %edi
|
||||||
- '%0 = COPY %edi'
|
%eax = COPY %0
|
||||||
- '%eax = COPY %0'
|
RETQ %eax
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -29,38 +29,36 @@
|
||||||
---
|
---
|
||||||
name: test
|
name: test
|
||||||
tracksRegLiveness: true
|
tracksRegLiveness: true
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
successors: %bb.1.entry, %bb.2.entry
|
||||||
successors: [ '%bb.1.entry', '%bb.2.entry' ]
|
liveins: %edi
|
||||||
liveins: [ '%edi' ]
|
|
||||||
instructions:
|
%rsp = SUB64ri32 %rsp, 520, implicit-def %eflags
|
||||||
- '%rsp = SUB64ri32 %rsp, 520, implicit-def %eflags'
|
%rcx = LOAD_STACK_GUARD
|
||||||
- '%rcx = LOAD_STACK_GUARD'
|
MOV64mr %rsp, 1, _, 512, _, %rcx
|
||||||
- 'MOV64mr %rsp, 1, _, 512, _, %rcx'
|
%rax = MOVSX64rr32 %edi
|
||||||
- '%rax = MOVSX64rr32 %edi'
|
%eax = MOV32rm %rsp, 4, %rax, 0, _
|
||||||
- '%eax = MOV32rm %rsp, 4, %rax, 0, _'
|
CMP64rm %rcx, %rsp, 1, _, 512, _, implicit-def %eflags
|
||||||
- 'CMP64rm %rcx, %rsp, 1, _, 512, _, implicit-def %eflags'
|
JNE_1 %bb.2.entry, implicit %eflags
|
||||||
- 'JNE_1 %bb.2.entry, implicit %eflags'
|
|
||||||
- id: 1
|
bb.1.entry:
|
||||||
name: entry
|
liveins: %eax
|
||||||
liveins: [ '%eax' ]
|
|
||||||
instructions:
|
%rsp = ADD64ri32 %rsp, 520, implicit-def %eflags
|
||||||
- '%rsp = ADD64ri32 %rsp, 520, implicit-def %eflags'
|
RETQ %eax
|
||||||
- 'RETQ %eax'
|
|
||||||
- id: 2
|
bb.2.entry:
|
||||||
name: entry
|
; CHECK: CALL64pcrel32 $__stack_chk_fail,
|
||||||
instructions:
|
; CHECK-NEXT: CALL64pcrel32 $__stack_chk_fail.09-_,
|
||||||
# CHECK: CALL64pcrel32 $__stack_chk_fail,
|
; CHECK-NEXT: CALL64pcrel32 $"__stack_chk_fail$",
|
||||||
# CHECK-NEXT: CALL64pcrel32 $__stack_chk_fail.09-_,
|
; CHECK-NEXT: CALL64pcrel32 $"$Quoted \09 External symbol \11 ",
|
||||||
# CHECK-NEXT: CALL64pcrel32 $"__stack_chk_fail$",
|
; CHECK-NEXT: CALL64pcrel32 $__stack_chk_fail + 2,
|
||||||
# CHECK-NEXT: CALL64pcrel32 $"$Quoted \09 External symbol \11 ",
|
; CHECK-NEXT: CALL64pcrel32 $" check stack - 20" - 20,
|
||||||
# CHECK-NEXT: CALL64pcrel32 $__stack_chk_fail + 2,
|
CALL64pcrel32 $__stack_chk_fail, csr_64, implicit %rsp, implicit-def %rsp
|
||||||
# CHECK-NEXT: CALL64pcrel32 $" check stack - 20" - 20,
|
CALL64pcrel32 $__stack_chk_fail.09-_, csr_64, implicit %rsp, implicit-def %rsp
|
||||||
- 'CALL64pcrel32 $__stack_chk_fail, csr_64, implicit %rsp, implicit-def %rsp'
|
CALL64pcrel32 $__stack_chk_fail$, csr_64, implicit %rsp, implicit-def %rsp
|
||||||
- 'CALL64pcrel32 $__stack_chk_fail.09-_, csr_64, implicit %rsp, implicit-def %rsp'
|
CALL64pcrel32 $"$Quoted \09 External symbol \11 ", csr_64, implicit %rsp, implicit-def %rsp
|
||||||
- 'CALL64pcrel32 $__stack_chk_fail$, csr_64, implicit %rsp, implicit-def %rsp'
|
CALL64pcrel32 $__stack_chk_fail + 2, csr_64, implicit %rsp, implicit-def %rsp
|
||||||
- 'CALL64pcrel32 $"$Quoted \09 External symbol \11 ", csr_64, implicit %rsp, implicit-def %rsp'
|
CALL64pcrel32 $" check stack - 20" - 20, csr_64, implicit %rsp, implicit-def %rsp
|
||||||
- 'CALL64pcrel32 $__stack_chk_fail + 2, csr_64, implicit %rsp, implicit-def %rsp'
|
|
||||||
- 'CALL64pcrel32 $" check stack - 20" - 20, csr_64, implicit %rsp, implicit-def %rsp'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -26,16 +26,14 @@ fixedStack:
|
||||||
- { id: 0, offset: 0, size: 4, alignment: 16, isImmutable: true }
|
- { id: 0, offset: 0, size: 4, alignment: 16, isImmutable: true }
|
||||||
stack:
|
stack:
|
||||||
- { id: 0, name: b, offset: -8, size: 4, alignment: 4 }
|
- { id: 0, name: b, offset: -8, size: 4, alignment: 4 }
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
frame-setup PUSH32r undef %eax, implicit-def %esp, implicit %esp
|
||||||
instructions:
|
CFI_INSTRUCTION .cfi_def_cfa_offset 8
|
||||||
- 'frame-setup PUSH32r undef %eax, implicit-def %esp, implicit %esp'
|
; CHECK: name: test
|
||||||
- CFI_INSTRUCTION .cfi_def_cfa_offset 8
|
; CHECK: %eax = MOV32rm %esp, 1, _, 8, _ :: (load 4 from %fixed-stack.0, align 16)
|
||||||
# CHECK: name: test
|
%eax = MOV32rm %esp, 1, _, 8, _ :: (load 4 from %fixed-stack.0, align 16)
|
||||||
# CHECK: %eax = MOV32rm %esp, 1, _, 8, _ :: (load 4 from %fixed-stack.0, align 16)
|
MOV32mr %esp, 1, _, 0, _, %eax :: (store 4 into %ir.b)
|
||||||
- '%eax = MOV32rm %esp, 1, _, 8, _ :: (load 4 from %fixed-stack.0, align 16)'
|
%edx = POP32r implicit-def %esp, implicit %esp
|
||||||
- 'MOV32mr %esp, 1, _, 0, _, %eax :: (store 4 into %ir.b)'
|
RETL %eax
|
||||||
- '%edx = POP32r implicit-def %esp, implicit %esp'
|
|
||||||
- 'RETL %eax'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -20,11 +20,9 @@ fixedStack:
|
||||||
- { id: 0, offset: 4, size: 4, alignment: 4, isImmutable: true, isAliased: false }
|
- { id: 0, offset: 4, size: 4, alignment: 4, isImmutable: true, isAliased: false }
|
||||||
# CHECK: [[@LINE+1]]:11: redefinition of fixed stack object '%fixed-stack.0'
|
# CHECK: [[@LINE+1]]:11: redefinition of fixed stack object '%fixed-stack.0'
|
||||||
- { id: 0, offset: 0, size: 4, alignment: 16, isImmutable: true, isAliased: false }
|
- { id: 0, offset: 0, size: 4, alignment: 16, isImmutable: true, isAliased: false }
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
%eax = MOV32rm %esp, 1, _, 4, _
|
||||||
instructions:
|
%eax = ADD32rm killed %eax, %esp, 1, _, 8, _, implicit-def dead %eflags
|
||||||
- '%eax = MOV32rm %esp, 1, _, 4, _'
|
RETL %eax
|
||||||
- '%eax = ADD32rm killed %eax, %esp, 1, _, 8, _, implicit-def dead %eflags'
|
|
||||||
- 'RETL %eax'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -25,11 +25,9 @@ fixedStack:
|
||||||
- { id: 0, offset: 0, size: 4, alignment: 4, isImmutable: true, isAliased: false }
|
- { id: 0, offset: 0, size: 4, alignment: 4, isImmutable: true, isAliased: false }
|
||||||
stack:
|
stack:
|
||||||
- { id: 0, offset: -8, size: 4, alignment: 4 }
|
- { id: 0, offset: -8, size: 4, alignment: 4 }
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
%eax = MOV32rm %esp, 1, _, 8, _
|
||||||
instructions:
|
MOV32mr %esp, 1, _, 0, _, %eax
|
||||||
- '%eax = MOV32rm %esp, 1, _, 8, _'
|
RETL %eax
|
||||||
- 'MOV32mr %esp, 1, _, 0, _, %eax'
|
|
||||||
- 'RETL %eax'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -40,33 +40,34 @@ frameInfo:
|
||||||
restorePoint: '%bb.2.true'
|
restorePoint: '%bb.2.true'
|
||||||
stack:
|
stack:
|
||||||
- { id: 0, name: tmp, offset: 0, size: 4, alignment: 4 }
|
- { id: 0, name: tmp, offset: 0, size: 4, alignment: 4 }
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0:
|
||||||
successors: [ '%bb.2.true', '%bb.1' ]
|
successors: %bb.2.true, %bb.1
|
||||||
liveins: [ '%edi', '%esi' ]
|
liveins: %edi, %esi
|
||||||
instructions:
|
|
||||||
- '%eax = COPY %edi'
|
%eax = COPY %edi
|
||||||
- 'CMP32rr %eax, killed %esi, implicit-def %eflags'
|
CMP32rr %eax, killed %esi, implicit-def %eflags
|
||||||
- 'JL_1 %bb.2.true, implicit killed %eflags'
|
JL_1 %bb.2.true, implicit killed %eflags
|
||||||
- id: 1
|
|
||||||
successors: [ '%bb.3.false' ]
|
bb.1:
|
||||||
liveins: [ '%eax' ]
|
successors: %bb.3.false
|
||||||
instructions:
|
liveins: %eax
|
||||||
- 'JMP_1 %bb.3.false'
|
|
||||||
- id: 2
|
JMP_1 %bb.3.false
|
||||||
name: 'true'
|
|
||||||
successors: [ '%bb.3.false' ]
|
bb.2.true:
|
||||||
liveins: [ '%eax' ]
|
successors: %bb.3.false
|
||||||
instructions:
|
liveins: %eax
|
||||||
- 'MOV32mr %stack.0.tmp, 1, _, 0, _, killed %eax'
|
|
||||||
- 'ADJCALLSTACKDOWN64 0, 0, implicit-def %rsp, implicit-def dead %eflags, implicit %rsp'
|
MOV32mr %stack.0.tmp, 1, _, 0, _, killed %eax
|
||||||
- '%rsi = LEA64r %stack.0.tmp, 1, _, 0, _'
|
ADJCALLSTACKDOWN64 0, 0, implicit-def %rsp, implicit-def dead %eflags, implicit %rsp
|
||||||
- '%edi = MOV32r0 implicit-def dead %eflags'
|
%rsi = LEA64r %stack.0.tmp, 1, _, 0, _
|
||||||
- 'CALL64pcrel32 @doSomething, csr_64, implicit %rsp, implicit %edi, implicit %rsi, implicit-def %rsp, implicit-def %eax'
|
%edi = MOV32r0 implicit-def dead %eflags
|
||||||
- 'ADJCALLSTACKUP64 0, 0, implicit-def %rsp, implicit-def dead %eflags, implicit %rsp'
|
CALL64pcrel32 @doSomething, csr_64, implicit %rsp, implicit %edi, implicit %rsi, implicit-def %rsp, implicit-def %eax
|
||||||
- id: 3
|
ADJCALLSTACKUP64 0, 0, implicit-def %rsp, implicit-def dead %eflags, implicit %rsp
|
||||||
name: 'false'
|
|
||||||
liveins: [ '%eax' ]
|
bb.3.false:
|
||||||
instructions:
|
liveins: %eax
|
||||||
- 'RETQ %eax'
|
|
||||||
|
RETQ %eax
|
||||||
...
|
...
|
||||||
|
|
|
@ -18,22 +18,18 @@
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: compute
|
name: compute
|
||||||
body:
|
body: |
|
||||||
- name: body
|
bb.0.body:
|
||||||
id: 0
|
%eax = IMUL32rri8 %edi, 11, implicit-def %eflags
|
||||||
instructions:
|
RETQ %eax
|
||||||
- '%eax = IMUL32rri8 %edi, 11, implicit-def %eflags'
|
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: foo
|
name: foo
|
||||||
body:
|
body: |
|
||||||
- name: entry
|
bb.0.entry:
|
||||||
id: 0
|
; CHECK: frame-setup PUSH64r %rax
|
||||||
instructions:
|
frame-setup PUSH64r %rax, implicit-def %rsp, implicit %rsp
|
||||||
# CHECK: frame-setup PUSH64r %rax
|
CALL64pcrel32 @compute, csr_64, implicit %rsp, implicit %edi, implicit-def %rsp, implicit-def %eax
|
||||||
- 'frame-setup PUSH64r %rax, implicit-def %rsp, implicit %rsp'
|
%rdx = POP64r implicit-def %rsp, implicit %rsp
|
||||||
- 'CALL64pcrel32 @compute, csr_64, implicit %rsp, implicit %edi, implicit-def %rsp, implicit-def %eax'
|
RETQ %eax
|
||||||
- '%rdx = POP64r implicit-def %rsp, implicit %rsp'
|
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -25,14 +25,13 @@ registers:
|
||||||
liveins:
|
liveins:
|
||||||
- { reg: '%edi', virtual-reg: '%0' }
|
- { reg: '%edi', virtual-reg: '%0' }
|
||||||
- { reg: '%esi', virtual-reg: '%1' }
|
- { reg: '%esi', virtual-reg: '%1' }
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.body:
|
||||||
name: body
|
liveins: %edi, %esi
|
||||||
liveins: [ '%edi', '%esi' ]
|
|
||||||
instructions:
|
%1 = COPY %esi
|
||||||
- '%1 = COPY %esi'
|
%0 = COPY %edi
|
||||||
- '%0 = COPY %edi'
|
%2 = ADD32rr %0, %1, implicit-def dead %eflags
|
||||||
- '%2 = ADD32rr %0, %1, implicit-def dead %eflags'
|
%eax = COPY %2
|
||||||
- '%eax = COPY %2'
|
RETQ %eax
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -62,91 +62,79 @@
|
||||||
---
|
---
|
||||||
# CHECK: name: inc
|
# CHECK: name: inc
|
||||||
name: inc
|
name: inc
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
; CHECK: %rax = MOV64rm %rip, 1, _, @G, _
|
||||||
instructions:
|
%rax = MOV64rm %rip, 1, _, @G, _
|
||||||
# CHECK: - '%rax = MOV64rm %rip, 1, _, @G, _'
|
%eax = MOV32rm %rax, 1, _, 0, _
|
||||||
- '%rax = MOV64rm %rip, 1, _, @G, _'
|
%eax = INC32r %eax, implicit-def %eflags
|
||||||
- '%eax = MOV32rm %rax, 1, _, 0, _'
|
RETQ %eax
|
||||||
- '%eax = INC32r %eax, implicit-def %eflags'
|
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
# CHECK: name: inc2
|
# CHECK: name: inc2
|
||||||
name: inc2
|
name: inc2
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
; CHECK: %rax = MOV64rm %rip, 1, _, @0, _
|
||||||
instructions:
|
%rax = MOV64rm %rip, 1, _, @0, _
|
||||||
# CHECK: - '%rax = MOV64rm %rip, 1, _, @0, _'
|
%eax = MOV32rm %rax, 1, _, 0, _
|
||||||
- '%rax = MOV64rm %rip, 1, _, @0, _'
|
%eax = INC32r %eax, implicit-def %eflags
|
||||||
- '%eax = MOV32rm %rax, 1, _, 0, _'
|
RETQ %eax
|
||||||
- '%eax = INC32r %eax, implicit-def %eflags'
|
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: test
|
name: test
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
; CHECK: , @".$0",
|
||||||
instructions:
|
; CHECK: , @-_-,
|
||||||
# CHECK: , @".$0",
|
; CHECK: , @_-_a,
|
||||||
# CHECK: , @-_-,
|
; CHECK: , @"$.-B",
|
||||||
# CHECK: , @_-_a,
|
%rax = MOV64rm %rip, 1, _, @.$0, _
|
||||||
# CHECK: , @"$.-B",
|
%eax = MOV32rm killed %rax, 1, _, 0, _
|
||||||
- '%rax = MOV64rm %rip, 1, _, @.$0, _'
|
%rcx = MOV64rm %rip, 1, _, @-_-, _
|
||||||
- '%eax = MOV32rm killed %rax, 1, _, 0, _'
|
MOV32mr killed %rcx, 1, _, 0, _, killed %eax
|
||||||
- '%rcx = MOV64rm %rip, 1, _, @-_-, _'
|
%rax = MOV64rm %rip, 1, _, @_-_a, _
|
||||||
- 'MOV32mr killed %rcx, 1, _, 0, _, killed %eax'
|
%eax = MOV32rm killed %rax, 1, _, 0, _
|
||||||
- '%rax = MOV64rm %rip, 1, _, @_-_a, _'
|
%rcx = MOV64rm %rip, 1, _, @$.-B, _
|
||||||
- '%eax = MOV32rm killed %rax, 1, _, 0, _'
|
MOV32mr killed %rcx, 1, _, 0, _, %eax
|
||||||
- '%rcx = MOV64rm %rip, 1, _, @$.-B, _'
|
RETQ %eax
|
||||||
- 'MOV32mr killed %rcx, 1, _, 0, _, %eax'
|
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: test2
|
name: test2
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
; CHECK: , @"\01Hello@$%09 \5C World,",
|
||||||
instructions:
|
%rax = MOV64rm %rip, 1, _, @"\01Hello@$%09 \\ World,", _
|
||||||
# CHECK: , @"\01Hello@$%09 \5C World,",
|
%eax = MOV32rm killed %rax, 1, _, 0, _
|
||||||
- '%rax = MOV64rm %rip, 1, _, @"\01Hello@$%09 \\ World,", _'
|
RETQ %eax
|
||||||
- '%eax = MOV32rm killed %rax, 1, _, 0, _'
|
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
# CHECK: name: test3
|
# CHECK: name: test3
|
||||||
name: test3
|
name: test3
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
; CHECK: , @".$0",
|
||||||
instructions:
|
; CHECK: , @-_-,
|
||||||
# CHECK: , @".$0",
|
; CHECK: , @_-_a + 4,
|
||||||
# CHECK: , @-_-,
|
; CHECK: , @"$.-B" - 8,
|
||||||
# CHECK: , @_-_a + 4,
|
%rax = MOV64rm %rip, 1, _, @.$0 + 0, _
|
||||||
# CHECK: , @"$.-B" - 8,
|
%eax = MOV32rm killed %rax, 1, _, 0, _
|
||||||
- '%rax = MOV64rm %rip, 1, _, @.$0 + 0, _'
|
%rcx = MOV64rm %rip, 1, _, @-_- - 0, _
|
||||||
- '%eax = MOV32rm killed %rax, 1, _, 0, _'
|
MOV32mr killed %rcx, 1, _, 0, _, killed %eax
|
||||||
- '%rcx = MOV64rm %rip, 1, _, @-_- - 0, _'
|
%rax = MOV64rm %rip, 1, _, @_-_a + 4, _
|
||||||
- 'MOV32mr killed %rcx, 1, _, 0, _, killed %eax'
|
%eax = MOV32rm killed %rax, 1, _, 0, _
|
||||||
- '%rax = MOV64rm %rip, 1, _, @_-_a + 4, _'
|
%rcx = MOV64rm %rip, 1, _, @$.-B - 8, _
|
||||||
- '%eax = MOV32rm killed %rax, 1, _, 0, _'
|
MOV32mr killed %rcx, 1, _, 0, _, %eax
|
||||||
- '%rcx = MOV64rm %rip, 1, _, @$.-B - 8, _'
|
RETQ %eax
|
||||||
- 'MOV32mr killed %rcx, 1, _, 0, _, %eax'
|
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
# CHECK: name: tf
|
# CHECK: name: tf
|
||||||
name: tf
|
name: tf
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
; CHECK: %rax = MOV64rm %rip, 1, _, target-flags(x86-gotpcrel) @G, _
|
||||||
instructions:
|
%rax = MOV64rm %rip, 1, _, target-flags(x86-gotpcrel) @G, _
|
||||||
# CHECK: %rax = MOV64rm %rip, 1, _, target-flags(x86-gotpcrel) @G, _
|
%eax = MOV32rm %rax, 1, _, 0, _
|
||||||
- '%rax = MOV64rm %rip, 1, _, target-flags(x86-gotpcrel) @G, _'
|
%eax = INC32r %eax, implicit-def %eflags
|
||||||
- '%eax = MOV32rm %rax, 1, _, 0, _'
|
RETQ %eax
|
||||||
- '%eax = INC32r %eax, implicit-def %eflags'
|
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -17,24 +17,20 @@
|
||||||
---
|
---
|
||||||
# CHECK: name: foo
|
# CHECK: name: foo
|
||||||
name: foo
|
name: foo
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
; CHECK: %eax = MOV32ri 42
|
||||||
instructions:
|
; CHECK-NEXT: RETQ %eax
|
||||||
# CHECK: - '%eax = MOV32ri 42'
|
%eax = MOV32ri 42
|
||||||
# CHECK-NEXT: - 'RETQ %eax'
|
RETQ %eax
|
||||||
- '%eax = MOV32ri 42'
|
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
# CHECK: name: bar
|
# CHECK: name: bar
|
||||||
name: bar
|
name: bar
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
; CHECK: %eax = MOV32ri -11
|
||||||
instructions:
|
; CHECK-NEXT: RETQ %eax
|
||||||
# CHECK: - '%eax = MOV32ri -11'
|
%eax = MOV32ri -11
|
||||||
# CHECK-NEXT: - 'RETQ %eax'
|
RETQ %eax
|
||||||
- '%eax = MOV32ri -11'
|
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -19,24 +19,20 @@
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: foo
|
name: foo
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
successors: %bb.1.less, %bb.2.exit
|
||||||
successors: [ '%bb.1.less', '%bb.2.exit' ]
|
; CHECK: CMP32ri8 %edi, 10, implicit-def %eflags
|
||||||
instructions:
|
; CHECK-NEXT: JG_1 %bb.2.exit, implicit %eflags
|
||||||
# CHECK: - 'CMP32ri8 %edi, 10, implicit-def %eflags'
|
CMP32ri8 %edi, 10, implicit-def %eflags
|
||||||
# CHECK-NEXT: - 'JG_1 %bb.2.exit, implicit %eflags'
|
JG_1 %bb.2.exit, implicit %eflags
|
||||||
- 'CMP32ri8 %edi, 10, implicit-def %eflags'
|
|
||||||
- 'JG_1 %bb.2.exit, implicit %eflags'
|
bb.1.less:
|
||||||
- id: 1
|
; CHECK: %eax = MOV32r0 implicit-def %eflags
|
||||||
name: less
|
%eax = MOV32r0 implicit-def %eflags
|
||||||
instructions:
|
RETQ %eax
|
||||||
# CHECK: - '%eax = MOV32r0 implicit-def %eflags'
|
|
||||||
- '%eax = MOV32r0 implicit-def %eflags'
|
bb.2.exit:
|
||||||
- 'RETQ %eax'
|
%eax = COPY %edi
|
||||||
- id: 2
|
RETQ %eax
|
||||||
name: exit
|
|
||||||
instructions:
|
|
||||||
- '%eax = COPY %edi'
|
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -59,19 +59,17 @@ frameInfo:
|
||||||
maxAlignment: 4
|
maxAlignment: 4
|
||||||
stack:
|
stack:
|
||||||
- { id: 0, name: x.addr, size: 4, alignment: 4 }
|
- { id: 0, name: x.addr, size: 4, alignment: 4 }
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
liveins: %edi
|
||||||
liveins: [ '%edi' ]
|
; CHECK: DBG_VALUE debug-use _, 0, !12, !13, debug-location !14
|
||||||
instructions:
|
; CHECK: %eax = COPY %0, debug-location !15
|
||||||
# CHECK: DBG_VALUE debug-use _, 0, !12, !13, debug-location !14
|
; CHECK: RETQ %eax, debug-location !15
|
||||||
# CHECK: %eax = COPY %0, debug-location !15
|
%0 = COPY %edi
|
||||||
# CHECK: RETQ %eax, debug-location !15
|
DBG_VALUE debug-use _, 0, !12, !13, debug-location !14
|
||||||
- '%0 = COPY %edi'
|
MOV32mr %stack.0.x.addr, 1, _, 0, _, %0
|
||||||
- 'DBG_VALUE debug-use _, 0, !12, !13, debug-location !14'
|
%eax = COPY %0, debug-location !15
|
||||||
- 'MOV32mr %stack.0.x.addr, 1, _, 0, _, %0'
|
RETQ %eax, debug-location !15
|
||||||
- '%eax = COPY %0, debug-location !15'
|
|
||||||
- 'RETQ %eax, debug-location !15'
|
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: test_typed_immediates
|
name: test_typed_immediates
|
||||||
|
@ -83,19 +81,18 @@ frameInfo:
|
||||||
maxAlignment: 4
|
maxAlignment: 4
|
||||||
stack:
|
stack:
|
||||||
- { id: 0, name: x.addr, size: 4, alignment: 4 }
|
- { id: 0, name: x.addr, size: 4, alignment: 4 }
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
liveins: %edi
|
||||||
liveins: [ '%edi' ]
|
|
||||||
instructions:
|
%0 = COPY %edi
|
||||||
- '%0 = COPY %edi'
|
; CHECK: DBG_VALUE _, i32 0, !12, !13
|
||||||
# CHECK: DBG_VALUE _, i32 0, !12, !13
|
; CHECK-NEXT: DBG_VALUE _, i64 -22, !12, !13
|
||||||
# CHECK-NEXT: DBG_VALUE _, i64 -22, !12, !13
|
; CHECK-NEXT: DBG_VALUE _, i128 123492148938512984928424384934328985928, !12, !13
|
||||||
# CHECK-NEXT: DBG_VALUE _, i128 123492148938512984928424384934328985928, !12, !13
|
DBG_VALUE _, i32 0, !12, !13
|
||||||
- 'DBG_VALUE _, i32 0, !12, !13'
|
DBG_VALUE _, i64 -22, !12, !13
|
||||||
- 'DBG_VALUE _, i64 -22, !12, !13'
|
DBG_VALUE _, i128 123492148938512984928424384934328985928, !12, !13
|
||||||
- 'DBG_VALUE _, i128 123492148938512984928424384934328985928, !12, !13'
|
MOV32mr %stack.0.x.addr, 1, _, 0, _, %0
|
||||||
- 'MOV32mr %stack.0.x.addr, 1, _, 0, _, %0'
|
%eax = COPY %0
|
||||||
- '%eax = COPY %0'
|
RETQ %eax
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -16,12 +16,10 @@ name: test
|
||||||
constants:
|
constants:
|
||||||
- id: 0
|
- id: 0
|
||||||
value: 'double 3.250000e+00'
|
value: 'double 3.250000e+00'
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
; CHECK: [[@LINE+1]]:47: use of undefined constant '%const.10'
|
||||||
instructions:
|
%xmm0 = ADDSDrm killed %xmm0, %rip, 1, _, %const.10, _
|
||||||
# CHECK: [[@LINE+1]]:52: use of undefined constant '%const.10'
|
RETQ %xmm0
|
||||||
- '%xmm0 = ADDSDrm killed %xmm0, %rip, 1, _, %const.10, _'
|
|
||||||
- 'RETQ %xmm0'
|
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
|
@ -14,13 +14,11 @@
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: inc
|
name: inc
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
; CHECK: [[@LINE+1]]:45: use of undefined target flag 'x86-test'
|
||||||
instructions:
|
%rax = MOV64rm %rip, 1, _, target-flags(x86-test) @G, _
|
||||||
# CHECK: [[@LINE+1]]:50: use of undefined target flag 'x86-test'
|
%eax = MOV32rm killed %rax, 1, _, 0, _
|
||||||
- '%rax = MOV64rm %rip, 1, _, target-flags(x86-test) @G, _'
|
%eax = INC32r killed %eax, implicit-def dead %eflags
|
||||||
- '%eax = MOV32rm killed %rax, 1, _, 0, _'
|
RETQ %eax
|
||||||
- '%eax = INC32r killed %eax, implicit-def dead %eflags'
|
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -68,48 +68,41 @@ jumpTable:
|
||||||
entries:
|
entries:
|
||||||
- id: 0
|
- id: 0
|
||||||
blocks: [ '%bb.3.lbl1', '%bb.4.lbl2', '%bb.5.lbl3', '%bb.6.lbl4' ]
|
blocks: [ '%bb.3.lbl1', '%bb.4.lbl2', '%bb.5.lbl3', '%bb.6.lbl4' ]
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
successors: %bb.2.def, %bb.1.entry
|
||||||
successors: [ '%bb.2.def', '%bb.1.entry' ]
|
|
||||||
instructions:
|
%eax = MOV32rr %edi, implicit-def %rax
|
||||||
- '%eax = MOV32rr %edi, implicit-def %rax'
|
CMP32ri8 %edi, 3, implicit-def %eflags
|
||||||
- 'CMP32ri8 %edi, 3, implicit-def %eflags'
|
JA_1 %bb.2.def, implicit %eflags
|
||||||
- 'JA_1 %bb.2.def, implicit %eflags'
|
|
||||||
- id: 1
|
bb.1.entry:
|
||||||
name: entry
|
successors: %bb.3.lbl1, %bb.4.lbl2, %bb.5.lbl3, %bb.6.lbl4
|
||||||
successors: [ '%bb.3.lbl1', '%bb.4.lbl2', '%bb.5.lbl3', '%bb.6.lbl4' ]
|
; CHECK: %rcx = LEA64r %rip, 1, _, %jump-table.0, _
|
||||||
instructions:
|
%rcx = LEA64r %rip, 1, _, %jump-table.0, _
|
||||||
# CHECK: %rcx = LEA64r %rip, 1, _, %jump-table.0, _
|
%rax = MOVSX64rm32 %rcx, 4, %rax, 0, _
|
||||||
- '%rcx = LEA64r %rip, 1, _, %jump-table.0, _'
|
%rax = ADD64rr %rax, %rcx, implicit-def %eflags
|
||||||
- '%rax = MOVSX64rm32 %rcx, 4, %rax, 0, _'
|
JMP64r %rax
|
||||||
- '%rax = ADD64rr %rax, %rcx, implicit-def %eflags'
|
|
||||||
- 'JMP64r %rax'
|
bb.2.def:
|
||||||
- id: 2
|
%eax = MOV32r0 implicit-def %eflags
|
||||||
name: def
|
RETQ %eax
|
||||||
instructions:
|
|
||||||
- '%eax = MOV32r0 implicit-def %eflags'
|
bb.3.lbl1:
|
||||||
- 'RETQ %eax'
|
%eax = MOV32ri 1
|
||||||
- id: 3
|
RETQ %eax
|
||||||
name: lbl1
|
|
||||||
instructions:
|
bb.4.lbl2:
|
||||||
- '%eax = MOV32ri 1'
|
%eax = MOV32ri 2
|
||||||
- 'RETQ %eax'
|
RETQ %eax
|
||||||
- id: 4
|
|
||||||
name: lbl2
|
bb.5.lbl3:
|
||||||
instructions:
|
%eax = MOV32ri 4
|
||||||
- '%eax = MOV32ri 2'
|
RETQ %eax
|
||||||
- 'RETQ %eax'
|
|
||||||
- id: 5
|
bb.6.lbl4:
|
||||||
name: lbl3
|
%eax = MOV32ri 8
|
||||||
instructions:
|
RETQ %eax
|
||||||
- '%eax = MOV32ri 4'
|
|
||||||
- 'RETQ %eax'
|
|
||||||
- id: 6
|
|
||||||
name: lbl4
|
|
||||||
instructions:
|
|
||||||
- '%eax = MOV32ri 8'
|
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: test_jumptable2
|
name: test_jumptable2
|
||||||
|
@ -118,47 +111,40 @@ jumpTable:
|
||||||
entries:
|
entries:
|
||||||
- id: 1
|
- id: 1
|
||||||
blocks: [ '%bb.3.lbl1', '%bb.4.lbl2', '%bb.5.lbl3', '%bb.6.lbl4' ]
|
blocks: [ '%bb.3.lbl1', '%bb.4.lbl2', '%bb.5.lbl3', '%bb.6.lbl4' ]
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
successors: %bb.2.def, %bb.1.entry
|
||||||
successors: [ '%bb.2.def', '%bb.1.entry' ]
|
|
||||||
instructions:
|
%eax = MOV32rr %edi, implicit-def %rax
|
||||||
- '%eax = MOV32rr %edi, implicit-def %rax'
|
CMP32ri8 %edi, 3, implicit-def %eflags
|
||||||
- 'CMP32ri8 %edi, 3, implicit-def %eflags'
|
JA_1 %bb.2.def, implicit %eflags
|
||||||
- 'JA_1 %bb.2.def, implicit %eflags'
|
|
||||||
- id: 1
|
bb.1.entry:
|
||||||
name: entry
|
successors: %bb.3.lbl1, %bb.4.lbl2, %bb.5.lbl3, %bb.6.lbl4
|
||||||
successors: [ '%bb.3.lbl1', '%bb.4.lbl2', '%bb.5.lbl3', '%bb.6.lbl4' ]
|
; Verify that the printer will use an id of 0 for this jump table:
|
||||||
instructions:
|
; CHECK: %rcx = LEA64r %rip, 1, _, %jump-table.0, _
|
||||||
# Verify that the printer will use an id of 0 for this jump table:
|
%rcx = LEA64r %rip, 1, _, %jump-table.1, _
|
||||||
# CHECK: %rcx = LEA64r %rip, 1, _, %jump-table.0, _
|
%rax = MOVSX64rm32 %rcx, 4, %rax, 0, _
|
||||||
- '%rcx = LEA64r %rip, 1, _, %jump-table.1, _'
|
%rax = ADD64rr %rax, %rcx, implicit-def %eflags
|
||||||
- '%rax = MOVSX64rm32 %rcx, 4, %rax, 0, _'
|
JMP64r %rax
|
||||||
- '%rax = ADD64rr %rax, %rcx, implicit-def %eflags'
|
|
||||||
- 'JMP64r %rax'
|
bb.2.def:
|
||||||
- id: 2
|
%eax = MOV32r0 implicit-def %eflags
|
||||||
name: def
|
RETQ %eax
|
||||||
instructions:
|
|
||||||
- '%eax = MOV32r0 implicit-def %eflags'
|
bb.3.lbl1:
|
||||||
- 'RETQ %eax'
|
%eax = MOV32ri 1
|
||||||
- id: 3
|
RETQ %eax
|
||||||
name: lbl1
|
|
||||||
instructions:
|
bb.4.lbl2:
|
||||||
- '%eax = MOV32ri 1'
|
%eax = MOV32ri 2
|
||||||
- 'RETQ %eax'
|
RETQ %eax
|
||||||
- id: 4
|
|
||||||
name: lbl2
|
bb.5.lbl3:
|
||||||
instructions:
|
%eax = MOV32ri 4
|
||||||
- '%eax = MOV32ri 2'
|
RETQ %eax
|
||||||
- 'RETQ %eax'
|
|
||||||
- id: 5
|
bb.6.lbl4:
|
||||||
name: lbl3
|
%eax = MOV32ri 8
|
||||||
instructions:
|
RETQ %eax
|
||||||
- '%eax = MOV32ri 4'
|
|
||||||
- 'RETQ %eax'
|
|
||||||
- id: 6
|
|
||||||
name: lbl4
|
|
||||||
instructions:
|
|
||||||
- '%eax = MOV32ri 8'
|
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -38,45 +38,39 @@ jumpTable:
|
||||||
# CHECK: [[@LINE+1]]:18: redefinition of jump table entry '%jump-table.0'
|
# CHECK: [[@LINE+1]]:18: redefinition of jump table entry '%jump-table.0'
|
||||||
- id: 0
|
- id: 0
|
||||||
blocks: [ '%bb.3.lbl1', '%bb.4.lbl2', '%bb.5.lbl3', '%bb.6.lbl4' ]
|
blocks: [ '%bb.3.lbl1', '%bb.4.lbl2', '%bb.5.lbl3', '%bb.6.lbl4' ]
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
successors: %bb.2.def, %bb.1.entry
|
||||||
successors: [ '%bb.2.def', '%bb.1.entry' ]
|
|
||||||
instructions:
|
%eax = MOV32rr %edi, implicit-def %rax
|
||||||
- '%eax = MOV32rr %edi, implicit-def %rax'
|
CMP32ri8 %edi, 3, implicit-def %eflags
|
||||||
- 'CMP32ri8 %edi, 3, implicit-def %eflags'
|
JA_1 %bb.2.def, implicit %eflags
|
||||||
- 'JA_1 %bb.2.def, implicit %eflags'
|
|
||||||
- id: 1
|
bb.1.entry:
|
||||||
name: entry
|
successors: %bb.3.lbl1, %bb.4.lbl2, %bb.5.lbl3, %bb.6.lbl4
|
||||||
successors: [ '%bb.3.lbl1', '%bb.4.lbl2', '%bb.5.lbl3', '%bb.6.lbl4' ]
|
|
||||||
instructions:
|
%rcx = LEA64r %rip, 1, _, %jump-table.0, _
|
||||||
- '%rcx = LEA64r %rip, 1, _, %jump-table.0, _'
|
%rax = MOVSX64rm32 %rcx, 4, %rax, 0, _
|
||||||
- '%rax = MOVSX64rm32 %rcx, 4, %rax, 0, _'
|
%rax = ADD64rr %rax, %rcx, implicit-def %eflags
|
||||||
- '%rax = ADD64rr %rax, %rcx, implicit-def %eflags'
|
JMP64r %rax
|
||||||
- 'JMP64r %rax'
|
|
||||||
- id: 2
|
bb.2.def:
|
||||||
name: def
|
%eax = MOV32r0 implicit-def %eflags
|
||||||
instructions:
|
RETQ %eax
|
||||||
- '%eax = MOV32r0 implicit-def %eflags'
|
|
||||||
- 'RETQ %eax'
|
bb.3.lbl1:
|
||||||
- id: 3
|
%eax = MOV32ri 1
|
||||||
name: lbl1
|
RETQ %eax
|
||||||
instructions:
|
|
||||||
- '%eax = MOV32ri 1'
|
bb.4.lbl2:
|
||||||
- 'RETQ %eax'
|
%eax = MOV32ri 2
|
||||||
- id: 4
|
RETQ %eax
|
||||||
name: lbl2
|
|
||||||
instructions:
|
bb.5.lbl3:
|
||||||
- '%eax = MOV32ri 2'
|
%eax = MOV32ri 4
|
||||||
- 'RETQ %eax'
|
RETQ %eax
|
||||||
- id: 5
|
|
||||||
name: lbl3
|
bb.6.lbl4:
|
||||||
instructions:
|
%eax = MOV32ri 8
|
||||||
- '%eax = MOV32ri 4'
|
RETQ %eax
|
||||||
- 'RETQ %eax'
|
|
||||||
- id: 6
|
|
||||||
name: lbl4
|
|
||||||
instructions:
|
|
||||||
- '%eax = MOV32ri 8'
|
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -19,25 +19,22 @@
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: foo
|
name: foo
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
successors: %bb.1.less, %bb.2.exit
|
||||||
successors: [ '%bb.1.less', '%bb.2.exit' ]
|
|
||||||
instructions:
|
CMP32ri8 %edi, 10, implicit-def %eflags
|
||||||
- 'CMP32ri8 %edi, 10, implicit-def %eflags'
|
JG_1 %bb.2.exit, implicit %eflags
|
||||||
- 'JG_1 %bb.2.exit, implicit %eflags'
|
|
||||||
- id: 1
|
bb.1.less:
|
||||||
name: less
|
; CHECK: %eax = MOV32r0
|
||||||
instructions:
|
; CHECK-NEXT: RETQ killed %eax
|
||||||
# CHECK: - '%eax = MOV32r0
|
%eax = MOV32r0 implicit-def %eflags
|
||||||
# CHECK-NEXT: - 'RETQ killed %eax
|
RETQ killed %eax
|
||||||
- '%eax = MOV32r0 implicit-def %eflags'
|
|
||||||
- 'RETQ killed %eax'
|
bb.2.exit:
|
||||||
- id: 2
|
; CHECK: %eax = COPY killed %edi
|
||||||
name: exit
|
; CHECK-NEXT: RETQ killed %eax
|
||||||
instructions:
|
%eax = COPY killed %edi
|
||||||
# CHECK: - '%eax = COPY killed %edi
|
RETQ killed %eax
|
||||||
# CHECK-NEXT: - 'RETQ killed %eax
|
|
||||||
- '%eax = COPY killed %edi'
|
|
||||||
- 'RETQ killed %eax'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -16,14 +16,12 @@ frameInfo:
|
||||||
stackSize: 4040
|
stackSize: 4040
|
||||||
stack:
|
stack:
|
||||||
- { id: 0, name: tmp, offset: -4176, size: 4168, alignment: 4 }
|
- { id: 0, name: tmp, offset: -4176, size: 4168, alignment: 4 }
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
%rsp = SUB64ri32 %rsp, 4040, implicit-def dead %eflags
|
||||||
instructions:
|
; CHECK: [[@LINE+1]]:41: expected a 32 bit integer (the cfi offset is too large)
|
||||||
- '%rsp = SUB64ri32 %rsp, 4040, implicit-def dead %eflags'
|
CFI_INSTRUCTION .cfi_def_cfa_offset 123456789123456
|
||||||
# CHECK: [[@LINE+1]]:46: expected a 32 bit integer (the cfi offset is too large)
|
%rsp = ADD64ri32 %rsp, 4040, implicit-def dead %eflags
|
||||||
- 'CFI_INSTRUCTION .cfi_def_cfa_offset 123456789123456'
|
RETQ
|
||||||
- '%rsp = ADD64ri32 %rsp, 4040, implicit-def dead %eflags'
|
|
||||||
- 'RETQ'
|
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
|
@ -10,11 +10,9 @@
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: foo
|
name: foo
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
; CHECK: [[@LINE+1]]:20: integer literal is too large to be an immediate operand
|
||||||
instructions:
|
%eax = MOV32ri 12346127502983478823754212949184914
|
||||||
# CHECK: [[@LINE+1]]:24: integer literal is too large to be an immediate operand
|
RETQ %eax
|
||||||
- '%eax = MOV32ri 12346127502983478823754212949184914'
|
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -18,18 +18,16 @@
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: foo
|
name: foo
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
%eax = MOV32rm %rdi, 1, _, 0, _
|
||||||
instructions:
|
CMP32ri8 %eax, 10, implicit-def %eflags
|
||||||
- '%eax = MOV32rm %rdi, 1, _, 0, _'
|
; CHECK: [[@LINE+1]]:10: expected 32-bit integer (too large)
|
||||||
- 'CMP32ri8 %eax, 10, implicit-def %eflags'
|
JG_1 %bb.123456789123456, implicit %eflags
|
||||||
# CHECK: [[@LINE+1]]:14: expected 32-bit integer (too large)
|
|
||||||
- 'JG_1 %bb.123456789123456, implicit %eflags'
|
bb.1:
|
||||||
- id: 1
|
%eax = MOV32r0 implicit-def %eflags
|
||||||
instructions:
|
|
||||||
- '%eax = MOV32r0 implicit-def %eflags'
|
bb.2:
|
||||||
- id: 2
|
RETQ %eax
|
||||||
instructions:
|
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -14,13 +14,11 @@
|
||||||
...
|
...
|
||||||
---
|
---
|
||||||
name: inc
|
name: inc
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
; CHECK: [[@LINE+1]]:37: expected 64-bit integer (too large)
|
||||||
instructions:
|
%rax = MOV64rm %rip, 1, _, @G + 123456789123456789123456789, _
|
||||||
# CHECK: [[@LINE+1]]:42: expected 64-bit integer (too large)
|
%eax = MOV32rm %rax, 1, _, 0, _
|
||||||
- '%rax = MOV64rm %rip, 1, _, @G + 123456789123456789123456789, _'
|
%eax = INC32r %eax implicit-def %eflags
|
||||||
- '%eax = MOV32rm %rax, 1, _, 0, _'
|
RETQ %eax
|
||||||
- '%eax = INC32r %eax implicit-def %eflags'
|
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -14,13 +14,11 @@ name: test
|
||||||
tracksRegLiveness: true
|
tracksRegLiveness: true
|
||||||
liveins:
|
liveins:
|
||||||
- { reg: '%rdi' }
|
- { reg: '%rdi' }
|
||||||
body:
|
body: |
|
||||||
- id: 0
|
bb.0.entry:
|
||||||
name: entry
|
liveins: %rdi
|
||||||
liveins: [ '%rdi' ]
|
; CHECK: [[@LINE+1]]:53: expected 64-bit integer (too large)
|
||||||
instructions:
|
%eax = MOV32rm killed %rdi, 1, _, 0, _ :: (load 12345678912345678924218574857 from %ir.a)
|
||||||
# CHECK: [[@LINE+1]]:58: expected 64-bit integer (too large)
|
RETQ %eax
|
||||||
- '%eax = MOV32rm killed %rdi, 1, _, 0, _ :: (load 12345678912345678924218574857 from %ir.a)'
|
|
||||||
- 'RETQ %eax'
|
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue