summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Grosser <tobias@grosser.es>2017-07-07 04:20:55 +0000
committerTobias Grosser <tobias@grosser.es>2017-07-07 04:20:55 +0000
commit41f02a9960c3bc36190dae149e9616d8a872a715 (patch)
tree7ba2f8765a137739e2b014dfc03c9185e0e8574f
parentb76aa4ac0aafd42397e3be27819e1a83bdd55109 (diff)
downloadbcm5719-llvm-41f02a9960c3bc36190dae149e9616d8a872a715.tar.gz
bcm5719-llvm-41f02a9960c3bc36190dae149e9616d8a872a715.zip
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. llvm-svn: 307355
-rwxr-xr-xpolly/test/create_ll.sh11
1 files changed, 4 insertions, 7 deletions
diff --git a/polly/test/create_ll.sh b/polly/test/create_ll.sh
index f6d8aee15bd..3ed6fc73044 100755
--- a/polly/test/create_ll.sh
+++ b/polly/test/create_ll.sh
@@ -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}
OpenPOWER on IntegriCloud