diff options
author | Dan Gohman <sunfish@mozilla.com> | 2014-03-05 17:27:17 -0800 |
---|---|---|
committer | Dan Gohman <sunfish@mozilla.com> | 2014-03-05 17:30:30 -0800 |
commit | d9003e75353416cfcdb9f03d5fba7e1060a35196 (patch) | |
tree | ba9901d4b25066cb4fb07898ed5b17ec718adfc4 /lib | |
parent | 0e2a08d6c55b8b020fb84a1277e2fccf7767c784 (diff) |
Teach phi translation to also look through bitcasts.
This fixes a regression introduced in d95cd364f0c049d6c1b8d78746d44c00ed2f69f2;
when regular expression translation looks through bitcasts but phi translation
doesn't, phi translation may fail to properly detect dependencies.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/JSBackend/JSBackend.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Target/JSBackend/JSBackend.cpp b/lib/Target/JSBackend/JSBackend.cpp index a08e61fbff..5efd4c5684 100644 --- a/lib/Target/JSBackend/JSBackend.cpp +++ b/lib/Target/JSBackend/JSBackend.cpp @@ -521,7 +521,10 @@ std::string JSWriter::getPhiCode(const BasicBlock *From, const BasicBlock *To) { // we found it const std::string &name = getJSName(P); assigns[name] = getAssign(P); - const Value *V = P->getIncomingValue(index); + // Get the operand, and strip pointer casts, since normal expression + // translation also strips pointer casts, and we want to see the same + // thing so that we can detect any resulting dependencies. + const Value *V = P->getIncomingValue(index)->stripPointerCasts(); values[name] = V; std::string vname = getValueAsStr(V); if (const Instruction *VI = dyn_cast<const Instruction>(V)) { |