summaryrefslogtreecommitdiffstats
path: root/llvm/utils
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2018-08-21 19:44:11 +0000
committerHeejin Ahn <aheejin@gmail.com>2018-08-21 19:44:11 +0000
commited5e06b0a7174b8da1f9a21e9a182a944a116ceb (patch)
treed0a19c755da1a3abaea46c09687e262c1c923ddf /llvm/utils
parent4a76d3e56840b98b66405d6dda53734c0229f1fd (diff)
downloadbcm5719-llvm-ed5e06b0a7174b8da1f9a21e9a182a944a116ceb.tar.gz
bcm5719-llvm-ed5e06b0a7174b8da1f9a21e9a182a944a116ceb.zip
[WebAssembly] Add isEHScopeReturn instruction property
Summary: So far, `isReturn` property is used to mean both a return instruction from a functon and the end of an EH scope, a scope that starts with a EH scope entry BB and ends with a catchret or a cleanupret instruction. Because WinEH uses funclets, all EH-scope-ending instructions are also real return instruction from a function. But for wasm, they only serve as the end marker of an EH scope but not a return instruction that exits a function. This mismatch caused incorrect prolog and epilog generation in wasm EH scopes. This patch fixes this. This patch is in the same vein with rL333045, which splits `MachineBasicBlock::isEHFuncletEntry` into `isEHFuncletEntry` and `isEHScopeEntry`. Reviewers: dschuff Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D50653 llvm-svn: 340325
Diffstat (limited to 'llvm/utils')
-rw-r--r--llvm/utils/TableGen/CodeGenInstruction.cpp1
-rw-r--r--llvm/utils/TableGen/CodeGenInstruction.h1
-rw-r--r--llvm/utils/TableGen/InstrDocsEmitter.cpp1
-rw-r--r--llvm/utils/TableGen/InstrInfoEmitter.cpp1
4 files changed, 4 insertions, 0 deletions
diff --git a/llvm/utils/TableGen/CodeGenInstruction.cpp b/llvm/utils/TableGen/CodeGenInstruction.cpp
index eb35020d3d3..a6ca400914b 100644
--- a/llvm/utils/TableGen/CodeGenInstruction.cpp
+++ b/llvm/utils/TableGen/CodeGenInstruction.cpp
@@ -302,6 +302,7 @@ CodeGenInstruction::CodeGenInstruction(Record *R)
AsmString = R->getValueAsString("AsmString");
isReturn = R->getValueAsBit("isReturn");
+ isEHScopeReturn = R->getValueAsBit("isEHScopeReturn");
isBranch = R->getValueAsBit("isBranch");
isIndirectBranch = R->getValueAsBit("isIndirectBranch");
isCompare = R->getValueAsBit("isCompare");
diff --git a/llvm/utils/TableGen/CodeGenInstruction.h b/llvm/utils/TableGen/CodeGenInstruction.h
index a50c3e60e6e..6f79b4bcc5c 100644
--- a/llvm/utils/TableGen/CodeGenInstruction.h
+++ b/llvm/utils/TableGen/CodeGenInstruction.h
@@ -222,6 +222,7 @@ template <typename T> class ArrayRef;
// Various boolean values we track for the instruction.
bool isReturn : 1;
+ bool isEHScopeReturn : 1;
bool isBranch : 1;
bool isIndirectBranch : 1;
bool isCompare : 1;
diff --git a/llvm/utils/TableGen/InstrDocsEmitter.cpp b/llvm/utils/TableGen/InstrDocsEmitter.cpp
index 65cb28cd17a..41dc37a7ab3 100644
--- a/llvm/utils/TableGen/InstrDocsEmitter.cpp
+++ b/llvm/utils/TableGen/InstrDocsEmitter.cpp
@@ -100,6 +100,7 @@ void EmitInstrDocs(RecordKeeper &RK, raw_ostream &OS) {
#define str(s) #s
#define FLAG(f) if (II->f) { FlagStrings.push_back(str(f)); }
FLAG(isReturn)
+ FLAG(isEHScopeReturn)
FLAG(isBranch)
FLAG(isIndirectBranch)
FLAG(isCompare)
diff --git a/llvm/utils/TableGen/InstrInfoEmitter.cpp b/llvm/utils/TableGen/InstrInfoEmitter.cpp
index 34680155209..ef8c849e25f 100644
--- a/llvm/utils/TableGen/InstrInfoEmitter.cpp
+++ b/llvm/utils/TableGen/InstrInfoEmitter.cpp
@@ -569,6 +569,7 @@ void InstrInfoEmitter::emitRecord(const CodeGenInstruction &Inst, unsigned Num,
// Emit all of the target independent flags...
if (Inst.isPseudo) OS << "|(1ULL<<MCID::Pseudo)";
if (Inst.isReturn) OS << "|(1ULL<<MCID::Return)";
+ if (Inst.isEHScopeReturn) OS << "|(1ULL<<MCID::EHScopeReturn)";
if (Inst.isBranch) OS << "|(1ULL<<MCID::Branch)";
if (Inst.isIndirectBranch) OS << "|(1ULL<<MCID::IndirectBranch)";
if (Inst.isCompare) OS << "|(1ULL<<MCID::Compare)";
OpenPOWER on IntegriCloud