summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-opt-report/Inputs/sr2.c
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2016-10-06 11:58:52 +0000
committerHal Finkel <hfinkel@anl.gov>2016-10-06 11:58:52 +0000
commit4d6f3088c328c19e6ed122cc02f92f23fbe5e52d (patch)
tree66116aeaace3a4044bc0dd49c30ecb03954ecdc6 /llvm/test/tools/llvm-opt-report/Inputs/sr2.c
parent6341e46cd1a0383a4511f541b2ae62949aaf5c31 (diff)
downloadbcm5719-llvm-4d6f3088c328c19e6ed122cc02f92f23fbe5e52d.tar.gz
bcm5719-llvm-4d6f3088c328c19e6ed122cc02f92f23fbe5e52d.zip
[llvm-opt-report] Record VF, etc. correctly for multiple opts on one line
When there are multiple optimizations on one line, record the vectorization factors, etc. correctly (instead of incorrectly substituting default values). llvm-svn: 283443
Diffstat (limited to 'llvm/test/tools/llvm-opt-report/Inputs/sr2.c')
-rw-r--r--llvm/test/tools/llvm-opt-report/Inputs/sr2.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-opt-report/Inputs/sr2.c b/llvm/test/tools/llvm-opt-report/Inputs/sr2.c
new file mode 100644
index 00000000000..79ee519e67f
--- /dev/null
+++ b/llvm/test/tools/llvm-opt-report/Inputs/sr2.c
@@ -0,0 +1,35 @@
+/*
+** Write a 64-bit variable-length integer to memory starting at p[0].
+** The length of data write will be between 1 and 9 bytes. The number
+** of bytes written is returned.
+**
+** A variable-length integer consists of the lower 7 bits of each byte
+** for all bytes that have the 8th bit set and one byte with the 8th
+** bit clear. Except, if we get to the 9th byte, it stores the full
+** 8 bits and is the last byte.
+*/
+SQLITE_PRIVATE int sqlite3PutVarint(unsigned char *p, u64 v){
+ int i, j, n;
+ u8 buf[10];
+ if( v & (((u64)0xff000000)<<32) ){
+ p[8] = v;
+ v >>= 8;
+ for(i=7; i>=0; i--){
+ p[i] = (v & 0x7f) | 0x80;
+ v >>= 7;
+ }
+ return 9;
+ }
+ n = 0;
+ do{
+ buf[n++] = (v & 0x7f) | 0x80;
+ v >>= 7;
+ }while( v!=0 );
+ buf[0] &= 0x7f;
+ assert( n<=9 );
+ for(i=0, j=n-1; j>=0; j--, i++){
+ p[i] = buf[j];
+ }
+ return n;
+}
+
OpenPOWER on IntegriCloud