[polly] r307355 - Make create_ll work with latest LLVM [NFC]

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 6 21:20:55 PDT 2017


Author: grosser
Date: Thu Jul  6 21:20:55 2017
New Revision: 307355

URL: http://llvm.org/viewvc/llvm-project?rev=307355&view=rev
Log:
Make create_ll work with latest LLVM [NFC]

- Instead of running with -O0, we enable the highest optimization level, but
  then disable optimizations. This ensures that possibly important metadata
  is still emitted.

- Update the code for attribute removal to work with latest LLVM

- Do not cut an arbitrary number of lines from the LL file. It is undocumented
  why this was needed at the first place, and such a feature is likely to
  break with trivial IR changes that may come in the future.

Modified:
    polly/trunk/test/create_ll.sh

Modified: polly/trunk/test/create_ll.sh
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/create_ll.sh?rev=307355&r1=307354&r2=307355&view=diff
==============================================================================
--- polly/trunk/test/create_ll.sh (original)
+++ polly/trunk/test/create_ll.sh Thu Jul  6 21:20:55 2017
@@ -3,10 +3,7 @@
 LLFILE=`echo $1 | sed -e 's/\.c/.ll/g'`
 LLFILE_TMP=${LLFILE}.tmp
 
-# The number of lines to cut of the LLVM-IR file clang produces.
-CUT_N_LINES=6
-
-clang -c -S -emit-llvm -O0 $1 -o ${LLFILE}
+clang -c -S -emit-llvm -O3 -mllvm -disable-llvm-optzns $1 -o ${LLFILE}
 
 opt -correlated-propagation -mem2reg -instcombine -loop-simplify -indvars \
 -instnamer ${LLFILE} -S -o ${LLFILE_TMP}
@@ -23,11 +20,11 @@ echo ';' >> ${LLFILE}
 clang-format $1 | sed -e 's/^[^$]/;    &/' -e 's/^$/;/' >> ${LLFILE}
 echo ';' >> ${LLFILE}
 
-cat ${LLFILE_TMP} | sed -e 's/ \#0//' >> ${LLFILE}
+cat ${LLFILE_TMP} >> ${LLFILE}
+sed -i".tmp" '/attributes .* =/d' ${LLFILE}
+sed -i".tmp" -e 's/) \#[0-9]*/)/' ${LLFILE}
 sed -i".tmp" '/; Function Attrs:/d' ${LLFILE}
 sed -i".tmp" '/; ModuleID =/d' ${LLFILE}
 sed -i".tmp" '/target triple/d' ${LLFILE}
 
-head --lines=-${CUT_N_LINES} ${LLFILE} > ${LLFILE_TMP}
-
 mv ${LLFILE_TMP} ${LLFILE}




More information about the llvm-commits mailing list