[llvm-branch-commits] [llvm] be9b4bb - [MCJIT] Add cmake variables to customize ittapi git location and revision.

2020-12-09 Thread Alexey Bader via llvm-branch-commits

Author: Alexey Bader
Date: 2020-12-09T21:04:24+03:00
New Revision: be9b4bbdfc226c6387304552bbc0312ed60bd602

URL: 
https://github.com/llvm/llvm-project/commit/be9b4bbdfc226c6387304552bbc0312ed60bd602
DIFF: 
https://github.com/llvm/llvm-project/commit/be9b4bbdfc226c6387304552bbc0312ed60bd602.diff

LOG: [MCJIT] Add cmake variables to customize ittapi git location and revision.

To support llorg builds this patch provides the following changes:

1)  Added cmake variable ITTAPI_GIT_REPOSITORY to control the location of 
ITTAPI repository.
 Default value of ITTAPI_GIT_REPOSITORY is github location: 
https://github.com/intel/ittapi.git
 Also, the separate cmake variable ITTAPI_GIT_TAG was added for repo tag.
2)  Added cmake variable ITTAPI_SOURCE_DIR to control the place where the repo 
will be cloned.
 Default value of ITTAPI_SOURCE_DIR is build area: PROJECT_BINARY_DIR

Reviewed By: etyurin, bader

Patch by ekovanov.

Differential Revision: https://reviews.llvm.org/D91935

Added: 


Modified: 
llvm/lib/ExecutionEngine/IntelJITEvents/CMakeLists.txt

Removed: 




diff  --git a/llvm/lib/ExecutionEngine/IntelJITEvents/CMakeLists.txt 
b/llvm/lib/ExecutionEngine/IntelJITEvents/CMakeLists.txt
index 7f84b1505813..9fe3fe0b754e 100644
--- a/llvm/lib/ExecutionEngine/IntelJITEvents/CMakeLists.txt
+++ b/llvm/lib/ExecutionEngine/IntelJITEvents/CMakeLists.txt
@@ -1,25 +1,34 @@
 include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/.. )
 
-set(GIT_REPOSITORY https://github.com/intel/ittapi.git)
-set(GIT_TAG v3.18.8)
+if(NOT DEFINED ITTAPI_GIT_REPOSITORY)
+set(ITTAPI_GIT_REPOSITORY https://github.com/intel/ittapi.git)
+endif()
+
+if(NOT DEFINED ITTAPI_GIT_TAG)
+set(ITTAPI_GIT_TAG v3.18.8)
+endif()
+
+if(NOT DEFINED ITTAPI_SOURCE_DIR)
+set(ITTAPI_SOURCE_DIR ${PROJECT_BINARY_DIR})
+endif()
 
-if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/ittapi)
-execute_process(COMMAND ${GIT_EXECUTABLE} clone ${GIT_REPOSITORY}
-WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+if(NOT EXISTS ${ITTAPI_SOURCE_DIR}/ittapi)
+execute_process(COMMAND ${GIT_EXECUTABLE} clone ${ITTAPI_GIT_REPOSITORY}
+WORKING_DIRECTORY ${ITTAPI_SOURCE_DIR}
 RESULT_VARIABLE GIT_CLONE_RESULT)
 if(NOT GIT_CLONE_RESULT EQUAL "0")
-message(FATAL_ERROR "git clone ${GIT_REPOSITORY} failed with 
${GIT_CLONE_RESULT}, please clone ${GIT_REPOSITORY}")
+message(FATAL_ERROR "git clone ${ITTAPI_GIT_REPOSITORY} failed with 
${GIT_CLONE_RESULT}, please clone ${ITTAPI_GIT_REPOSITORY}")
 endif()
 endif()
 
-execute_process(COMMAND ${GIT_EXECUTABLE} checkout ${GIT_TAG}
-WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ittapi
+execute_process(COMMAND ${GIT_EXECUTABLE} checkout ${ITTAPI_GIT_TAG}
+WORKING_DIRECTORY ${ITTAPI_SOURCE_DIR}/ittapi
 RESULT_VARIABLE GIT_CHECKOUT_RESULT)
 if(NOT GIT_CHECKOUT_RESULT EQUAL "0")
-message(FATAL_ERROR "git checkout ${GIT_TAG} failed with 
${GIT_CHECKOUT_RESULT}, please checkout ${GIT_TAG} at 
${CMAKE_CURRENT_SOURCE_DIR}/ittapi")
+message(FATAL_ERROR "git checkout ${ITTAPI_GIT_TAG} failed with 
${GIT_CHECKOUT_RESULT}, please checkout ${ITTAPI_GIT_TAG} at 
${ITTAPI_SOURCE_DIR}/ittapi")
 endif()
 
-include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/ittapi/include/ )
+include_directories( ${ITTAPI_SOURCE_DIR}/ittapi/include/ )
 
 if( HAVE_LIBDL )
 set(LLVM_INTEL_JIT_LIBS ${CMAKE_DL_LIBS})
@@ -31,7 +40,7 @@ set(LLVM_INTEL_JIT_LIBS ${LLVM_PTHREAD_LIB} 
${LLVM_INTEL_JIT_LIBS})
 add_llvm_component_library(LLVMIntelJITEvents
   IntelJITEventListener.cpp
   jitprofiling.c
-  ittapi/src/ittnotify/ittnotify_static.c
+  ${ITTAPI_SOURCE_DIR}/ittapi/src/ittnotify/ittnotify_static.c
 
   LINK_LIBS ${LLVM_INTEL_JIT_LIBS}
 



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] 3631e08 - [Doc] Update branch name in Phabricator documentation

2020-12-10 Thread Alexey Bader via llvm-branch-commits

Author: Alexey Bader
Date: 2020-12-10T22:25:04+03:00
New Revision: 3631e080c4e85b762fffce63abfe3aadfa43884b

URL: 
https://github.com/llvm/llvm-project/commit/3631e080c4e85b762fffce63abfe3aadfa43884b
DIFF: 
https://github.com/llvm/llvm-project/commit/3631e080c4e85b762fffce63abfe3aadfa43884b.diff

LOG: [Doc] Update branch name in Phabricator documentation

master -> main

Differential Revision: https://reviews.llvm.org/D93020

Added: 


Modified: 
llvm/docs/Phabricator.rst

Removed: 




diff  --git a/llvm/docs/Phabricator.rst b/llvm/docs/Phabricator.rst
index 6df1a8b755c4..cbc7c34eab68 100644
--- a/llvm/docs/Phabricator.rst
+++ b/llvm/docs/Phabricator.rst
@@ -200,7 +200,7 @@ click Submit.  Note the review must have been Accepted 
first.
 Committing someone's change from Phabricator
 
 
-On a clean Git repository on an up to date ``master`` branch run the
+On a clean Git repository on an up to date ``main`` branch run the
 following (where  is the Phabricator review number):
 
 ::
@@ -209,7 +209,7 @@ following (where  is the Phabricator review 
number):
 
 
 This will create a new branch called ``arcpatch-D`` based on the
-current ``master`` and will create a commit corresponding to ``D`` 
with a
+current ``main`` and will create a commit corresponding to ``D`` 
with a
 commit message derived from information in the Phabricator review.
 
 Check you are happy with the commit message and amend it if necessary.
@@ -225,10 +225,10 @@ the following:
 
 ::
 
-  git pull --rebase https://github.com/llvm/llvm-project.git master
+  git pull --rebase https://github.com/llvm/llvm-project.git main
   git show # Ensure the patch looks correct.
   ninja check-$whatever # Rerun the appropriate tests if needed.
-  git push https://github.com/llvm/llvm-project.git HEAD:master
+  git push https://github.com/llvm/llvm-project.git HEAD:main
 
 
 Abandoning a change



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] a500a43 - [CodeGen][AMDGPU] Fix ICE for static initializer IR generation

2020-12-12 Thread Alexey Bader via llvm-branch-commits

Author: Alexey Bader
Date: 2020-12-12T23:26:54+03:00
New Revision: a500a4358789d1794bc672421c55900ea2bbc938

URL: 
https://github.com/llvm/llvm-project/commit/a500a4358789d1794bc672421c55900ea2bbc938
DIFF: 
https://github.com/llvm/llvm-project/commit/a500a4358789d1794bc672421c55900ea2bbc938.diff

LOG: [CodeGen][AMDGPU] Fix ICE for static initializer IR generation

Differential Revision: https://reviews.llvm.org/D92782

Added: 


Modified: 
clang/lib/CodeGen/CGDecl.cpp
clang/test/CodeGen/address-space.c

Removed: 




diff  --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp
index 478821665e45..a01638f0b67b 100644
--- a/clang/lib/CodeGen/CGDecl.cpp
+++ b/clang/lib/CodeGen/CGDecl.cpp
@@ -353,12 +353,11 @@ CodeGenFunction::AddInitializerToStaticVarDecl(const 
VarDecl &D,
   if (GV->getValueType() != Init->getType()) {
 llvm::GlobalVariable *OldGV = GV;
 
-GV = new llvm::GlobalVariable(CGM.getModule(), Init->getType(),
-  OldGV->isConstant(),
-  OldGV->getLinkage(), Init, "",
-  /*InsertBefore*/ OldGV,
-  OldGV->getThreadLocalMode(),
-   
CGM.getContext().getTargetAddressSpace(D.getType()));
+GV = new llvm::GlobalVariable(
+CGM.getModule(), Init->getType(), OldGV->isConstant(),
+OldGV->getLinkage(), Init, "",
+/*InsertBefore*/ OldGV, OldGV->getThreadLocalMode(),
+OldGV->getType()->getPointerAddressSpace());
 GV->setVisibility(OldGV->getVisibility());
 GV->setDSOLocal(OldGV->isDSOLocal());
 GV->setComdat(OldGV->getComdat());

diff  --git a/clang/test/CodeGen/address-space.c 
b/clang/test/CodeGen/address-space.c
index c66dfc87c0c0..baefb4b983fc 100644
--- a/clang/test/CodeGen/address-space.c
+++ b/clang/test/CodeGen/address-space.c
@@ -59,3 +59,14 @@ void __attribute__((address_space(1)))*
 void_ptr_arithmetic_test(void __attribute__((address_space(1))) *arg) {
 return arg + 4;
 }
+
+// CHECK-LABEL: define i32* @test5(
+const unsigned *test5() {
+  // Intentionally leave a part of an array uninitialized. This triggers a
+  // 
diff erent code path contrary to a fully initialized array.
+  // CHECK: ret i32* getelementptr inbounds ([256 x i32]
+  static const unsigned bars[256] = {
+  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
+  11, 12, 13, 14, 15, 16, 17, 18, 19, 20};
+  return &bars[0];
+}



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits