Commit a9614b5a authored by Kevin Modzelewski's avatar Kevin Modzelewski

Disable the escape analysis until it can be fixed

parent a59c3987
......@@ -56,7 +56,7 @@ Pyston builds in a few different configurations; right now there is "pyston_dbg"
You can get a simple REPL by simply typing `./pyston`; it is not very robust right now, and only supports single-line statements, but can give you an interactive view into how Pyston works. To get more functionality, you can do `./pyston -i [your_source_file.py]`, which will go into the REPL after executing the given file, letting you access all the variables you had defined.
To run the tests, run `make test`. Currently not all the tests pass, which will hopefully be fixed soon.
To run the tests, run `make test`.
#### Command-line options:
<dl>
......
......@@ -112,13 +112,14 @@ void Assembler::emitByte(uint8_t b) {
++addr;
}
void Assembler::emitInt(uint64_t n, int bytes) {
void Assembler::emitInt(int64_t n, int bytes) {
assert(bytes > 0 && bytes <= 8);
assert((-1L << (8 * bytes - 1)) <= n && n <= ((1L << (8 * bytes - 1)) - 1));
for (int i = 0; i < bytes; i++) {
emitByte(n & 0xff);
n >>= 8;
}
assert(n == 0);
ASSERT(n == 0 || n == -1, "%ld", n);
}
void Assembler::emitRex(uint8_t rex) {
......
......@@ -57,7 +57,7 @@ class Assembler {
static const uint8_t REX_B = 1, REX_X = 2, REX_R = 4, REX_W = 8;
private:
void emitByte(uint8_t b);
void emitInt(uint64_t n, int bytes);
void emitInt(int64_t n, int bytes);
void emitRex(uint8_t rex);
void emitModRM(uint8_t mod, uint8_t reg, uint8_t rm);
void emitSIB(uint8_t scalebits, uint8_t index, uint8_t base);
......
......@@ -64,6 +64,10 @@ bool EscapeAnalysis::runOnFunction(Function &F) {
ChainInfo *chain = new ChainInfo(alloc);
chains.push_back(chain);
if (VERBOSITY("opt") >= 2) {
errs() << "Found chain " << chain << " starting at " << *alloc;
}
// Calculating derived pointers, and finding escape points
{
// Instructions in the queue to be visited:
......@@ -176,7 +180,22 @@ bool EscapeAnalysis::runOnFunction(Function &F) {
return false;
}
void EscapeAnalysis::ChainInfo::dump() {
errs() << "Chain starting at " << *allocation << ":\n";
for (auto escape_point : escape_points) {
errs() << "Escapes at: " << *escape_point << '\n';
}
for (auto ptr : derived) {
errs() << "Derived: " << *ptr << '\n';
}
}
EscapeAnalysis::EscapeResult EscapeAnalysis::escapes(const Value* ptr, const Instruction *at_instruction) {
// FIXME the escape analysis either needs to get rerun as appropriate, or not store any
// data between queries.
// Disabled for now.
return Escaped;
assert(ptr);
assert(at_instruction);
......
......@@ -42,6 +42,8 @@ class EscapeAnalysis : public llvm::FunctionPass {
std::unordered_map<const llvm::BasicBlock*, BBEscape> bb_escapes;
ChainInfo(llvm::Value* alloc) : allocation(alloc) {}
void dump();
};
std::vector<ChainInfo*> chains;
std::unordered_map<const llvm::Value*, ChainInfo*> chain_by_pointer;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment