From 0bae9ad47629268bdd2fb79f1190746c7b17142e Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Sun, 4 Jan 2015 10:51:51 -0800 Subject: [PATCH 1/8] 1.28.3 --- emscripten-version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emscripten-version.txt b/emscripten-version.txt index b7825b8d767..a5096ba657e 100644 --- a/emscripten-version.txt +++ b/emscripten-version.txt @@ -1,2 +1,2 @@ -1.28.2 +1.28.3 From 49ddcf56abaec79502ac50672d65795f0f87b5d5 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 7 Jan 2015 10:15:39 -0800 Subject: [PATCH 2/8] 1.29.0 --- emscripten-version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emscripten-version.txt b/emscripten-version.txt index a5096ba657e..5ff413d6239 100644 --- a/emscripten-version.txt +++ b/emscripten-version.txt @@ -1,2 +1,2 @@ -1.28.3 +1.29.0 From bbe46915f04c4cb4060522befd3f9a6edfbb5d8e Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 8 Jan 2015 11:36:46 -0800 Subject: [PATCH 3/8] fix 3.5 merge breakage on tools/opt on CMake builds --- tools/opt/CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/opt/CMakeLists.txt b/tools/opt/CMakeLists.txt index 937fa5b7888..6744f96b4c1 100644 --- a/tools/opt/CMakeLists.txt +++ b/tools/opt/CMakeLists.txt @@ -7,8 +7,11 @@ set(LLVM_LINK_COMPONENTS IPA IPO IRReader - naclbitwriter - naclbitreader + MinSFITransforms + NaClBitWriter + NaClBitReader + NaClTransforms + NaClAnalysis InstCombine Instrumentation MC From 04a42b3b71884203cddf07a3f6b2920b3dcc5367 Mon Sep 17 00:00:00 2001 From: Ningxin Hu Date: Wed, 7 Jan 2015 09:52:34 +0800 Subject: [PATCH 4/8] [SIMD.js] Add 1 and 2 elements load and store intrinsics --- lib/Target/JSBackend/CallHandlers.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lib/Target/JSBackend/CallHandlers.h b/lib/Target/JSBackend/CallHandlers.h index 6af5daa9f86..d736311c55f 100644 --- a/lib/Target/JSBackend/CallHandlers.h +++ b/lib/Target/JSBackend/CallHandlers.h @@ -468,6 +468,22 @@ DEF_CALL_HANDLER(emscripten_float32x4_signmask, { return getAssign(CI) + getValueAsStr(CI->getOperand(0)) + ".signMask"; }) +DEF_CALL_HANDLER(emscripten_float32x4_loadx, { + return getAssign(CI) + "SIMD_float32x4_loadX(HEAPU8, " + getValueAsStr(CI->getOperand(0)) + ")"; +}) + +DEF_CALL_HANDLER(emscripten_float32x4_loadxy, { + return getAssign(CI) + "SIMD_float32x4_loadXY(HEAPU8, " + getValueAsStr(CI->getOperand(0)) + ")"; +}) + +DEF_CALL_HANDLER(emscripten_float32x4_storex, { + return "SIMD_float32x4_storeX(HEAPU8, " + getValueAsStr(CI->getOperand(0)) + ", " + getValueAsStr(CI->getOperand(1)) + ")"; +}) + +DEF_CALL_HANDLER(emscripten_float32x4_storexy, { + return "SIMD_float32x4_storeXY(HEAPU8, " + getValueAsStr(CI->getOperand(0)) + ", " + getValueAsStr(CI->getOperand(1)) + ")"; +}) + #define DEF_BUILTIN_HANDLER(name, to) \ DEF_CALL_HANDLER(name, { \ return CH___default__(CI, #to); \ @@ -631,6 +647,10 @@ void setupCallHandlers() { SETUP_CALL_HANDLER(emscripten_float32x4_fromInt32x4); SETUP_CALL_HANDLER(emscripten_int32x4_fromFloat32x4Bits); SETUP_CALL_HANDLER(emscripten_int32x4_fromFloat32x4); + SETUP_CALL_HANDLER(emscripten_float32x4_loadx); + SETUP_CALL_HANDLER(emscripten_float32x4_loadxy); + SETUP_CALL_HANDLER(emscripten_float32x4_storex); + SETUP_CALL_HANDLER(emscripten_float32x4_storexy); SETUP_CALL_HANDLER(abs); SETUP_CALL_HANDLER(labs); From 5368f68cddc87484b97dfabdb394e143d1e0b9d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jukka=20Jyl=C3=A4nki?= Date: Mon, 12 Jan 2015 18:45:54 +0200 Subject: [PATCH 5/8] Work around Visual Studio bug https://connect.microsoft.com/VisualStudio/feedback/details/1085387 . --- lib/Transforms/NaCl/FlattenGlobals.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/Transforms/NaCl/FlattenGlobals.cpp b/lib/Transforms/NaCl/FlattenGlobals.cpp index c1ba7802608..afc846f9fd7 100644 --- a/lib/Transforms/NaCl/FlattenGlobals.cpp +++ b/lib/Transforms/NaCl/FlattenGlobals.cpp @@ -81,11 +81,21 @@ namespace { class FlattenedGlobal; typedef std::vector FlattenedGlobalsVectorType; +#ifdef _MSC_VER +// Work around Visual Studio bug https://connect.microsoft.com/VisualStudio/feedback/details/1085387 +} +#endif + // Returns the corresponding relocation, for the given user handle. static Constant *getRelocUse(RelocUserType *RelocUser) { return cast(RelocUser->getReturnValue()); } +#ifdef _MSC_VER +// Work around Visual Studio bug https://connect.microsoft.com/VisualStudio/feedback/details/1085387 +namespace { +#endif + // The state associated with flattening globals of a module. struct FlattenGlobalsState { /// The module being flattened. From 3de18350c236cc57463ab2fdc60fc1b70e338439 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jukka=20Jyl=C3=A4nki?= Date: Mon, 12 Jan 2015 21:24:20 +0200 Subject: [PATCH 6/8] Clean up the MSVC fix to not need #ifdef _MSC_VER so that the code matches upstream NaCl LLVM. See https://codereview.chromium.org/828553007. --- lib/Transforms/NaCl/FlattenGlobals.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/lib/Transforms/NaCl/FlattenGlobals.cpp b/lib/Transforms/NaCl/FlattenGlobals.cpp index afc846f9fd7..973986a22f1 100644 --- a/lib/Transforms/NaCl/FlattenGlobals.cpp +++ b/lib/Transforms/NaCl/FlattenGlobals.cpp @@ -81,21 +81,11 @@ namespace { class FlattenedGlobal; typedef std::vector FlattenedGlobalsVectorType; -#ifdef _MSC_VER -// Work around Visual Studio bug https://connect.microsoft.com/VisualStudio/feedback/details/1085387 -} -#endif - // Returns the corresponding relocation, for the given user handle. - static Constant *getRelocUse(RelocUserType *RelocUser) { + static Constant *getRelocUseConstant(RelocUserType *RelocUser) { return cast(RelocUser->getReturnValue()); } -#ifdef _MSC_VER -// Work around Visual Studio bug https://connect.microsoft.com/VisualStudio/feedback/details/1085387 -namespace { -#endif - // The state associated with flattening globals of a module. struct FlattenGlobalsState { /// The module being flattened. @@ -185,7 +175,7 @@ namespace { public: unsigned getRelOffset() const { return RelOffset; } - Constant *getRelocUse() const { return ::getRelocUse(RelocUser); } + Constant *getRelocUse() const { return getRelocUseConstant(RelocUser); } Reloc(FlattenGlobalsState &State, unsigned RelOffset, Constant *NewVal) : RelOffset(RelOffset), RelocUser(State.getRelocUserHandle(NewVal)) {} @@ -522,7 +512,7 @@ void FlattenGlobalsState::removeDeadInitializerConstants() { // Do cleanup of old initializers. for (RelocMapType::iterator I = RelocMap.begin(), E = RelocMap.end(); I != E; ++I) { - getRelocUse(I->second)->removeDeadConstantUsers(); + getRelocUseConstant(I->second)->removeDeadConstantUsers(); } } From 22a277c5f8a3d1dc58eb08ee8462c0372649795f Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Wed, 14 Jan 2015 11:45:23 -0800 Subject: [PATCH 7/8] Disable inapplicable PNaCl SIMD lowering passes. --- lib/Transforms/NaCl/PNaClABISimplify.cpp | 6 ++++++ lib/Transforms/NaCl/PromoteIntegers.cpp | 14 +++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/lib/Transforms/NaCl/PNaClABISimplify.cpp b/lib/Transforms/NaCl/PNaClABISimplify.cpp index 8a95f3f8fe1..e469a36b956 100644 --- a/lib/Transforms/NaCl/PNaClABISimplify.cpp +++ b/lib/Transforms/NaCl/PNaClABISimplify.cpp @@ -129,22 +129,28 @@ void llvm::PNaClABISimplifyAddPostOptPasses(PassManagerBase &PM) { // Vector simplifications. // +#if 0 // EMSCRIPTEN: We can handle vector shuffles. // The following pass relies on ConstantInsertExtractElementIndex running // after it, and it must run before GlobalizeConstantVectors because the mask // argument of shufflevector must be a constant (the pass would otherwise // violate this requirement). PM.add(createExpandShuffleVectorPass()); +#endif // We should not place arbitrary passes after ExpandConstantExpr // because they might reintroduce ConstantExprs. PM.add(createExpandConstantExprPass()); +#if 0 // EMSCRIPTEN: We can handle constant vectors. // GlobalizeConstantVectors does not handle nested ConstantExprs, so we // run ExpandConstantExpr first. PM.add(createGlobalizeConstantVectorsPass()); +#endif // The following pass inserts GEPs, it must precede ExpandGetElementPtr. It // also creates vector loads and stores, the subsequent pass cleans them up to // fix their alignment. PM.add(createConstantInsertExtractElementIndexPass()); +#if 0 // EMSCRIPTEN: We can handle unaligned vector loads and stores. PM.add(createFixVectorLoadStoreAlignmentPass()); +#endif // Optimization passes and ExpandByVal introduce // memset/memcpy/memmove intrinsics with a 64-bit size argument. diff --git a/lib/Transforms/NaCl/PromoteIntegers.cpp b/lib/Transforms/NaCl/PromoteIntegers.cpp index e4782ce49da..1e65c4f5446 100644 --- a/lib/Transforms/NaCl/PromoteIntegers.cpp +++ b/lib/Transforms/NaCl/PromoteIntegers.cpp @@ -112,24 +112,24 @@ static bool shouldConvert(Value *Val) { // Return a constant which has been promoted to a legal size. static Value *convertConstant(Constant *C, bool SignExt=false) { assert(shouldConvert(C)); +#if 0 // EMSCRIPTEN: Generalize this code to work on any width and any constant if (isa(C)) { return UndefValue::get(getPromotedType(C->getType())); } else if (ConstantInt *CInt = dyn_cast(C)) { -#if 0 // XXX EMSCRIPTEN: Generalize this code to work on any bit width. return ConstantInt::get( getPromotedType(C->getType()), SignExt ? CInt->getSExtValue() : CInt->getZExtValue(), /*isSigned=*/SignExt); -#else - unsigned BitWidth = getPromotedType(C->getType())->getIntegerBitWidth(); - const APInt &Value = CInt->getValue(); - return ConstantInt::get(C->getContext(), - SignExt ? Value.sext(BitWidth) : Value.zext(BitWidth)); -#endif } else { errs() << "Value: " << *C << "\n"; report_fatal_error("Unexpected constant value"); } +#else + Type *ProTy = getPromotedType(C->getType()); + return SignExt ? + ConstantExpr::getSExt(C, ProTy) : + ConstantExpr::getZExt(C, ProTy); +#endif } namespace { From d63484f9f2e91bd739ad3735dcb569215aef9eef Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 15 Jan 2015 17:35:40 -0800 Subject: [PATCH 8/8] 1.29.2 --- emscripten-version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emscripten-version.txt b/emscripten-version.txt index 940f1321e44..6be5a23ede6 100644 --- a/emscripten-version.txt +++ b/emscripten-version.txt @@ -1,2 +1,2 @@ -1.29.1 +1.29.2