aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Target/JSBackend/CMakeLists.txt1
-rw-r--r--lib/Target/JSBackend/ExpandI64.cpp (renamed from lib/Transforms/NaCl/ExpandI64.cpp)9
-rw-r--r--lib/Target/JSBackend/JSBackend.cpp1
-rw-r--r--lib/Target/JSBackend/OptPasses.h2
-rw-r--r--lib/Transforms/NaCl/CMakeLists.txt1
-rw-r--r--lib/Transforms/NaCl/PNaClABISimplify.cpp2
-rw-r--r--test/CodeGen/JS/expand-i64.ll (renamed from test/Transforms/NaCl/expand-i64.ll)0
7 files changed, 11 insertions, 5 deletions
diff --git a/lib/Target/JSBackend/CMakeLists.txt b/lib/Target/JSBackend/CMakeLists.txt
index 099a45ff08..37704f316f 100644
--- a/lib/Target/JSBackend/CMakeLists.txt
+++ b/lib/Target/JSBackend/CMakeLists.txt
@@ -1,4 +1,5 @@
add_llvm_target(JSBackendCodeGen
+ ExpandI64.cpp
JSBackend.cpp
Relooper.cpp
SimplifyAllocas.cpp
diff --git a/lib/Transforms/NaCl/ExpandI64.cpp b/lib/Target/JSBackend/ExpandI64.cpp
index 911060ebfc..cc63d01c7f 100644
--- a/lib/Transforms/NaCl/ExpandI64.cpp
+++ b/lib/Target/JSBackend/ExpandI64.cpp
@@ -24,6 +24,7 @@
//
//===------------------------------------------------------------------===//
+#include "OptPasses.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/SmallString.h"
@@ -39,7 +40,6 @@
#include "llvm/Pass.h"
#include "llvm/Support/CFG.h"
#include "llvm/Target/TargetLibraryInfo.h"
-#include "llvm/Transforms/NaCl.h"
#include "llvm/Transforms/Utils/Local.h"
#include <map>
@@ -114,6 +114,11 @@ INITIALIZE_PASS(ExpandI64, "expand-illegal-ints",
// Utilities
+static Instruction *CopyDebug(Instruction *NewInst, Instruction *Original) {
+ NewInst->setDebugLoc(Original->getDebugLoc());
+ return NewInst;
+}
+
static bool isIllegal(Type *T) {
return T->isIntegerTy() && T->getIntegerBitWidth() > 32;
}
@@ -1102,6 +1107,6 @@ void ExpandI64::getAnalysisUsage(AnalysisUsage &AU) const {
ModulePass::getAnalysisUsage(AU);
}
-ModulePass *llvm::createExpandI64Pass() {
+Pass *llvm::createExpandI64Pass() {
return new ExpandI64();
}
diff --git a/lib/Target/JSBackend/JSBackend.cpp b/lib/Target/JSBackend/JSBackend.cpp
index c698f96eb6..8a811b6958 100644
--- a/lib/Target/JSBackend/JSBackend.cpp
+++ b/lib/Target/JSBackend/JSBackend.cpp
@@ -2318,6 +2318,7 @@ bool JSTargetMachine::addPassesToEmitFile(PassManagerBase &PM,
AnalysisID StopAfter) {
assert(FileType == TargetMachine::CGFT_AssemblyFile);
+ PM.add(createExpandI64Pass());
PM.add(createSimplifyAllocasPass());
PM.add(new JSWriter(o));
diff --git a/lib/Target/JSBackend/OptPasses.h b/lib/Target/JSBackend/OptPasses.h
index d976ad226d..81e3b5ed18 100644
--- a/lib/Target/JSBackend/OptPasses.h
+++ b/lib/Target/JSBackend/OptPasses.h
@@ -16,6 +16,8 @@ namespace llvm {
extern FunctionPass *createSimplifyAllocasPass();
+ extern Pass *createExpandI64Pass();
+
} // End llvm namespace
#endif
diff --git a/lib/Transforms/NaCl/CMakeLists.txt b/lib/Transforms/NaCl/CMakeLists.txt
index 05cef0857e..dd76491d65 100644
--- a/lib/Transforms/NaCl/CMakeLists.txt
+++ b/lib/Transforms/NaCl/CMakeLists.txt
@@ -28,7 +28,6 @@ add_llvm_library(LLVMNaClTransforms
RewritePNaClLibraryCalls.cpp
StripAttributes.cpp
StripMetadata.cpp
- ExpandI64.cpp
LowerEmExceptionsPass.cpp
LowerEmSetjmp.cpp
NoExitRuntime.cpp
diff --git a/lib/Transforms/NaCl/PNaClABISimplify.cpp b/lib/Transforms/NaCl/PNaClABISimplify.cpp
index 41dd2f58fd..4deee01a2b 100644
--- a/lib/Transforms/NaCl/PNaClABISimplify.cpp
+++ b/lib/Transforms/NaCl/PNaClABISimplify.cpp
@@ -164,7 +164,5 @@ void llvm::PNaClABISimplifyAddPostOptPasses(PassManager &PM) {
PM.add(createDeadInstEliminationPass());
#endif
PM.add(createDeadCodeEliminationPass());
-
- PM.add(createExpandI64Pass()); // EMSCRIPTEN // FIXME: move this before the dce stuff here
}
diff --git a/test/Transforms/NaCl/expand-i64.ll b/test/CodeGen/JS/expand-i64.ll
index fd468fc6d1..fd468fc6d1 100644
--- a/test/Transforms/NaCl/expand-i64.ll
+++ b/test/CodeGen/JS/expand-i64.ll