diff --git a/analysis/statistics/0284fa92e37e7d9a07644a670cac4d4360b3916a.txt b/analysis/statistics/0284fa92e37e7d9a07644a670cac4d4360b3916a.txt new file mode 100644 index 000000000..35e6411bc --- /dev/null +++ b/analysis/statistics/0284fa92e37e7d9a07644a670cac4d4360b3916a.txt @@ -0,0 +1,5 @@ + +changeset: 1410:0284fa92e37e7d9a07644a670cac4d4360b3916a +char kNewtonVersion[] = "0.3-alpha-1410 (0284fa92e37e7d9a07644a670cac4d4360b3916a) (build 02-09-2023-18:05-pei@pei-G5-5500-Linux-5.15.0-58-generic-x86_64)"; +\n./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s +\n./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt diff --git a/analysis/statistics/04e87cd90e209b0854a02ee5a0db6a52acf9598f.txt b/analysis/statistics/04e87cd90e209b0854a02ee5a0db6a52acf9598f.txt new file mode 100644 index 000000000..9f35b33b2 --- /dev/null +++ b/analysis/statistics/04e87cd90e209b0854a02ee5a0db6a52acf9598f.txt @@ -0,0 +1,46 @@ + +changeset: 1426:04e87cd90e209b0854a02ee5a0db6a52acf9598f +char kNewtonVersion[] = "0.3-alpha-1426 (04e87cd90e209b0854a02ee5a0db6a52acf9598f) (build 02-22-2023-12:53-pei@pei-G5-5500-Linux-5.19.0-32-generic-x86_64)"; +\n./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s +\n./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/0864c591e4ba25fd99c205a737bc2c12434a419f.txt b/analysis/statistics/0864c591e4ba25fd99c205a737bc2c12434a419f.txt new file mode 100644 index 000000000..a8251629e --- /dev/null +++ b/analysis/statistics/0864c591e4ba25fd99c205a737bc2c12434a419f.txt @@ -0,0 +1,46 @@ + +changeset: 1415:0864c591e4ba25fd99c205a737bc2c12434a419f +char kNewtonVersion[] = "0.3-alpha-1415 (0864c591e4ba25fd99c205a737bc2c12434a419f) (build 02-10-2023-19:58-pei@pei-G5-5500-Linux-5.15.0-60-generic-x86_64)"; +\n./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s +\n./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/11353beaf1dc58dbe5570acd7363529cbfab81ef.txt b/analysis/statistics/11353beaf1dc58dbe5570acd7363529cbfab81ef.txt new file mode 100644 index 000000000..1371c8a1d --- /dev/null +++ b/analysis/statistics/11353beaf1dc58dbe5570acd7363529cbfab81ef.txt @@ -0,0 +1,46 @@ + +changeset: 1405:11353beaf1dc58dbe5570acd7363529cbfab81ef +char kNewtonVersion[] = "0.3-alpha-1405 (11353beaf1dc58dbe5570acd7363529cbfab81ef) (build 01-30-2023-21:17-pei@pei-G5-5500-Linux-5.15.0-58-generic-x86_64)"; +\n./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s +\n./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/14e672a0fc29372e363f57d30b3668484a10b184.txt b/analysis/statistics/14e672a0fc29372e363f57d30b3668484a10b184.txt new file mode 100644 index 000000000..3257c7468 --- /dev/null +++ b/analysis/statistics/14e672a0fc29372e363f57d30b3668484a10b184.txt @@ -0,0 +1,46 @@ + +changeset: 1425:14e672a0fc29372e363f57d30b3668484a10b184 +char kNewtonVersion[] = "0.3-alpha-1425 (14e672a0fc29372e363f57d30b3668484a10b184) (build 02-21-2023-19:16-pei@pei-G5-5500-Linux-5.19.0-32-generic-x86_64)"; +\n./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s +\n./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/1d373949434bd066601d1f1c5a86e58e3134616d.txt b/analysis/statistics/1d373949434bd066601d1f1c5a86e58e3134616d.txt new file mode 100644 index 000000000..482b8c1e8 --- /dev/null +++ b/analysis/statistics/1d373949434bd066601d1f1c5a86e58e3134616d.txt @@ -0,0 +1,46 @@ + +changeset: 1408:1d373949434bd066601d1f1c5a86e58e3134616d +char kNewtonVersion[] = "0.3-alpha-1408 (1d373949434bd066601d1f1c5a86e58e3134616d) (build 02-08-2023-15:20-pei@pei-G5-5500-Linux-5.15.0-58-generic-x86_64)"; +\n./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s +\n./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/26ebf8e71ea98e3335ccfdf39489ff272f95f5d5.txt b/analysis/statistics/26ebf8e71ea98e3335ccfdf39489ff272f95f5d5.txt new file mode 100644 index 000000000..4f5fa277f --- /dev/null +++ b/analysis/statistics/26ebf8e71ea98e3335ccfdf39489ff272f95f5d5.txt @@ -0,0 +1,46 @@ + +changeset: 1442:26ebf8e71ea98e3335ccfdf39489ff272f95f5d5 +char kNewtonVersion[] = "0.3-alpha-1442 (26ebf8e71ea98e3335ccfdf39489ff272f95f5d5) (build 03-05-2023-14:13-pei@pei-G5-5500-Linux-5.19.0-35-generic-x86_64)"; +\n./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s +\n./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/37f066bbf917f28ca09d3d6cbe00ac3452311685.txt b/analysis/statistics/37f066bbf917f28ca09d3d6cbe00ac3452311685.txt new file mode 100644 index 000000000..830c511d9 --- /dev/null +++ b/analysis/statistics/37f066bbf917f28ca09d3d6cbe00ac3452311685.txt @@ -0,0 +1,46 @@ + +changeset: 1440:37f066bbf917f28ca09d3d6cbe00ac3452311685 +char kNewtonVersion[] = "0.3-alpha-1440 (37f066bbf917f28ca09d3d6cbe00ac3452311685) (build 03-05-2023-13:12-pei@pei-G5-5500-Linux-5.19.0-35-generic-x86_64)"; +\n./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s +\n./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/3a22d91b7a572b5cf058e86905d84858238f6162.txt b/analysis/statistics/3a22d91b7a572b5cf058e86905d84858238f6162.txt new file mode 100644 index 000000000..44ee627d2 --- /dev/null +++ b/analysis/statistics/3a22d91b7a572b5cf058e86905d84858238f6162.txt @@ -0,0 +1,46 @@ + +changeset: 1429:3a22d91b7a572b5cf058e86905d84858238f6162 +char kNewtonVersion[] = "0.3-alpha-1429 (3a22d91b7a572b5cf058e86905d84858238f6162) (build 02-24-2023-15:58-pei@pei-G5-5500-Linux-5.19.0-32-generic-x86_64)"; +\n./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s +\n./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/44bd2fc9a6fc76c7cfabb6147d92d698c839dfd0.txt b/analysis/statistics/44bd2fc9a6fc76c7cfabb6147d92d698c839dfd0.txt index 577715b74..36fc11025 100644 --- a/analysis/statistics/44bd2fc9a6fc76c7cfabb6147d92d698c839dfd0.txt +++ b/analysis/statistics/44bd2fc9a6fc76c7cfabb6147d92d698c839dfd0.txt @@ -1,5 +1,4 @@ -changeset: 1400:44bd2fc9a6fc76c7cfabb6147d92d698c839dfd0 char kNewtonVersion[] = "0.3-alpha-1400 (44bd2fc9a6fc76c7cfabb6147d92d698c839dfd0) (build 01-30-2023-20:52-pei@pei-G5-5500-Linux-5.15.0-58-generic-x86_64)"; \n./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s \n./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt diff --git a/analysis/statistics/4936cbce481e0710ee93c7e43a9ed4e56642d789.txt b/analysis/statistics/4936cbce481e0710ee93c7e43a9ed4e56642d789.txt new file mode 100644 index 000000000..baf28337c --- /dev/null +++ b/analysis/statistics/4936cbce481e0710ee93c7e43a9ed4e56642d789.txt @@ -0,0 +1,46 @@ + +changeset: 1423:4936cbce481e0710ee93c7e43a9ed4e56642d789 +char kNewtonVersion[] = "0.3-alpha-1423 (4936cbce481e0710ee93c7e43a9ed4e56642d789) (build 02-16-2023-18:14-pei@pei-G5-5500-Linux-5.15.0-60-generic-x86_64)"; +\n./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s +\n./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/4bfa2d0a121213ecce446bdbf78ec95912e1d730.txt b/analysis/statistics/4bfa2d0a121213ecce446bdbf78ec95912e1d730.txt new file mode 100644 index 000000000..580523c1b --- /dev/null +++ b/analysis/statistics/4bfa2d0a121213ecce446bdbf78ec95912e1d730.txt @@ -0,0 +1,46 @@ + +changeset: 1417:4bfa2d0a121213ecce446bdbf78ec95912e1d730 +char kNewtonVersion[] = "0.3-alpha-1417 (4bfa2d0a121213ecce446bdbf78ec95912e1d730) (build 02-13-2023-16:31-pei@pei-G5-5500-Linux-5.15.0-60-generic-x86_64)"; +\n./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s +\n./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/50853c4c093bc791a4286698020e6b2fdef4176c.txt b/analysis/statistics/50853c4c093bc791a4286698020e6b2fdef4176c.txt new file mode 100644 index 000000000..06f8484bf --- /dev/null +++ b/analysis/statistics/50853c4c093bc791a4286698020e6b2fdef4176c.txt @@ -0,0 +1,46 @@ + +changeset: 1441:50853c4c093bc791a4286698020e6b2fdef4176c +char kNewtonVersion[] = "0.3-alpha-1441 (50853c4c093bc791a4286698020e6b2fdef4176c) (build 03-05-2023-13:30-pei@pei-G5-5500-Linux-5.19.0-35-generic-x86_64)"; +\n./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s +\n./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/53024717dfb9095b05f35147fa0359ec292d348d.txt b/analysis/statistics/53024717dfb9095b05f35147fa0359ec292d348d.txt new file mode 100644 index 000000000..67a756f3b --- /dev/null +++ b/analysis/statistics/53024717dfb9095b05f35147fa0359ec292d348d.txt @@ -0,0 +1,46 @@ + +changeset: 1430:53024717dfb9095b05f35147fa0359ec292d348d +char kNewtonVersion[] = "0.3-alpha-1430 (53024717dfb9095b05f35147fa0359ec292d348d) (build 02-25-2023-12:54-pei@pei-G5-5500-Linux-5.19.0-32-generic-x86_64)"; +\n./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s +\n./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/6169327c2c115ce220064f7b5cbd22d78d74eb33.txt b/analysis/statistics/6169327c2c115ce220064f7b5cbd22d78d74eb33.txt new file mode 100644 index 000000000..28f130d87 --- /dev/null +++ b/analysis/statistics/6169327c2c115ce220064f7b5cbd22d78d74eb33.txt @@ -0,0 +1,46 @@ + +changeset: 1416:6169327c2c115ce220064f7b5cbd22d78d74eb33 +char kNewtonVersion[] = "0.3-alpha-1416 (6169327c2c115ce220064f7b5cbd22d78d74eb33) (build 02-13-2023-15:10-pei@pei-G5-5500-Linux-5.15.0-60-generic-x86_64)"; +\n./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s +\n./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/6449464c04d4a6ee7ff655104c9cf3e3ef96b459.txt b/analysis/statistics/6449464c04d4a6ee7ff655104c9cf3e3ef96b459.txt new file mode 100644 index 000000000..a0d42bae2 --- /dev/null +++ b/analysis/statistics/6449464c04d4a6ee7ff655104c9cf3e3ef96b459.txt @@ -0,0 +1,46 @@ + +changeset: 1414:6449464c04d4a6ee7ff655104c9cf3e3ef96b459 +char kNewtonVersion[] = "0.3-alpha-1414 (6449464c04d4a6ee7ff655104c9cf3e3ef96b459) (build 02-10-2023-13:05-pei@pei-G5-5500-Linux-5.15.0-58-generic-x86_64)"; +\n./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s +\n./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/646e82975915b2408b0987a6f62eeefcc365cda0.txt b/analysis/statistics/646e82975915b2408b0987a6f62eeefcc365cda0.txt new file mode 100644 index 000000000..9bacb6aa6 --- /dev/null +++ b/analysis/statistics/646e82975915b2408b0987a6f62eeefcc365cda0.txt @@ -0,0 +1,46 @@ + +changeset: 1432:646e82975915b2408b0987a6f62eeefcc365cda0 +char kNewtonVersion[] = "0.3-alpha-1432 (646e82975915b2408b0987a6f62eeefcc365cda0) (build 02-25-2023-16:54-pei@pei-G5-5500-Linux-5.19.0-32-generic-x86_64)"; +\n./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s +\n./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/649a2d8329ccc1d31240bf7535919071d68c7d97.txt b/analysis/statistics/649a2d8329ccc1d31240bf7535919071d68c7d97.txt new file mode 100644 index 000000000..df190a131 --- /dev/null +++ b/analysis/statistics/649a2d8329ccc1d31240bf7535919071d68c7d97.txt @@ -0,0 +1,46 @@ + +changeset: 1409:649a2d8329ccc1d31240bf7535919071d68c7d97 +char kNewtonVersion[] = "0.3-alpha-1409 (649a2d8329ccc1d31240bf7535919071d68c7d97) (build 02-09-2023-15:31-pei@pei-G5-5500-Linux-5.15.0-58-generic-x86_64)"; +\n./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s +\n./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/658fcc1fa3686f0d5fee443c41ef15f6cc736acf.txt b/analysis/statistics/658fcc1fa3686f0d5fee443c41ef15f6cc736acf.txt new file mode 100644 index 000000000..f689dae67 --- /dev/null +++ b/analysis/statistics/658fcc1fa3686f0d5fee443c41ef15f6cc736acf.txt @@ -0,0 +1,46 @@ + +changeset: 1431:658fcc1fa3686f0d5fee443c41ef15f6cc736acf +char kNewtonVersion[] = "0.3-alpha-1431 (658fcc1fa3686f0d5fee443c41ef15f6cc736acf) (build 02-25-2023-15:38-pei@pei-G5-5500-Linux-5.19.0-32-generic-x86_64)"; +\n./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s +\n./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/7385c61b2f59881996e74fb6559d2878d9fb5e25.txt b/analysis/statistics/7385c61b2f59881996e74fb6559d2878d9fb5e25.txt new file mode 100644 index 000000000..c9f2ae73b --- /dev/null +++ b/analysis/statistics/7385c61b2f59881996e74fb6559d2878d9fb5e25.txt @@ -0,0 +1,46 @@ + +changeset: 1405:7385c61b2f59881996e74fb6559d2878d9fb5e25 +char kNewtonVersion[] = "0.3-alpha-1405 (7385c61b2f59881996e74fb6559d2878d9fb5e25) (build 01-30-2023-21:26-pei@pei-G5-5500-Linux-5.15.0-58-generic-x86_64)"; +\n./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s +\n./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/77e9b64be9282e1325602ee373eb4eb470a4495f.txt b/analysis/statistics/77e9b64be9282e1325602ee373eb4eb470a4495f.txt new file mode 100644 index 000000000..90d75560b --- /dev/null +++ b/analysis/statistics/77e9b64be9282e1325602ee373eb4eb470a4495f.txt @@ -0,0 +1,46 @@ + +changeset: 1435:77e9b64be9282e1325602ee373eb4eb470a4495f +char kNewtonVersion[] = "0.3-alpha-1435 (77e9b64be9282e1325602ee373eb4eb470a4495f) (build 03-02-2023-19:45-pei@pei-G5-5500-Linux-5.19.0-32-generic-x86_64)"; +\n./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s +\n./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/81f9462ff95e4b303471ddc2502e19f1f6868db5.txt b/analysis/statistics/81f9462ff95e4b303471ddc2502e19f1f6868db5.txt new file mode 100644 index 000000000..e93f7c207 --- /dev/null +++ b/analysis/statistics/81f9462ff95e4b303471ddc2502e19f1f6868db5.txt @@ -0,0 +1,46 @@ + +changeset: 1424:81f9462ff95e4b303471ddc2502e19f1f6868db5 +char kNewtonVersion[] = "0.3-alpha-1424 (81f9462ff95e4b303471ddc2502e19f1f6868db5) (build 02-17-2023-16:02-pei@pei-G5-5500-Linux-5.15.0-60-generic-x86_64)"; +\n./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s +\n./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/9132381e495b34811ace20289da67bb822908d1d.txt b/analysis/statistics/9132381e495b34811ace20289da67bb822908d1d.txt new file mode 100644 index 000000000..de9aba712 --- /dev/null +++ b/analysis/statistics/9132381e495b34811ace20289da67bb822908d1d.txt @@ -0,0 +1,46 @@ + +changeset: 1412:9132381e495b34811ace20289da67bb822908d1d +char kNewtonVersion[] = "0.3-alpha-1412 (9132381e495b34811ace20289da67bb822908d1d) (build 02-09-2023-18:19-pei@pei-G5-5500-Linux-5.15.0-58-generic-x86_64)"; +\n./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s +\n./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/9451fc54ff74e18995a618892a81e379c22337e5.txt b/analysis/statistics/9451fc54ff74e18995a618892a81e379c22337e5.txt new file mode 100644 index 000000000..d48f8965f --- /dev/null +++ b/analysis/statistics/9451fc54ff74e18995a618892a81e379c22337e5.txt @@ -0,0 +1,46 @@ + +changeset: 1406:9451fc54ff74e18995a618892a81e379c22337e5 +char kNewtonVersion[] = "0.3-alpha-1406 (9451fc54ff74e18995a618892a81e379c22337e5) (build 02-07-2023-10:21-pei@pei-G5-5500-Linux-5.15.0-58-generic-x86_64)"; +\n./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s +\n./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/9ca25f4d67143a61a85121b62f95bc87ec99e385.txt b/analysis/statistics/9ca25f4d67143a61a85121b62f95bc87ec99e385.txt new file mode 100644 index 000000000..f8b3fb344 --- /dev/null +++ b/analysis/statistics/9ca25f4d67143a61a85121b62f95bc87ec99e385.txt @@ -0,0 +1,46 @@ + +changeset: 1428:9ca25f4d67143a61a85121b62f95bc87ec99e385 +char kNewtonVersion[] = "0.3-alpha-1428 (9ca25f4d67143a61a85121b62f95bc87ec99e385) (build 02-23-2023-20:27-pei@pei-G5-5500-Linux-5.19.0-32-generic-x86_64)"; +\n./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s +\n./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/a777779defc6959f2156f52a422f8de0fa6eefc5.txt b/analysis/statistics/a777779defc6959f2156f52a422f8de0fa6eefc5.txt new file mode 100644 index 000000000..897e79d4f --- /dev/null +++ b/analysis/statistics/a777779defc6959f2156f52a422f8de0fa6eefc5.txt @@ -0,0 +1,46 @@ + +changeset: 1417:a777779defc6959f2156f52a422f8de0fa6eefc5 +char kNewtonVersion[] = "0.3-alpha-1417 (a777779defc6959f2156f52a422f8de0fa6eefc5) (build 02-15-2023-15:43-pei@pei-G5-5500-Linux-5.15.0-60-generic-x86_64)"; +\n./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s +\n./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/bf69474eb3106f20c20836c3200a14c0309087fd.txt b/analysis/statistics/bf69474eb3106f20c20836c3200a14c0309087fd.txt new file mode 100644 index 000000000..5b46f5e87 --- /dev/null +++ b/analysis/statistics/bf69474eb3106f20c20836c3200a14c0309087fd.txt @@ -0,0 +1,46 @@ + +changeset: 1419:bf69474eb3106f20c20836c3200a14c0309087fd +char kNewtonVersion[] = "0.3-alpha-1419 (bf69474eb3106f20c20836c3200a14c0309087fd) (build 02-15-2023-15:52-pei@pei-G5-5500-Linux-5.15.0-60-generic-x86_64)"; +\n./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s +\n./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/bf8512d6a1a6fa55b61748bf00fbda41c3648b38.txt b/analysis/statistics/bf8512d6a1a6fa55b61748bf00fbda41c3648b38.txt new file mode 100644 index 000000000..35d060f0a --- /dev/null +++ b/analysis/statistics/bf8512d6a1a6fa55b61748bf00fbda41c3648b38.txt @@ -0,0 +1,46 @@ + +changeset: 1434:bf8512d6a1a6fa55b61748bf00fbda41c3648b38 +char kNewtonVersion[] = "0.3-alpha-1434 (bf8512d6a1a6fa55b61748bf00fbda41c3648b38) (build 03-02-2023-15:11-pei@pei-G5-5500-Linux-5.19.0-32-generic-x86_64)"; +\n./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s +\n./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/c96fd9b0f8db00a6ec78574f16f6f70f4f848484.txt b/analysis/statistics/c96fd9b0f8db00a6ec78574f16f6f70f4f848484.txt new file mode 100644 index 000000000..22c1b578e --- /dev/null +++ b/analysis/statistics/c96fd9b0f8db00a6ec78574f16f6f70f4f848484.txt @@ -0,0 +1,46 @@ + +changeset: 1420:c96fd9b0f8db00a6ec78574f16f6f70f4f848484 +char kNewtonVersion[] = "0.3-alpha-1420 (c96fd9b0f8db00a6ec78574f16f6f70f4f848484) (build 02-15-2023-20:51-pei@pei-G5-5500-Linux-5.15.0-60-generic-x86_64)"; +\n./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s +\n./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/d2fa8be0272cb67fb4ab20a81c80256ceb71f260.txt b/analysis/statistics/d2fa8be0272cb67fb4ab20a81c80256ceb71f260.txt new file mode 100644 index 000000000..078efc6aa --- /dev/null +++ b/analysis/statistics/d2fa8be0272cb67fb4ab20a81c80256ceb71f260.txt @@ -0,0 +1,46 @@ + +changeset: 1421:d2fa8be0272cb67fb4ab20a81c80256ceb71f260 +char kNewtonVersion[] = "0.3-alpha-1421 (d2fa8be0272cb67fb4ab20a81c80256ceb71f260) (build 02-15-2023-21:10-pei@pei-G5-5500-Linux-5.15.0-60-generic-x86_64)"; +\n./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s +\n./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/dc80804bccd819d32d1bc4da2c28d8efad013182.txt b/analysis/statistics/dc80804bccd819d32d1bc4da2c28d8efad013182.txt new file mode 100644 index 000000000..543bd73d0 --- /dev/null +++ b/analysis/statistics/dc80804bccd819d32d1bc4da2c28d8efad013182.txt @@ -0,0 +1,46 @@ + +changeset: 1403:dc80804bccd819d32d1bc4da2c28d8efad013182 +char kNewtonVersion[] = "0.3-alpha-1403 (dc80804bccd819d32d1bc4da2c28d8efad013182) (build 02-17-2023-15:33-pei@pei-G5-5500-Linux-5.15.0-60-generic-x86_64)"; +\n./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s +\n./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/e9c0fc3dccf2840185f9901459961c3a938e32b3.txt b/analysis/statistics/e9c0fc3dccf2840185f9901459961c3a938e32b3.txt new file mode 100644 index 000000000..a4457bb13 --- /dev/null +++ b/analysis/statistics/e9c0fc3dccf2840185f9901459961c3a938e32b3.txt @@ -0,0 +1,46 @@ + +changeset: 1422:e9c0fc3dccf2840185f9901459961c3a938e32b3 +char kNewtonVersion[] = "0.3-alpha-1422 (e9c0fc3dccf2840185f9901459961c3a938e32b3) (build 02-16-2023-17:30-pei@pei-G5-5500-Linux-5.15.0-60-generic-x86_64)"; +\n./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s +\n./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/eb1ebf3d3a5c78c3f4417caaa52d004a0109deb6.txt b/analysis/statistics/eb1ebf3d3a5c78c3f4417caaa52d004a0109deb6.txt new file mode 100644 index 000000000..82d1809e3 --- /dev/null +++ b/analysis/statistics/eb1ebf3d3a5c78c3f4417caaa52d004a0109deb6.txt @@ -0,0 +1,46 @@ + +changeset: 1399:eb1ebf3d3a5c78c3f4417caaa52d004a0109deb6 +char kNewtonVersion[] = "0.3-alpha-1399 (eb1ebf3d3a5c78c3f4417caaa52d004a0109deb6) (build 01-26-2023-22:09-pei@pei-G5-5500-Linux-5.15.0-58-generic-x86_64)"; +\n./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s +\n./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/ef50ec57407726b279e3fa5e8b4c3579b7988507.txt b/analysis/statistics/ef50ec57407726b279e3fa5e8b4c3579b7988507.txt new file mode 100644 index 000000000..7ecf77551 --- /dev/null +++ b/analysis/statistics/ef50ec57407726b279e3fa5e8b4c3579b7988507.txt @@ -0,0 +1,46 @@ + +changeset: 1413:ef50ec57407726b279e3fa5e8b4c3579b7988507 +char kNewtonVersion[] = "0.3-alpha-1413 (ef50ec57407726b279e3fa5e8b4c3579b7988507) (build 02-09-2023-21:43-pei@pei-G5-5500-Linux-5.15.0-58-generic-x86_64)"; +\n./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s +\n./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/f0821bf09e85a86666917a1ea3425adabd9f6a67.txt b/analysis/statistics/f0821bf09e85a86666917a1ea3425adabd9f6a67.txt new file mode 100644 index 000000000..c5a39e22d --- /dev/null +++ b/analysis/statistics/f0821bf09e85a86666917a1ea3425adabd9f6a67.txt @@ -0,0 +1,46 @@ + +changeset: 1411:f0821bf09e85a86666917a1ea3425adabd9f6a67 +char kNewtonVersion[] = "0.3-alpha-1411 (f0821bf09e85a86666917a1ea3425adabd9f6a67) (build 02-09-2023-18:06-pei@pei-G5-5500-Linux-5.15.0-58-generic-x86_64)"; +\n./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s +\n./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/f21c4e3302318d963ae0e17067839698f3dabebf.txt b/analysis/statistics/f21c4e3302318d963ae0e17067839698f3dabebf.txt new file mode 100644 index 000000000..712390660 --- /dev/null +++ b/analysis/statistics/f21c4e3302318d963ae0e17067839698f3dabebf.txt @@ -0,0 +1,46 @@ + +changeset: 1443:f21c4e3302318d963ae0e17067839698f3dabebf +char kNewtonVersion[] = "0.3-alpha-1443 (f21c4e3302318d963ae0e17067839698f3dabebf) (build 03-06-2023-20:47-pei@pei-G5-5500-Linux-5.19.0-35-generic-x86_64)"; +\n./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s +\n./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/analysis/statistics/fbf4365a5034211698fbc204238e2ab9623256e4.txt b/analysis/statistics/fbf4365a5034211698fbc204238e2ab9623256e4.txt new file mode 100644 index 000000000..027f1fb9c --- /dev/null +++ b/analysis/statistics/fbf4365a5034211698fbc204238e2ab9623256e4.txt @@ -0,0 +1,46 @@ + +changeset: 1433:fbf4365a5034211698fbc204238e2ab9623256e4 +char kNewtonVersion[] = "0.3-alpha-1433 (fbf4365a5034211698fbc204238e2ab9623256e4) (build 02-28-2023-15:20-pei@pei-G5-5500-Linux-5.19.0-32-generic-x86_64)"; +\n./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s +\n./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt + +Informational Report: +--------------------- +Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)... + + Kernel 0 is a valid kernel: + + 1 1 + -0.5 -0 + 1 0 + 0.5 0 + 0 -1 + -0 -1 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0) + + Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1) + + + Kernel 1 is a valid kernel: + + 1 0 + -0.5 1 + 1 -2 + 0.5 -1 + -0 -2 + 0 -2 + + + The ordering of parameters is: P1 P0 P3 P2 P4 P5 + + Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0) + + Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2) + + + + diff --git a/applications/newton/llvm-ir/Makefile b/applications/newton/llvm-ir/Makefile index d4be0cfeb..c2963a9c8 100644 --- a/applications/newton/llvm-ir/Makefile +++ b/applications/newton/llvm-ir/Makefile @@ -18,7 +18,7 @@ endif all: default -default: application.ll simple_control_flow.ll inferBound.ll inferBoundControlFlow.ll e_exp.ll sincosf.ll e_log.ll e_acosh.ll e_j0.ll e_y0.ll e_rem_pio2.ll benchmark_suite.ll phi_two_global_arrays.ll func_call.ll +default: application.ll simple_control_flow.ll inferBound.ll inferBoundControlFlow.ll e_exp.ll sincosf.ll e_log.ll e_acosh.ll e_j0.ll e_y0.ll e_rem_pio2.ll benchmark_suite.ll phi_two_global_arrays.ll func_call.ll test_shift.ll vec_add.ll vec_add_8.ll %.ll : %.c @echo Compiling $*.c diff --git a/applications/newton/llvm-ir/c-files/test_shift.c b/applications/newton/llvm-ir/c-files/test_shift.c new file mode 100644 index 000000000..ae28eb292 --- /dev/null +++ b/applications/newton/llvm-ir/c-files/test_shift.c @@ -0,0 +1,27 @@ +// +// Created by pei on 23/02/23. +// + +#include +#include + +typedef double bmx055xAcceleration; +typedef double bmx055yAcceleration; + +int32_t testFunc(bmx055xAcceleration a, bmx055yAcceleration b) { + printf("%f, %f\n", a, b); + int64_t res1 = (int64_t)b >> 3; + printf("res1 = %ld\n", res1); + int32_t res2 = (int32_t)a << 4; + printf("res2 = %d\n", res2); + int16_t res3 = (int16_t)a >> (int8_t)(b+40); + printf("res3 = %d\n", res3); + int32_t res4 = (uint64_t)a >> 52; + printf("res4 = %d\n", res4); + return res1 + res2 + res3 + res4; +} + +int main() { + int32_t res = testFunc(-532.4, -37.9); + printf("res = %d\n", res); +} \ No newline at end of file diff --git a/applications/newton/llvm-ir/c-files/vec_add.c b/applications/newton/llvm-ir/c-files/vec_add.c new file mode 100644 index 000000000..d23fb2e1b --- /dev/null +++ b/applications/newton/llvm-ir/c-files/vec_add.c @@ -0,0 +1,80 @@ +/* + * compile with 'clang --target=aarch64-arm-none-eabi -O1 vec_add.c -o vec_add -fvectorize' + * */ + +#include +#include +#include +#include +#include + +typedef struct timespec timespec; +timespec diff(timespec start, timespec end) +{ + timespec temp; + if ((end.tv_nsec-start.tv_nsec)<0) { + temp.tv_sec = end.tv_sec-start.tv_sec-1; + temp.tv_nsec = 1000000000+end.tv_nsec-start.tv_nsec; + } else { + temp.tv_sec = end.tv_sec-start.tv_sec; + temp.tv_nsec = end.tv_nsec-start.tv_nsec; + } + return temp; +} + +timespec sum(timespec t1, timespec t2) { + timespec temp; + if (t1.tv_nsec + t2.tv_nsec >= 1000000000) { + temp.tv_sec = t1.tv_sec + t2.tv_sec + 1; + temp.tv_nsec = t1.tv_nsec + t2.tv_nsec - 1000000000; + } else { + temp.tv_sec = t1.tv_sec + t2.tv_sec; + temp.tv_nsec = t1.tv_nsec + t2.tv_nsec; + } + return temp; +} + +void printTimeSpec(timespec t, const char* prefix) { + printf("%s: %d.%09d\n", prefix, (int)t.tv_sec, (int)t.tv_nsec); +} + +timespec tic( ) +{ + timespec start_time; + clock_gettime(CLOCK_REALTIME, &start_time); + return start_time; +} + +void toc( timespec* start_time, const char* prefix ) +{ + timespec current_time; + clock_gettime(CLOCK_REALTIME, ¤t_time); + printTimeSpec( diff( *start_time, current_time ), prefix ); + *start_time = current_time; +} + +typedef int32_t bmx055fAcceleration; + +#define NUM 102400 + +void vec_add(bmx055fAcceleration *vec_A, bmx055fAcceleration *vec_B, bmx055fAcceleration *vec_C, int len_vec) { + int i; + for (i=0; i +#include +#include +#include +#include + +typedef struct timespec timespec; +timespec diff(timespec start, timespec end) +{ + timespec temp; + if ((end.tv_nsec-start.tv_nsec)<0) { + temp.tv_sec = end.tv_sec-start.tv_sec-1; + temp.tv_nsec = 1000000000+end.tv_nsec-start.tv_nsec; + } else { + temp.tv_sec = end.tv_sec-start.tv_sec; + temp.tv_nsec = end.tv_nsec-start.tv_nsec; + } + return temp; +} + +timespec sum(timespec t1, timespec t2) { + timespec temp; + if (t1.tv_nsec + t2.tv_nsec >= 1000000000) { + temp.tv_sec = t1.tv_sec + t2.tv_sec + 1; + temp.tv_nsec = t1.tv_nsec + t2.tv_nsec - 1000000000; + } else { + temp.tv_sec = t1.tv_sec + t2.tv_sec; + temp.tv_nsec = t1.tv_nsec + t2.tv_nsec; + } + return temp; +} + +void printTimeSpec(timespec t, const char* prefix) { + printf("%s: %d.%09d\n", prefix, (int)t.tv_sec, (int)t.tv_nsec); +} + +timespec tic( ) +{ + timespec start_time; + clock_gettime(CLOCK_REALTIME, &start_time); + return start_time; +} + +void toc( timespec* start_time, const char* prefix ) +{ + timespec current_time; + clock_gettime(CLOCK_REALTIME, ¤t_time); + printTimeSpec( diff( *start_time, current_time ), prefix ); + *start_time = current_time; +} + +#define NUM 102400 + +void vec_add(int8_t *vec_A, int8_t *vec_B, int8_t *vec_C, int len_vec) { + int i; + for (i=0; i err.log` + * */ #include #include @@ -8,12 +10,39 @@ #include #include #include -#include #include +#include #include +#include +#include #include -int64_t getCount(const std::string& string, size_t position) { +const size_t iteration_num = 5; +const size_t result_num = 5; + +struct perfData { + int64_t inst_count_avg; + int64_t time_consumption_avg; + int64_t ir_lines; + int64_t library_size; + std::vector function_results; +}; + +struct timerData { + int64_t inst_count_avg = -1; + double time_consumption_avg; + std::vector ms_time_consumption; + int64_t ir_lines; + int64_t library_size; + std::vector function_results; +}; + +/* + * Get number from: + * 36,200,478 instructions + * 0.013535825 seconds time elapsed + * */ +int64_t getPerfCount(const std::string& string, size_t position) { std::string substring; substring = string.substr(0, position); substring.erase( @@ -29,13 +58,41 @@ int64_t getCount(const std::string& string, size_t position) { return std::stoi(substring); } -std::pair processData(const std::string test_case, const std::string params) { +/* + * Get number from: + * computation delay: 0.001342399 + * */ +double getTimerConsumption(const std::string& string, size_t position) { + std::string substring; + substring = string.substr(position, string.size()); + return std::stod(substring); +} + +/* + * Get number from: + * results: 0.517104 0.809373 0.043233 -0.805564 -0.973201 + * */ +std::vector getFunctionResults(const std::string& string, size_t position) { + std::vector res; + std::stringstream ss; + std::string tmp; + ss << string; + double number; + while (!ss.eof()) { + ss >> tmp; + if (std::stringstream(tmp) >> number) + res.emplace_back(number); + } + return res; +} + +std::pair processDataPerf(const std::string test_case, const std::string params) { std::string line; size_t position; int64_t inst_count, time_consumption; // perf command - std::string cmd = "make " + test_case; + std::string cmd = "make " + test_case + " >& compile.log"; system(cmd.data()); cmd.clear(); cmd = "perf stat -B ./main_out " + params; @@ -53,22 +110,62 @@ std::pair processData(const std::string test_case, const std:: while (getline(ifs, line)) { position = line.find("instructions"); if (position != std::string::npos) { - inst_count = getCount(line, position); + inst_count = getPerfCount(line, position); } position = line.find("seconds time elapsed"); if (position != std::string::npos) { - time_consumption = getCount(line, position); + time_consumption = getPerfCount(line, position); continue; } } - printf("%lu\t%lu\n", inst_count, time_consumption); +// printf("%lu\t%lu\n", inst_count, time_consumption); ifs.close(); return std::make_pair(inst_count, time_consumption); } +std::pair> processDataTimer(const std::string test_case, const std::string params) { + std::string line; + size_t position; + double time_consumption; + std::vector function_results; + + // perf command + std::string cmd = "make " + test_case + " >& compile.log"; + system(cmd.data()); + cmd.clear(); + cmd = "./main_out " + params; + cmd += " 2>&1 | tee tmp.log"; + system(cmd.data()); + std::ifstream ifs("tmp.log"); + if (!ifs.is_open()) { + std::cout << "error opening tmp.log"; + assert(false); + } + + // process + while (getline(ifs, line)) { + std::string key = "computation delay: "; + position = line.find(key); + if (position != std::string::npos) { + time_consumption = getTimerConsumption(line, position+key.size()); + } + key = "results: "; + position = line.find(key); + if (position != std::string::npos) { + function_results = getFunctionResults(line, position+key.size()); + } + } + +// printf("%f\n", time_consumption); + + ifs.close(); + + return std::make_pair(time_consumption, function_results); +} + std::string change_nt_range(const std::string& cmd1, const std::string& cmd2, const std::vector& params) { std::string param_str; std::string change_nt_cmd; @@ -112,39 +209,31 @@ int64_t exactNumber() { } int64_t getIrLines() { - std::string cmd = "wc -l out.ll 2>&1 | tee tmp.log"; + std::string cmd = "wc -l out.ll >& tmp.log"; system(cmd.data()); return exactNumber(); } int64_t getLibSize() { - std::string cmd = "wc -c libout.a 2>&1 | tee tmp.log"; + std::string cmd = "wc -c libout.a >& tmp.log"; system(cmd.data()); return exactNumber(); } -struct perfData { - int64_t inst_count_avg; - int64_t time_consumption_avg; - int64_t ir_lines; - int64_t library_size; -}; - struct perfData recordData(const std::string& test_cases, const std::string& param_str, std::ofstream& ofs) { - const size_t iteration_num = 5; - perfData perf_data = {0, 0, 0, 0}; for (size_t idx = 0; idx < iteration_num; idx++) { - const std::pair inst_time_data = processData(test_cases, param_str); + const std::pair inst_time_data = processDataPerf(test_cases, param_str); perf_data.inst_count_avg += (inst_time_data.first/1000); perf_data.time_consumption_avg += (inst_time_data.second/1000); } perf_data.inst_count_avg /= iteration_num; perf_data.time_consumption_avg /= iteration_num; + // check library size perf_data.ir_lines = getIrLines(); perf_data.library_size = getLibSize(); @@ -154,6 +243,37 @@ struct perfData recordData(const std::string& test_cases, const std::string& par return perf_data; } +struct timerData recordTimerData(const std::string& test_cases, const std::string& param_str, std::ofstream& ofs) { + timerData timer_data; + + for (size_t idx = 0; idx < iteration_num; idx++) { + const std::pair> data_timer_res = processDataTimer(test_cases, param_str); + timer_data.ms_time_consumption.emplace_back(data_timer_res.first); + std::copy_if(data_timer_res.second.begin(), data_timer_res.second.end(), + std::back_inserter(timer_data.function_results), + [test_cases, param_str, timer_data, data_timer_res](double val) { + if (!timer_data.function_results.empty()) { + if (!std::equal(timer_data.function_results.begin(), timer_data.function_results.end(), + data_timer_res.second.begin())) + std::cerr << "result error within iteration: " << test_cases << " with parameters: " << param_str << std::endl; + return false; + } else + return true; + }); + } + // check library size + timer_data.ir_lines = getIrLines(); + timer_data.library_size = getLibSize(); + + ofs << test_cases << "\t" << param_str << "\t" << timer_data.inst_count_avg + << "\t" << std::accumulate(timer_data.ms_time_consumption.begin(), + timer_data.ms_time_consumption.end(), + 0.0) / timer_data.ms_time_consumption.size() + << "\t" << timer_data.ir_lines << "\t" << timer_data.library_size << std::endl; + + return timer_data; +} + int main(int argc, char** argv) { std::vector test_cases{ "perf_exp", "perf_log", @@ -187,7 +307,7 @@ int main(int argc, char** argv) { {-0.9, -0.4}, {0.2, 0.8}, {9.7, 10.5}, - {35.75, 36.03}, + {35.75, 36.33}, {476.84, 477.21}, {999.8, 1000.9} }; @@ -238,17 +358,60 @@ int main(int argc, char** argv) { {p.front(), p.back()-1+extend}); const double p1 = p.front() + 0.6; const double p2 = p.back() + 0.3; - change_nt_range("sed -i 's/1 mjf, 16 mjf/", "/g' ../../sensors/test.nt", {p1, p2-1+extend}); - - perfData ori_perf_data = recordData(test_cases[case_id], param_str, ofs); - perfData opt_perf_data = recordData(test_cases[case_id] + "_opt", param_str, ofs); - - int inst_speedup = round((ori_perf_data.inst_count_avg - opt_perf_data.inst_count_avg) * 100 / opt_perf_data.inst_count_avg); - int time_speedup = round((ori_perf_data.time_consumption_avg - opt_perf_data.time_consumption_avg) * 100 / opt_perf_data.time_consumption_avg); + change_nt_range("sed -i 's/15 mjf, 36 mjf/", "/g' ../../sensors/test.nt", {p1, p2-1+extend}); + +// perfData ori_perf_data = recordData(test_cases[case_id], param_str, ofs); +// perfData opt_perf_data = recordData(test_cases[case_id] + "_opt", param_str, ofs); + timerData ori_perf_data = recordTimerData(test_cases[case_id], param_str, ofs); + timerData opt_perf_data = recordTimerData(test_cases[case_id] + "_opt", param_str, ofs); + + // check function results + if (!std::equal(ori_perf_data.function_results.begin(), ori_perf_data.function_results.end(), + opt_perf_data.function_results.begin())) { + std::cerr << "result error: " << test_cases[case_id] << " with parameters: " << param_str << + "ori: " << ori_perf_data.function_results[0] << ", opt: " << opt_perf_data.function_results[0] << + std::endl; + } + + // remove element if ori < opt + assert(ori_perf_data.ms_time_consumption.size() == opt_perf_data.ms_time_consumption.size()); + auto itOri = ori_perf_data.ms_time_consumption.begin(); + for (auto itOpt = opt_perf_data.ms_time_consumption.begin(); + itOpt != opt_perf_data.ms_time_consumption.end();) { + if (*itOri < *itOpt) { +// assert(false && "Need to check why this case slow down!!!!!!"); + itOri = ori_perf_data.ms_time_consumption.erase(itOri); + itOpt = opt_perf_data.ms_time_consumption.erase(itOpt); + } else { + itOri++; + itOpt++; + } + } + + int inst_speedup, time_speedup; + if (ori_perf_data.ms_time_consumption.empty()) { + assert(opt_perf_data.ms_time_consumption.empty() && "erase mis-match!"); + inst_speedup = 0; + time_speedup = 0; + } else { + ori_perf_data.time_consumption_avg = std::accumulate(ori_perf_data.ms_time_consumption.begin(), + ori_perf_data.ms_time_consumption.end(), + 0.0) / ori_perf_data.ms_time_consumption.size(); + opt_perf_data.time_consumption_avg = std::accumulate(opt_perf_data.ms_time_consumption.begin(), + opt_perf_data.ms_time_consumption.end(), + 0.0) / opt_perf_data.ms_time_consumption.size(); + + inst_speedup = round((ori_perf_data.inst_count_avg - opt_perf_data.inst_count_avg) + * 100 / opt_perf_data.inst_count_avg); + time_speedup = round((ori_perf_data.time_consumption_avg - opt_perf_data.time_consumption_avg) + * 100 / opt_perf_data.time_consumption_avg); + } int ir_reduce = round((ori_perf_data.ir_lines - opt_perf_data.ir_lines) * 100 / opt_perf_data.ir_lines); int lib_size_reduce = round((ori_perf_data.library_size - opt_perf_data.library_size) * 100 / opt_perf_data.library_size); ofs << "speed up after optimization\t" << param_str << "\t" << inst_speedup << "%\t" << time_speedup << "%\t" << ir_reduce << "%\t" << lib_size_reduce << "%" << std::endl; + std::cout << test_cases[case_id] << ": speed up after optimization\t" << param_str << "\t" << inst_speedup << "%\t" << time_speedup << "%\t" + << ir_reduce << "%\t" << lib_size_reduce << "%" << std::endl; avg_inst_speedup += inst_speedup; avg_time_speedup += time_speedup; @@ -258,7 +421,7 @@ int main(int argc, char** argv) { // reset test.nt change_nt_range("sed -i 's/", "/3 mjf, 10 mjf/g' ../../sensors/test.nt", {p.front(), p.back()-1+extend}); - change_nt_range("sed -i 's/", "/1 mjf, 16 mjf/g' ../../sensors/test.nt", {p1, p2-1+extend}); + change_nt_range("sed -i 's/", "/15 mjf, 36 mjf/g' ../../sensors/test.nt", {p1, p2-1+extend}); } avg_inst_speedup = round(avg_inst_speedup / parameters.size()); avg_time_speedup = round(avg_time_speedup / parameters.size()); @@ -268,7 +431,7 @@ int main(int argc, char** argv) { << avg_time_speedup << "%\t" << avg_ir_reduce << "%\t" << avg_lib_size_reduce << "%" << std::endl; if (test_cases[case_id] == "perf_float64_sin") { - // trigonometricParams cannot have extend + // trigonometricParams cannot have extent break; } } diff --git a/applications/newton/llvm-ir/performance_test/main.c b/applications/newton/llvm-ir/performance_test/main.c index 8f3573035..4c646a4fa 100644 --- a/applications/newton/llvm-ir/performance_test/main.c +++ b/applications/newton/llvm-ir/performance_test/main.c @@ -42,6 +42,10 @@ #include "../c-files/perf_test_api.h" #include "../c-files/fdlibm.h" +/*************************************** + * Timer functions of the test framework + ***************************************/ + typedef struct timespec timespec; timespec diff(timespec start, timespec end) { @@ -87,6 +91,10 @@ void toc( timespec* start_time, const char* prefix ) *start_time = current_time; } +/********************************************** + * Random value generator of the test framework + **********************************************/ + static bmx055xMagneto randomInt(bmx055xMagneto min, bmx055xMagneto max) { @@ -121,46 +129,43 @@ randomFloat(bmx055fAcceleration min, bmx055fAcceleration max) /* * random integer array, [min, max] * */ -static bmx055xMagneto randIntValue[iteration_num]; -bmx055xMagneto* -randomIntArr(bmx055xMagneto min, bmx055xMagneto max) +static void +randomIntArr(bmx055xMagneto *randIntValue, bmx055xMagneto min, bmx055xMagneto max) { for (size_t idx = 0; idx < iteration_num; idx++) { randIntValue[idx] = (rand() % max) + 1; } - return randIntValue; } /* * random double array, [min, max] * */ -static bmx055zAcceleration randDoubleValue[iteration_num]; -bmx055zAcceleration* -randomDoubleArr(bmx055zAcceleration min, bmx055zAcceleration max) +static void +randomDoubleArr(bmx055zAcceleration *randDoubleValue, bmx055zAcceleration min, bmx055zAcceleration max) { for (size_t idx = 0; idx < iteration_num; idx++) { randDoubleValue[idx] = min + 1.0 * rand() / RAND_MAX * (max - min); } - return randDoubleValue; } /* * random float array, [min, max] * */ -static bmx055fAcceleration randFloatValue[iteration_num]; -bmx055fAcceleration* -randomFloatArr(bmx055fAcceleration min, bmx055fAcceleration max) +static void +randomFloatArr(bmx055fAcceleration *randFloatValue, bmx055fAcceleration min, bmx055fAcceleration max) { for (size_t idx = 0; idx < iteration_num; idx++) { randFloatValue[idx] = min + 1.0 * rand() / RAND_MAX * (max - min); } - return randFloatValue; } +/************************************ + * Main process of the test framework + ************************************/ + int main(int argc, char** argv) { - double result = 0; double parameters[2]; char* pEnd; if (argc == 3) { @@ -172,148 +177,143 @@ main(int argc, char** argv) parameters[0] = 3.0; parameters[1] = 10.0; } - /* + double result[iteration_num]; + bmx055xAcceleration xOps[iteration_num]; + bmx055yAcceleration yOps[iteration_num]; + for (size_t idx = 0; idx < iteration_num; idx++) { + xOps[idx] = randomDouble(parameters[0], parameters[1]); + yOps[idx] = randomDouble(parameters[0] + 0.6, parameters[1] + 0.3); + } + + bmx055fAcceleration fpResult[iteration_num]; + bmx055fAcceleration fpXOps[iteration_num]; + bmx055fAcceleration fpYOps[iteration_num]; + for (size_t idx = 0; idx < iteration_num; idx++) { + fpXOps[idx] = randomFloat(parameters[0], parameters[1]); + fpYOps[idx] = randomFloat(parameters[0] + 0.6, parameters[1] + 0.3); + } + + bmx055xMagneto intResult[iteration_num]; + bmx055xMagneto intXOps[iteration_num]; + bmx055xMagneto intYOps[iteration_num]; + for (size_t idx = 0; idx < iteration_num; idx++) { + intXOps[idx] = randomInt(0, 127); + intYOps[idx] = randomInt(0, 127); + } + + bmx055yMagneto int8Result[iteration_num]; + bmx055yMagneto int8XOps[iteration_num]; + bmx055yMagneto int8YOps[iteration_num]; + for (size_t idx = 0; idx < iteration_num; idx++) { + int8XOps[idx] = randomInt_8(0, 127); + int8YOps[idx] = randomInt_8(0, 127); + } + + // pre-processing of quantization + int fixedResult[iteration_num]; + int fixedLeftOps[iteration_num]; + int fixedRightOps[iteration_num]; + for (size_t idx = 0; idx < iteration_num; idx++) { +#if defined(BENCHMARK_SUITE_QUANT) + fixedLeftOps[idx] = (int) (intXOps[idx] * (1 << Q) + 0.5); + fixedRightOps[idx] = (int) (intYOps[idx] * (1 << Q) + 0.5); +#elif defined(BENCHMARK_SUITE_FIXEDPOINT) + fixedLeftOps[idx] = (int) (intXOps[idx] / 0.98 + 0.5); + fixedRightOps[idx] = (int) (intYOps[idx] / 0.98 + 0.5); +#endif + } + + /* * I try to pass the function name from command line to make it more automatic, * but it's seemingly forbidden in C/C++. * So we need to write the function name manually here. * */ - for (int i = 0; i < 1; i++) - { -#ifdef CONTROL_FLOW_FUNC - result = controlFlowFunc(randomFloat(-16.0, 16.0)); + timespec timer = tic(); +#if defined(CONTROL_FLOW_FUNC) + for (size_t idx = 0; idx < iteration_num; idx++) { + result[idx] = controlFlowFunc(xOps[idx]); + } #elif defined(LIBC_EXP) - result = __ieee754_exp(randomFloat(parameters[0], parameters[1])); + for (size_t idx = 0; idx < iteration_num; idx++) { + result[idx] = __ieee754_exp(xOps[idx]); + } #elif defined(LIBC_LOG) - result = __ieee754_log(randomFloat(parameters[0], parameters[1])); + for (size_t idx = 0; idx < iteration_num; idx++) { + result[idx] = __ieee754_log(xOps[idx]); + } #elif defined(LIBC_ACOSH) - result = __ieee754_acosh(randomFloat(parameters[0], parameters[1])); + for (size_t idx = 0; idx < iteration_num; idx++) { + result[idx] = __ieee754_acosh(xOps[idx]); + } #elif defined(LIBC_J0) - result = __ieee754_j0(randomFloat(parameters[0], parameters[1])); + for (size_t idx = 0; idx < iteration_num; idx++) { + result[idx] = __ieee754_j0(xOps[idx]); + } #elif defined(LIBC_Y0) - result = __ieee754_y0(randomFloat(parameters[0], parameters[1])); + for (size_t idx = 0; idx < iteration_num; idx++) { + result[idx] = __ieee754_y0(xOps[idx]); + } #elif defined(LIBC_REM_PIO2) - bmx055xAcceleration y[2]; - result = __ieee754_rem_pio2(randomFloat(parameters[0], parameters[1]), y); + bmx055xAcceleration y[2]; + for (size_t idx = 0; idx < iteration_num; idx++) { + result[idx] = __ieee754_rem_pio2(xOps[idx], y); + } #elif defined(LIBC_SINCOSF) - float sinp, cosp; - result = libc_sincosf(randomFloat(parameters[0], parameters[1]), &sinp, &cosp); + float sinp, cosp; + for (size_t idx = 0; idx < iteration_num; idx++) { + sinp = cosp = 0; + libc_sincosf(xOps[idx], &sinp, &cosp); + result[idx] = sinp; + } #elif defined(FLOAT64_ADD) - result = float64_add(randomFloat(parameters[0], parameters[1]), randomFloat(parameters[0] + 0.6, parameters[1] + 0.3)); + for (size_t idx = 0; idx < iteration_num; idx++) { + result[idx] = float64_add((uint64_t)(xOps[idx]), (uint64_t)(yOps[idx])); + } #elif defined(FLOAT64_DIV) - result = float64_div(randomFloat(parameters[0], parameters[1]), randomFloat(parameters[0] + 0.6, parameters[1] + 0.3)); + for (size_t idx = 0; idx < iteration_num; idx++) { + result[idx] = float64_div((uint64_t)(xOps[idx]), (uint64_t)(yOps[idx])); + } #elif defined(FLOAT64_MUL) - result = float64_mul(randomFloat(parameters[0], parameters[1]), randomFloat(parameters[0] + 0.6, parameters[1] + 0.3)); + for (size_t idx = 0; idx < iteration_num; idx++) { + result[idx] = float64_mul((uint64_t)(xOps[idx]), (uint64_t)(yOps[idx])); + } #elif defined(FLOAT64_SIN) - result = float64_sin(randomFloat(parameters[0], parameters[1])); + for (size_t idx = 0; idx < iteration_num; idx++) { + result[idx] = float64_sin((uint64_t)(xOps[idx]), (uint64_t)(yOps[idx])); + } #elif defined(BENCHMARK_SUITE_INT) - bmx055xMagneto result[iteration_num]; - bmx055xMagneto leftOps[iteration_num]; - bmx055xMagneto rightOps[iteration_num]; - for (size_t idx = 0; idx < iteration_num; idx++) { - leftOps[idx] = randomInt(0, 127); - rightOps[idx] = randomInt(0, 127); - } - timespec timer = tic(); - int32_add_test(leftOps, rightOps, result); - toc(&timer, "computation delay"); - printf("%d\t%d\t%d\t%d\t%d\n", result[0], result[1], result[2], result[3], result[4]); + int32_add_test(intXOps, intYOps, intResult); #elif defined(BENCHMARK_SUITE_INT_8) - bmx055yMagneto result[iteration_num]; - bmx055yMagneto leftOps[iteration_num]; - bmx055yMagneto rightOps[iteration_num]; - for (size_t idx = 0; idx < iteration_num; idx++) { - leftOps[idx] = randomInt_8(0, 127); - rightOps[idx] = randomInt_8(0, 127); - } - timespec timer = tic(); - int8_add_test(leftOps, rightOps, result); - toc(&timer, "computation delay"); - printf("%d\t%d\t%d\t%d\t%d\n", result[0], result[1], result[2], result[3], result[4]); + int8_add_test(int8XOps, int8YOps, int8Result); #elif defined(BENCHMARK_SUITE_DOUBLE) - bmx055zAcceleration result[iteration_num]; - bmx055zAcceleration leftOps[iteration_num]; - bmx055zAcceleration rightOps[iteration_num]; - for (size_t idx = 0; idx < iteration_num; idx++) { - leftOps[idx] = randomDouble(0, 127); - rightOps[idx] = randomDouble(0, 127); - } - timespec timer = tic(); - double_add_test(leftOps, rightOps, result); - toc(&timer, "computation delay"); - printf("%f\t%f\t%f\t%f\t%f\n", result[0], result[1], result[2], result[3], result[4]); + double_add_test(xOps, yOps, result); #elif defined(BENCHMARK_SUITE_FLOAT) - bmx055fAcceleration result[iteration_num]; - bmx055fAcceleration leftOps[iteration_num]; - bmx055fAcceleration rightOps[iteration_num]; - for (size_t idx = 0; idx < iteration_num; idx++) { - leftOps[idx] = randomFloat(0, 127); - rightOps[idx] = randomFloat(0, 127); - } - timespec timer = tic(); - float_add_test(leftOps, rightOps, result); - toc(&timer, "computation delay"); - printf("%f\t%f\t%f\t%f\t%f\n", result[0], result[1], result[2], result[3], result[4]); + float_add_test(fpXOps, fpYOps, fpResult); #elif defined(BENCHMARK_SUITE_ASUINT) - bmx055zAcceleration result[iteration_num]; - bmx055zAcceleration leftOps[iteration_num]; - bmx055zAcceleration rightOps[iteration_num]; - for (size_t idx = 0; idx < iteration_num; idx++) { - leftOps[idx] = randomDouble(0, 127); - rightOps[idx] = randomDouble(0, 127); - } - asUint_add_test(leftOps, rightOps, result); -// printf("%f\t%f\t%f\t%f\t%f\n", result[0], result[1], result[2], result[3], result[4]); + asUint_add_test(xOps, yOps, result); #elif defined(BENCHMARK_SUITE_QUANT) - int result[iteration_num]; - double result_res[iteration_num]; - int leftOps[iteration_num]; - int rightOps[iteration_num]; - for (size_t idx = 0; idx < iteration_num; idx++) { - leftOps[idx] = (int)(randomDouble(0, 127) / 0.98 + 0.5); - rightOps[idx] = (int)(randomDouble(0, 127) / 0.98 + 0.5); - } - quant_add_test(leftOps, rightOps, result); - for (size_t idx = 0; idx < iteration_num; idx++) { - result_res[idx] = result[idx] * 0.98; - } - printf("%f\t%f\t%f\t%f\t%f\n", result_res[0], result_res[1], - result_res[2], result_res[3], result_res[4]); -// printf("%f\t%f\t%f\t%f\t%f\n", result[0], result[1], result[2], result[3], result[4]); + quant_add_test(fixedLeftOps, fixedRightOps, fixedResult); #elif defined(BENCHMARK_SUITE_FIXEDPOINT) - bmx055zAcceleration result[iteration_num]; - int fixed_result[iteration_num]; - bmx055zAcceleration leftOps[iteration_num]; - bmx055zAcceleration rightOps[iteration_num]; - int fixed_leftOps[iteration_num]; - int fixed_rightOps[iteration_num]; - for (size_t idx = 0; idx < iteration_num; idx++) { - leftOps[idx] = randomDouble(0, 127); - rightOps[idx] = randomDouble(0, 127); - fixed_leftOps[idx] = (int) (leftOps[idx] * (1 << Q) + 0.5); - fixed_rightOps[idx] = (int) (rightOps[idx] * (1 << Q) + 0.5); - } - timespec timer = tic(); -// fixed_point_add_test(leftOps, rightOps, result); - fixed_point_add_test_simplified(fixed_leftOps, fixed_rightOps, fixed_result); - toc(&timer, "computation delay"); - for (size_t idx = 0; idx < iteration_num; idx++) { - result[idx] = (double)fixed_result[idx] / (1< version.c diff --git a/src/newton/newton-irPass-LLVMIR-constantSubstitution.cpp b/src/newton/newton-irPass-LLVMIR-constantSubstitution.cpp index 3a23f04fa..125f43d4b 100644 --- a/src/newton/newton-irPass-LLVMIR-constantSubstitution.cpp +++ b/src/newton/newton-irPass-LLVMIR-constantSubstitution.cpp @@ -33,8 +33,7 @@ using namespace llvm; -extern "C" -{ +extern "C" { /* * Steps of constantSubstitution: * 1. for each instruction (that is the case statement), get the range of current instruction from boundInfo @@ -105,6 +104,18 @@ constantSubstitution(State * N, BoundInfo * boundInfo, llvm::Function & llvmIrFu { break; } + + /* + * there's one case the GEP cannot be substituted + * define dso_local i32 @__ieee754_rem_pio2(double %0, double* %1) #0 !dbg !568 { + * ... + * %12 = getelementptr inbounds double, double* %1, i64 1, !dbg !594 + * store double 0.000000e+00, double* %12, align 8, !dbg !595 + * ... + * */ + if (isa(llvmIrInstruction) && isa(llvmIrInstruction->getOperand(0))) + break; + auto lowerBound = vrIt->second.first; auto upperBound = vrIt->second.second; /* @@ -117,12 +128,13 @@ constantSubstitution(State * N, BoundInfo * boundInfo, llvm::Function & llvmIrFu * */ Value * newConstant = nullptr; uint64_t intBitWidth; - auto instType = llvmIrInstruction->getType(); - auto typeId = instType->getTypeID(); - if (typeId == Type::PointerTyID) { - instType = instType->getPointerElementType(); - typeId = instType->getTypeID(); - } + auto instType = llvmIrInstruction->getType(); + auto typeId = instType->getTypeID(); + if (typeId == Type::PointerTyID) + { + instType = instType->getPointerElementType(); + typeId = instType->getTypeID(); + } switch (typeId) { case Type::IntegerTyID: @@ -144,6 +156,15 @@ constantSubstitution(State * N, BoundInfo * boundInfo, llvm::Function & llvmIrFu } break; case Instruction::Store: + if (auto llvmIrStoreInstruction = dyn_cast(llvmIrInstruction)) + { + /* + * remove the const store inst, e.g. + * store double 0.000000e+00, double 0.000000e+00, align 8 + * */ + if (isa(llvmIrStoreInstruction->getPointerOperand())) + llvmIrStoreInstruction->removeFromParent(); + } break; case Instruction::ICmp: case Instruction::FCmp: diff --git a/src/newton/newton-irPass-LLVMIR-memoryAlignment.cpp b/src/newton/newton-irPass-LLVMIR-memoryAlignment.cpp new file mode 100644 index 000000000..9dbc71b27 --- /dev/null +++ b/src/newton/newton-irPass-LLVMIR-memoryAlignment.cpp @@ -0,0 +1,188 @@ +// +// Created by stephen on 15/02/23. +// + +/* + Authored 2022. Stephen Huang. + All rights reserved. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + * Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + * Neither the name of the author nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ + +#include "newton-irPass-LLVMIR-memoryAlignment.h" +#include "llvm/IR/DataLayout.h" +#include "llvm/IR/Instruction.h" +#include "llvm/IR/MDBuilder.h" +#include "llvm/IR/Module.h" +#include "llvm/IR/Type.h" +#include "llvm/IR/DerivedTypes.h" + +using namespace llvm; + +extern "C" +{ +/* + * Steps of constantSubstitution: + * 1. for each instruction (that is the case statement), get the range of current instruction from boundInfo + * 2. check if the lower range and upper range is the same value, then it means this is a constant value instruction + * 3. get the type of current constant value instruction, mainly float/double/integer (with different bits) + * 4. use llvm API to create a new constant value + * 5. substitute current instruction with the constant value + * */ + +void +memoryAlignment(State * N, BoundInfo * boundInfo, llvm::Function & llvmIrFunction) +{ + /* + * Some special instructions that need to pay attention: + * %i = alloca type, the type of this instruction is "type*" + * %i = call retType @func_name (type %p1, ...) + * call void @llvm.dbg.declare/value (metadata type %p, ...) + * %i = load type, type* %op, the type of this instruction is "type" + * %i = gep type, type1* %op1, type2 %op2, (type3 %op3) + * %i = castInst type1 %op1 to type2 + * store type %op1, type* %op2 + * %.i = phi type [%op1, %bb1], [%op2, %bb2], ... + * %i = binary type %op1, %op2 + * %i = unary type %op + * */ +// printf("<<<<<<<<<< Memeory Alignment >>>>>>>>>>\n\n"); + llvm::Module *module = llvmIrFunction.getParent(); + auto dataLayout = module->getDataLayout(); + +// llvmIrFunction.print(llvm::outs()); +// printf("\n"); + for (BasicBlock & llvmIrBasicBlock : llvmIrFunction) + { + for (BasicBlock::iterator itBB = llvmIrBasicBlock.begin(); itBB != llvmIrBasicBlock.end();) + { + Instruction * llvmIrInstruction = &*itBB++; + switch (llvmIrInstruction->getOpcode()) + { +// case Instruction::CmpXchg: +// case Instruction::Va_Arg: +// case Instruction::Phi: + case Instruction::Store: + { +// printf("\n> Load\n"); + // cast the general llvm instruction to a specific instruction + llvm::StoreInst* storeInst = llvm::dyn_cast(llvmIrInstruction); + + if (storeInst) + { + llvm::Value *storedValue = storeInst->getValueOperand(); + llvm::Type *resultType = storedValue->getType(); + + unsigned align = storeInst->getAlignment(); + // if align > 0, that means no align parameter + if(align > 0) + { + // The result type could not be a void type + if (!resultType->isVoidTy()) + { + unsigned resultAlignment = dataLayout.getABITypeAlignment(resultType); + + // if original alignment is not equal to the result alignment, that means it is not correctly aligned + if (resultAlignment != align) + { + // reset the alignment of the instruction + storeInst->setAlignment(llvm::Align(resultAlignment)); + } + } + + } + } + + break; + + } + case Instruction::Load: + { +// printf("\n> Load\n"); + auto vrIt = boundInfo->virtualRegisterRange.find(llvmIrInstruction); + if (vrIt == boundInfo->virtualRegisterRange.end()) + { +// printf(">> load break!\n"); + break; + } + + if(llvmIrInstruction->hasMetadata()){ +// printf(">>> Has MetaData!\n"); + + // cast the general llvm instruction to a specific instruction + llvm::LoadInst* loadInstr = llvm::dyn_cast(llvmIrInstruction); + if (loadInstr) + { + unsigned align = loadInstr->getAlignment(); + llvm::Type * resultType = loadInstr->getType(); + + if(align > 0 && !resultType->isVoidTy()) + { + unsigned resultAlignment = dataLayout.getABITypeAlignment(resultType); + + // if original alignment is not equal to the result alignment, that means it is not correctly aligned + if (resultAlignment != align) + { + // reset the alignment of the instruction + loadInstr->setAlignment(llvm::Align(resultAlignment)); + } + } + + } + break; + + } + } + + case Instruction::Alloca: + { + llvmIrInstruction->print(llvm::outs()); + llvm::AllocaInst* allocaInst = llvm::dyn_cast(llvmIrInstruction); + llvm::Type *type = allocaInst->getAllocatedType(); + if (isa(type)){ + break; + } + else if(isa(type)){ + StructType *strucTy = dyn_cast(type); + unsigned alignment = dataLayout.getABITypeAlignment(strucTy); + allocaInst->setAlignment(llvm::Align(alignment)); + } + break; + } + + default: + break; + + } + } + } +} + } + + + + diff --git a/src/newton/newton-irPass-LLVMIR-memoryAlignment.h b/src/newton/newton-irPass-LLVMIR-memoryAlignment.h new file mode 100644 index 000000000..9a319cad3 --- /dev/null +++ b/src/newton/newton-irPass-LLVMIR-memoryAlignment.h @@ -0,0 +1,18 @@ +// +// Created by stephen on 15/02/23. +// + + +#include "newton-irPass-LLVMIR-rangeAnalysis.h" +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +void +memoryAlignment(State * N, BoundInfo * boundInfo, llvm::Function & llvmIrFunction); + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + diff --git a/src/newton/newton-irPass-LLVMIR-optimizeByRange.cpp b/src/newton/newton-irPass-LLVMIR-optimizeByRange.cpp index 0ddc69bc5..03bf22e52 100644 --- a/src/newton/newton-irPass-LLVMIR-optimizeByRange.cpp +++ b/src/newton/newton-irPass-LLVMIR-optimizeByRange.cpp @@ -41,6 +41,7 @@ #include "newton-irPass-LLVMIR-constantSubstitution.h" #include "newton-irPass-LLVMIR-shrinkTypeByRange.h" #include "newton-irPass-LLVMIR-quantization.h" +#include "newton-irPass-LLVMIR-memoryAlignment.h" #endif /* __cplusplus */ #include @@ -66,10 +67,10 @@ using namespace llvm; -extern "C"{ +extern "C" { void -dumpIR(State * N, std::string fileSuffix, std::unique_ptr Mod) +dumpIR(State * N, std::string fileSuffix, const std::unique_ptr & Mod) { StringRef filePath(N->llvmIR); std::string dirPath = std::string(sys::path::parent_path(filePath)) + "/"; @@ -93,23 +94,19 @@ mergeBoundInfo(BoundInfo * dst, const BoundInfo * src) } void -collectCalleeBoundInfo(std::map & funcBoundInfo, const BoundInfo * boundInfo) +collectCalleeInfo(std::vector & calleeNames, + std::map & funcBoundInfo, + const BoundInfo * boundInfo) { for (auto & calleeInfo : boundInfo->calleeBound) { + calleeNames.emplace_back(calleeInfo.first); funcBoundInfo.emplace(calleeInfo.first, calleeInfo.second); - collectCalleeBoundInfo(funcBoundInfo, calleeInfo.second); + collectCalleeInfo(calleeNames, funcBoundInfo, calleeInfo.second); } return; } -void -collectCallerMap(std::map & callerMap, const BoundInfo * boundInfo) -{ - callerMap.insert(boundInfo->callerMap.begin(), boundInfo->callerMap.end()); - return; -} - class FunctionNode { mutable AssertingVH F; FunctionComparator::FunctionHash Hash; @@ -150,7 +147,19 @@ class FunctionNodeCmp { using hashFuncSet = std::set; void -overloadFunc(std::unique_ptr & Mod, std::map callerMap) +cleanFunctionMap(const std::unique_ptr & Mod, std::map & callerMap) +{ + for (auto itFunc = callerMap.begin(); itFunc != callerMap.end();) + { + if (nullptr == Mod->getFunction(itFunc->first)) + itFunc = callerMap.erase(itFunc); + else + ++itFunc; + } +} + +void +overloadFunc(std::unique_ptr & Mod, std::map & callerMap) { /* * compare the functions and remove the redundant one @@ -189,30 +198,9 @@ overloadFunc(std::unique_ptr & Mod, std::map ca baseFuncNum = baseFuncs.size(); } - std::set baseFuncNames; - for (auto f : baseFuncs) - { - baseFuncNames.emplace(f.getFunc()->getName().str()); - } - - /* - * iterate functions in Mod, if it cannot be found in baseFuncs, delete it. - * */ - for (auto itFunc = Mod->getFunctionList().begin(); itFunc != Mod->getFunctionList().end(); itFunc++) - { - if (!itFunc->hasName() || itFunc->getName().empty()) - continue; - if (itFunc->getName().startswith("llvm.dbg.value") || - itFunc->getName().startswith("llvm.dbg.declare")) - continue; - if (itFunc->isDeclaration()) - continue; - if (baseFuncNames.find(itFunc->getName().str()) == baseFuncNames.end() && itFunc->hasLocalLinkage()) - { - Mod->getFunctionList().remove(itFunc); - itFunc--; - } - } + legacy::PassManager passManager; + passManager.add(createGlobalDCEPass()); + passManager.run(*Mod); } void @@ -328,15 +316,16 @@ irPassLLVMIROptimizeByRange(State * N) * */ flexprint(N->Fe, N->Fm, N->Fpinfo, "infer bound\n"); std::map callerMap; - const bool useOverLoad = true; + callerMap.clear(); + bool useOverLoad = true; for (auto & mi : *Mod) { auto boundInfo = new BoundInfo(); mergeBoundInfo(boundInfo, globalBoundInfo); - rangeAnalysis(N, typeRange, virtualRegisterVectorRange, boundInfo, mi, useOverLoad); - funcBoundInfo.emplace(mi.getName(), boundInfo); - collectCalleeBoundInfo(funcBoundInfo, boundInfo); - collectCallerMap(callerMap, boundInfo); + rangeAnalysis(N, mi, boundInfo, callerMap, typeRange, virtualRegisterVectorRange, useOverLoad); + funcBoundInfo.emplace(mi.getName().str(), boundInfo); + std::vector calleeNames; + collectCalleeInfo(calleeNames, funcBoundInfo, boundInfo); } /* @@ -350,97 +339,94 @@ irPassLLVMIROptimizeByRange(State * N) { simplifyControlFlow(N, boundInfoIt->second, mi); } - else - { - assert(false); - } + // else + // { + // assert(false); + // } } + flexprint(N->Fe, N->Fm, N->Fpinfo, "shrink data type by range\n"); + for (auto & mi : *Mod) + { + auto boundInfoIt = funcBoundInfo.find(mi.getName().str()); + if (boundInfoIt != funcBoundInfo.end()) { + shrinkType(N, boundInfoIt->second, mi); + } +// else +// { +// assert(false); +// } + } + + /* + * remove the functions that are optimized by passes. + * */ + if (useOverLoad) + cleanFunctionMap(Mod, callerMap); + + if (useOverLoad) + overloadFunc(Mod, callerMap); + + flexprint(N->Fe, N->Fm, N->Fpinfo, "memory alignment\n"); + for (auto & mi : *Mod) + { + auto boundInfoIt = funcBoundInfo.find(mi.getName().str()); + if (boundInfoIt != funcBoundInfo.end()) + { + memoryAlignment(N, boundInfoIt->second, mi); + } +// else +// { +// assert(false); +// } + } + legacy::PassManager passManager; passManager.add(createCFGSimplificationPass()); passManager.add(createInstSimplifyLegacyPass()); + passManager.add(createGlobalDCEPass()); passManager.run(*Mod); + /* + * remove the functions that are optimized by passes. + * */ if (useOverLoad) - overloadFunc(Mod, callerMap); - - flexprint(N->Fe, N->Fm, N->Fpinfo, "infer bound\n"); - callerMap.clear(); - funcBoundInfo.clear(); - for (auto & mi : *Mod) - { - auto boundInfo = new BoundInfo(); - mergeBoundInfo(boundInfo, globalBoundInfo); - rangeAnalysis(N, typeRange, virtualRegisterVectorRange, boundInfo, mi, useOverLoad); - funcBoundInfo.emplace(mi.getName(), boundInfo); - collectCalleeBoundInfo(funcBoundInfo, boundInfo); - collectCallerMap(callerMap, boundInfo); - } - - flexprint(N->Fe, N->Fm, N->Fpinfo, "constant substitution\n"); - for (auto & mi : *Mod) - { - auto boundInfoIt = funcBoundInfo.find(mi.getName().str()); - if (boundInfoIt != funcBoundInfo.end()) - { - constantSubstitution(N, boundInfoIt->second, mi); - } - else - { - assert(false); - } - } - - // flexprint(N->Fe, N->Fm, N->Fpinfo, "shrink data type by range\n"); - // for (auto & mi : *Mod) - // { - // auto boundInfoIt = funcBoundInfo.find(mi.getName().str()); - // if (boundInfoIt != funcBoundInfo.end()) { - // shrinkType(N, boundInfoIt->second, mi); - // } else { - // assert(false); - // } - // } + cleanFunctionMap(Mod, callerMap); if (useOverLoad) overloadFunc(Mod, callerMap); + useOverLoad = false; + flexprint(N->Fe, N->Fm, N->Fpinfo, "infer bound\n"); - callerMap.clear(); funcBoundInfo.clear(); for (auto & mi : *Mod) { auto boundInfo = new BoundInfo(); mergeBoundInfo(boundInfo, globalBoundInfo); - rangeAnalysis(N, typeRange, virtualRegisterVectorRange, boundInfo, mi, useOverLoad); - funcBoundInfo.emplace(mi.getName(), boundInfo); - collectCalleeBoundInfo(funcBoundInfo, boundInfo); - collectCallerMap(callerMap, boundInfo); + rangeAnalysis(N, mi, boundInfo, callerMap, typeRange, virtualRegisterVectorRange, useOverLoad); + funcBoundInfo.emplace(mi.getName().str(), boundInfo); + std::vector calleeNames; + collectCalleeInfo(calleeNames, funcBoundInfo, boundInfo); } - /* - * - * */ - flexprint(N->Fe, N->Fm, N->Fpinfo, "auto quantize data by precision\n"); + flexprint(N->Fe, N->Fm, N->Fpinfo, "constant substitution\n"); for (auto & mi : *Mod) { auto boundInfoIt = funcBoundInfo.find(mi.getName().str()); if (boundInfoIt != funcBoundInfo.end()) { - irPassLLVMIRAutoQuantization(N, boundInfoIt->second, mi); - } - else - { - assert(false); + constantSubstitution(N, boundInfoIt->second, mi); } + // else + // { + // assert(false); + // } } - if (useOverLoad) - overloadFunc(Mod, callerMap); - /* * Dump BC file to a file. * */ - dumpIR(N, "output", std::move(Mod)); + dumpIR(N, "output", Mod); } } diff --git a/src/newton/newton-irPass-LLVMIR-rangeAnalysis.cpp b/src/newton/newton-irPass-LLVMIR-rangeAnalysis.cpp index 252227aaf..517f1cbbc 100644 --- a/src/newton/newton-irPass-LLVMIR-rangeAnalysis.cpp +++ b/src/newton/newton-irPass-LLVMIR-rangeAnalysis.cpp @@ -39,8 +39,7 @@ using namespace llvm; -extern "C" -{ +extern "C" { const bool valueRangeDebug = false; @@ -943,9 +942,11 @@ bitwiseInterval(const int64_t lhsLow, const int64_t lhsHigh, } std::pair> -rangeAnalysis(State * N, const std::map> & typeRange, +rangeAnalysis(State * N, llvm::Function & llvmIrFunction, BoundInfo * boundInfo, + std::map & callerMap, + const std::map> & typeRange, const std::map>> & virtualRegisterVectorRange, - BoundInfo * boundInfo, Function & llvmIrFunction, bool useOverLoad) + bool useOverLoad) { flexprint(N->Fe, N->Fm, N->Fpinfo, "\tCall: Analyze function %s.\n", llvmIrFunction.getName()); /* @@ -1103,8 +1104,14 @@ rangeAnalysis(State * N, const std::map> } else if (funcName == "sqrt") { - lowRange = sqrt(argRanges[0].first); - highRange = sqrt(argRanges[0].second); + if (argRanges[0].first < 0) + lowRange = 0; + else + lowRange = sqrt(argRanges[0].first); + if (argRanges[0].second < 0) + highRange = 0; + else + highRange = sqrt(argRanges[0].second); } else if (funcName == "log1p") { @@ -1173,11 +1180,9 @@ rangeAnalysis(State * N, const std::map> * */ flexprint(N->Fe, N->Fm, N->Fpinfo, "\tCall: detect calledFunction %s.\n", calledFunction->getName().str().c_str()); - auto innerBoundInfo = new BoundInfo(); - /* - * get the range of args and rename the called function with args range - * */ std::string newFuncName = calledFunction->getName().str(); + auto innerBoundInfo = new BoundInfo(); + bool hasSpecificRange = false; /* * check if the ranges have been set to the function name * */ @@ -1196,6 +1201,7 @@ rangeAnalysis(State * N, const std::map> * */ if (ConstantInt * cInt = dyn_cast(llvmIrCallInstruction->getOperand(idx))) { + hasSpecificRange = true; int64_t constIntValue = cInt->getSExtValue(); flexprint(N->Fe, N->Fm, N->Fpinfo, "\tCall: It's a constant int value: %d.\n", constIntValue); innerBoundInfo->virtualRegisterRange.emplace(calledFunction->getArg(idx), @@ -1209,6 +1215,7 @@ rangeAnalysis(State * N, const std::map> } else if (ConstantFP * constFp = dyn_cast(llvmIrCallInstruction->getOperand(idx))) { + hasSpecificRange = true; double constDoubleValue = (constFp->getValueAPF()).convertToDouble(); flexprint(N->Fe, N->Fm, N->Fpinfo, "\tCall: It's a constant double value: %f.\n", constDoubleValue); innerBoundInfo->virtualRegisterRange.emplace(calledFunction->getArg(idx), @@ -1228,6 +1235,7 @@ rangeAnalysis(State * N, const std::map> auto vrRangeIt = boundInfo->virtualRegisterRange.find(llvmIrCallInstruction->getOperand(idx)); if (vrRangeIt != boundInfo->virtualRegisterRange.end()) { + hasSpecificRange = true; flexprint(N->Fe, N->Fm, N->Fpinfo, "\tCall: the range of the operand is: %f - %f.\n", vrRangeIt->second.first, vrRangeIt->second.second); innerBoundInfo->virtualRegisterRange.emplace(calledFunction->getArg(idx), vrRangeIt->second); @@ -1246,12 +1254,26 @@ rangeAnalysis(State * N, const std::map> } Function * realCallee; std::pair> returnRange; - auto uniqueNewFunc = boundInfo->callerMap.find(newFuncName) != boundInfo->callerMap.end(); - if (useOverLoad && newFuncName != calledFunction->getName().str() && uniqueNewFunc) + if (useOverLoad && hasSpecificRange) { + auto newFuncPos = calledFunction->getIterator(); + Module & funcModule = *calledFunction->getParent(); /* - * rename the llvmIrCallInstruction to the new function name - */ + * If it has a specific range, generate a new function or just change the caller + * Else, we only collect "real" new functions in callerMap + * */ + if (callerMap.find(newFuncName) != callerMap.end()) + { + newFuncPos = funcModule.getFunction(newFuncName)->getIterator(); + newFuncName += "_dummy_"; + newFuncName += std::to_string(std::rand()); + } + callerMap.emplace(newFuncName, llvmIrCallInstruction); + /* + * if the function has not been generated before, + * which means it's not in the CallerMap, + * create a new function and insert it to the CallerMap + * */ ValueToValueMapTy vMap; realCallee = Function::Create(calledFunction->getFunctionType(), calledFunction->getLinkage(), @@ -1283,16 +1305,17 @@ rangeAnalysis(State * N, const std::map> } } - Module & funcModule = *calledFunction->getParent(); - funcModule.getFunctionList().insert(calledFunction->getIterator(), realCallee); + funcModule.getFunctionList().insert(newFuncPos, realCallee); realCallee->setDSOLocal(true); + /* + * rename the llvmIrCallInstruction to the new function name + */ llvmIrCallInstruction->setCalledFunction(realCallee); - boundInfo->callerMap.emplace(realCallee->getName().str(), llvmIrCallInstruction); /* * update the inner bound info with the new function. * // todo: this code is a bit wired, maybe can be improved * */ - auto innerBoundInfo = new BoundInfo(); + auto overloadBoundInfo = new BoundInfo(); for (size_t idx = 0; idx < llvmIrCallInstruction->getNumOperands() - 1; idx++) { /* @@ -1302,17 +1325,17 @@ rangeAnalysis(State * N, const std::map> { int64_t constIntValue = cInt->getSExtValue(); flexprint(N->Fe, N->Fm, N->Fpinfo, "\tCall: It's a constant int value: %d.\n", constIntValue); - innerBoundInfo->virtualRegisterRange.emplace(realCallee->getArg(idx), - std::make_pair(static_cast(constIntValue), - static_cast(constIntValue))); + overloadBoundInfo->virtualRegisterRange.emplace(realCallee->getArg(idx), + std::make_pair(static_cast(constIntValue), + static_cast(constIntValue))); } else if (ConstantFP * constFp = dyn_cast(llvmIrCallInstruction->getOperand(idx))) { double constDoubleValue = (constFp->getValueAPF()).convertToDouble(); flexprint(N->Fe, N->Fm, N->Fpinfo, "\tCall: It's a constant double value: %f.\n", constDoubleValue); - innerBoundInfo->virtualRegisterRange.emplace(realCallee->getArg(idx), - std::make_pair(constDoubleValue, - constDoubleValue)); + overloadBoundInfo->virtualRegisterRange.emplace(realCallee->getArg(idx), + std::make_pair(constDoubleValue, + constDoubleValue)); } else { @@ -1325,8 +1348,8 @@ rangeAnalysis(State * N, const std::map> { flexprint(N->Fe, N->Fm, N->Fpinfo, "\tCall: the range of the operand is: %f - %f.\n", vrRangeIt->second.first, vrRangeIt->second.second); - innerBoundInfo->virtualRegisterRange.emplace(realCallee->getArg(idx), - vrRangeIt->second); + overloadBoundInfo->virtualRegisterRange.emplace(realCallee->getArg(idx), + vrRangeIt->second); } else { @@ -1335,13 +1358,33 @@ rangeAnalysis(State * N, const std::map> } } - returnRange = rangeAnalysis(N, typeRange, virtualRegisterVectorRange, - innerBoundInfo, *realCallee, useOverLoad); + returnRange = rangeAnalysis(N, *realCallee, overloadBoundInfo, callerMap, + typeRange, virtualRegisterVectorRange, useOverLoad); + /* + * If the "realCallee" pass arguments by pointer, update the pointer argus. + * If the outer function have such operand value, but doesn't exist after the callee, + * remove it from boundInfo->virtualRegisterRange + * If both exist before and after callee, then update its value. + * */ + for (size_t idx = 0; idx < llvmIrCallInstruction->getNumOperands() - 1; idx++) { + auto operand = llvmIrCallInstruction->getOperand(idx); + if (operand->getType()->getTypeID() == Type::PointerTyID) { + auto vrIt = boundInfo->virtualRegisterRange.find(operand); + if (vrIt != boundInfo->virtualRegisterRange.end()) { + auto ibIt = innerBoundInfo->virtualRegisterRange.find(operand); + if (ibIt != innerBoundInfo->virtualRegisterRange.end()) { + vrIt->second = ibIt->second; + } else { + boundInfo->virtualRegisterRange.erase(vrIt); + } + } + } + } if (returnRange.first != nullptr) { boundInfo->virtualRegisterRange.emplace(llvmIrCallInstruction, returnRange.second); } - boundInfo->calleeBound.emplace(newFuncName, innerBoundInfo); + boundInfo->calleeBound.emplace(newFuncName, overloadBoundInfo); } else { @@ -1350,8 +1393,28 @@ rangeAnalysis(State * N, const std::map> * that has been stored in boundInfo, we get the union set of them * */ realCallee = calledFunction; - returnRange = rangeAnalysis(N, typeRange, virtualRegisterVectorRange, - innerBoundInfo, *realCallee, useOverLoad); + returnRange = rangeAnalysis(N, *realCallee, innerBoundInfo, callerMap, + typeRange, virtualRegisterVectorRange, useOverLoad); + /* + * If the "realCallee" pass arguments by pointer, update the pointer argus. + * If the outer function have such operand value, but doesn't exist after the callee, + * remove it from boundInfo->virtualRegisterRange + * If both exist before and after callee, then update its value. + * */ + for (size_t idx = 0; idx < llvmIrCallInstruction->getNumOperands() - 1; idx++) { + auto operand = llvmIrCallInstruction->getOperand(idx); + if (operand->getType()->getTypeID() == Type::PointerTyID) { + auto vrIt = boundInfo->virtualRegisterRange.find(operand); + if (vrIt != boundInfo->virtualRegisterRange.end()) { + auto ibIt = innerBoundInfo->virtualRegisterRange.find(operand); + if (ibIt != innerBoundInfo->virtualRegisterRange.end()) { + vrIt->second = ibIt->second; + } else { + boundInfo->virtualRegisterRange.erase(vrIt); + } + } + } + } if (returnRange.first != nullptr) { boundInfo->virtualRegisterRange.emplace(llvmIrCallInstruction, returnRange.second); @@ -1566,7 +1629,7 @@ rangeAnalysis(State * N, const std::map> { constValue = (constFp->getValueAPF()).convertToDouble(); } - else if (ConstantInt * constInt = llvm::dyn_cast(rightOperand)) + else if (ConstantInt * constInt = llvm::dyn_cast(leftOperand)) { constValue = constInt->getSExtValue(); } @@ -1886,6 +1949,12 @@ rangeAnalysis(State * N, const std::map> case Instruction::Shl: if (auto llvmIrBinaryOperator = dyn_cast(&llvmIrInstruction)) { + Type * instType = llvmIrBinaryOperator->getType(); + uint bitWidth = 64; + if (instType->isIntegerTy()) + { + bitWidth = cast(instType)->getBitWidth(); + } Value * leftOperand = llvmIrInstruction.getOperand(0); Value * rightOperand = llvmIrInstruction.getOperand(1); if ((isa(leftOperand) && isa(rightOperand))) @@ -1904,8 +1973,27 @@ rangeAnalysis(State * N, const std::map> auto vrRangeIt = boundInfo->virtualRegisterRange.find(leftOperand); if (vrRangeIt != boundInfo->virtualRegisterRange.end()) { - lowerBound = vrRangeIt->second.first; - upperBound = vrRangeIt->second.second; + switch (bitWidth) + { + case 8: + lowerBound = static_cast(static_cast(vrRangeIt->second.first)); + upperBound = static_cast(static_cast(vrRangeIt->second.second)); + break; + case 16: + lowerBound = static_cast(static_cast(vrRangeIt->second.first)); + upperBound = static_cast(static_cast(vrRangeIt->second.second)); + break; + case 32: + lowerBound = static_cast(static_cast(vrRangeIt->second.first)); + upperBound = static_cast(static_cast(vrRangeIt->second.second)); + break; + case 64: + lowerBound = static_cast(static_cast(vrRangeIt->second.first)); + upperBound = static_cast(static_cast(vrRangeIt->second.second)); + break; + default: + assert(false); + } } else { @@ -1915,18 +2003,18 @@ rangeAnalysis(State * N, const std::map> vrRangeIt = boundInfo->virtualRegisterRange.find(rightOperand); if (vrRangeIt != boundInfo->virtualRegisterRange.end()) { - auto leftMin = lowerBound; - auto leftMax = upperBound; - auto rightMin = vrRangeIt->second.first; - auto rightMax = vrRangeIt->second.second; - lowerBound = min(min(min((int)leftMin << (int)rightMin, - (int)leftMin << (int)rightMax), - (int)leftMax << (int)rightMin), - (int)leftMax << (int)rightMax); - upperBound = max(max(max((int)leftMin << (int)rightMin, - (int)leftMin << (int)rightMax), - (int)leftMax << (int)rightMin), - (int)leftMax << (int)rightMax); + auto leftMin = lowerBound; + auto leftMax = upperBound; + double rightMin = vrRangeIt->second.first; + double rightMax = vrRangeIt->second.second; + lowerBound = min(min(min((uint64_t)leftMin << (int64_t)rightMin, + (uint64_t)leftMin << (int64_t)rightMax), + (uint64_t)leftMax << (int64_t)rightMin), + (uint64_t)leftMax << (int64_t)rightMax); + upperBound = max(max(max((uint64_t)leftMin << (int64_t)rightMin, + (uint64_t)leftMin << (int64_t)rightMax), + (uint64_t)leftMax << (int64_t)rightMin), + (uint64_t)leftMax << (int64_t)rightMax); } else { @@ -1954,11 +2042,28 @@ rangeAnalysis(State * N, const std::map> auto vrRangeIt = boundInfo->virtualRegisterRange.find(rightOperand); if (vrRangeIt != boundInfo->virtualRegisterRange.end()) { - // todo: if we need assert or other check here? - uint64_t rightMin = vrRangeIt->second.first < 0 ? 0 : vrRangeIt->second.first; - uint64_t rightMax = vrRangeIt->second.second < 0 ? 0 : vrRangeIt->second.second; - double lowerBound = min(constValue << rightMin, constValue << rightMax); - double upperBound = max(constValue << rightMin, constValue << rightMax); + double lowerBound, upperBound; + switch (bitWidth) + { + case 8: + lowerBound = constValue << (static_cast(vrRangeIt->second.first)); + upperBound = constValue << (static_cast(vrRangeIt->second.second)); + break; + case 16: + lowerBound = constValue << (static_cast(vrRangeIt->second.first)); + upperBound = constValue << (static_cast(vrRangeIt->second.second)); + break; + case 32: + lowerBound = constValue << (static_cast(vrRangeIt->second.first)); + upperBound = constValue << (static_cast(vrRangeIt->second.second)); + break; + case 64: + lowerBound = constValue << (static_cast(vrRangeIt->second.first)); + upperBound = constValue << (static_cast(vrRangeIt->second.second)); + break; + default: + assert(false); + } boundInfo->virtualRegisterRange.emplace(llvmIrBinaryOperator, std::make_pair(lowerBound, upperBound)); } @@ -1981,9 +2086,30 @@ rangeAnalysis(State * N, const std::map> auto vrRangeIt = boundInfo->virtualRegisterRange.find(leftOperand); if (vrRangeIt != boundInfo->virtualRegisterRange.end()) { + double resMin = 0, resMax = 0; + switch (bitWidth) + { + case 8: + resMin = static_cast(vrRangeIt->second.first) << constValue; + resMax = static_cast(vrRangeIt->second.second) << constValue; + break; + case 16: + resMin = static_cast(vrRangeIt->second.first) << constValue; + resMax = static_cast(vrRangeIt->second.second) << constValue; + break; + case 32: + resMin = static_cast(vrRangeIt->second.first) << constValue; + resMax = static_cast(vrRangeIt->second.second) << constValue; + break; + case 64: + resMin = static_cast(vrRangeIt->second.first) << constValue; + resMax = static_cast(vrRangeIt->second.second) << constValue; + break; + default: + assert(false); + } boundInfo->virtualRegisterRange.emplace(llvmIrBinaryOperator, - std::make_pair((int)vrRangeIt->second.first << constValue, - (int)vrRangeIt->second.second << constValue)); + std::make_pair(resMin, resMax)); } else { @@ -1998,10 +2124,18 @@ rangeAnalysis(State * N, const std::map> } break; - case Instruction::LShr: + /* + * Sign extend + * */ case Instruction::AShr: if (auto llvmIrBinaryOperator = dyn_cast(&llvmIrInstruction)) { + Type * instType = llvmIrBinaryOperator->getType(); + uint bitWidth = 64; + if (instType->isIntegerTy()) + { + bitWidth = cast(instType)->getBitWidth(); + } Value * leftOperand = llvmIrInstruction.getOperand(0); Value * rightOperand = llvmIrInstruction.getOperand(1); if ((isa(leftOperand) && isa(rightOperand))) @@ -2010,8 +2144,8 @@ rangeAnalysis(State * N, const std::map> } if (!isa(leftOperand) && !isa(rightOperand)) { - double lowerBound = 0.0; - double upperBound = 0.0; + double leftMin = 0.0; + double leftMax = 0.0; /* * e.g. x1 >> x2 * range: [min(x1_min>>x2_min, x1_min>>x2_max, x1_max>>x2_min, x1_max>>x2_max), @@ -2020,29 +2154,29 @@ rangeAnalysis(State * N, const std::map> auto vrRangeIt = boundInfo->virtualRegisterRange.find(leftOperand); if (vrRangeIt != boundInfo->virtualRegisterRange.end()) { - lowerBound = vrRangeIt->second.first; - upperBound = vrRangeIt->second.second; + leftMin = vrRangeIt->second.first; + leftMax = vrRangeIt->second.second; } else { assert(!valueRangeDebug && "failed to get range"); break; } + double lowerBound, upperBound; vrRangeIt = boundInfo->virtualRegisterRange.find(rightOperand); if (vrRangeIt != boundInfo->virtualRegisterRange.end()) { - auto leftMin = lowerBound; - auto leftMax = upperBound; - auto rightMin = vrRangeIt->second.first; - auto rightMax = vrRangeIt->second.second; - lowerBound = min(min(min((int)leftMin >> (int)rightMin, - (int)leftMin >> (int)rightMax), - (int)leftMax >> (int)rightMin), - (int)leftMax >> (int)rightMax); - upperBound = max(max(max((int)leftMin >> (int)rightMin, - (int)leftMin >> (int)rightMax), - (int)leftMax >> (int)rightMin), - (int)leftMax >> (int)rightMax); + double rightMin = 0, rightMax = 0; + rightMin = vrRangeIt->second.first; + rightMax = vrRangeIt->second.second; + lowerBound = min(min(min(static_cast(leftMin) >> static_cast(rightMin), + static_cast(leftMin) >> static_cast(rightMax)), + static_cast(leftMax) >> static_cast(rightMin)), + static_cast(leftMax) >> static_cast(rightMax)); + upperBound = max(max(max(static_cast(leftMin) >> static_cast(rightMin), + static_cast(leftMin) >> static_cast(rightMax)), + static_cast(leftMax) >> static_cast(rightMin)), + static_cast(leftMax) >> static_cast(rightMax)); } else { @@ -2061,7 +2195,7 @@ rangeAnalysis(State * N, const std::map> uint64_t constValue = 1.0; if (ConstantFP * constFp = llvm::dyn_cast(leftOperand)) { - constValue = static_cast((constFp->getValueAPF()).convertToDouble()); + constValue = static_cast((constFp->getValueAPF()).convertToDouble()); } else if (ConstantInt * constInt = llvm::dyn_cast(leftOperand)) { @@ -2070,11 +2204,228 @@ rangeAnalysis(State * N, const std::map> auto vrRangeIt = boundInfo->virtualRegisterRange.find(rightOperand); if (vrRangeIt != boundInfo->virtualRegisterRange.end()) { - // todo: if we need assert or other check here? - uint64_t rightMin = vrRangeIt->second.first < 0 ? 0 : vrRangeIt->second.first; - uint64_t rightMax = vrRangeIt->second.second < 0 ? 0 : vrRangeIt->second.second; - double lowerBound = min(constValue >> rightMin, constValue >> rightMax); - double upperBound = max(constValue >> rightMin, constValue >> rightMax); + double lowerBound, upperBound; + switch (bitWidth) + { + case 8: + lowerBound = constValue >> (static_cast(vrRangeIt->second.first)); + upperBound = constValue >> (static_cast(vrRangeIt->second.second)); + break; + case 16: + lowerBound = constValue >> (static_cast(vrRangeIt->second.first)); + upperBound = constValue >> (static_cast(vrRangeIt->second.second)); + break; + case 32: + lowerBound = constValue >> (static_cast(vrRangeIt->second.first)); + upperBound = constValue >> (static_cast(vrRangeIt->second.second)); + break; + case 64: + lowerBound = constValue >> (static_cast(vrRangeIt->second.first)); + upperBound = constValue >> (static_cast(vrRangeIt->second.second)); + break; + default: + assert(false); + } + boundInfo->virtualRegisterRange.emplace(llvmIrBinaryOperator, + std::make_pair(lowerBound, upperBound)); + } + else + { + assert(!valueRangeDebug && "failed to get range"); + break; + } + } + else if (!isa(leftOperand) && isa(rightOperand)) + { + /* + * eg. x>>2 + */ + int constValue = 1.0; + if (ConstantInt * constInt = llvm::dyn_cast(rightOperand)) + { + constValue = constInt->getZExtValue(); + } + auto vrRangeIt = boundInfo->virtualRegisterRange.find(leftOperand); + if (vrRangeIt != boundInfo->virtualRegisterRange.end()) + { + double resMin = 0, resMax = 0; + switch (bitWidth) + { + case 8: + resMin = static_cast(vrRangeIt->second.first) >> constValue; + resMax = static_cast(vrRangeIt->second.second) >> constValue; + break; + case 16: + resMin = static_cast(vrRangeIt->second.first) >> constValue; + resMax = static_cast(vrRangeIt->second.second) >> constValue; + break; + case 32: + resMin = static_cast(vrRangeIt->second.first) >> constValue; + resMax = static_cast(vrRangeIt->second.second) >> constValue; + break; + case 64: + resMin = static_cast(vrRangeIt->second.first) >> constValue; + resMax = static_cast(vrRangeIt->second.second) >> constValue; + break; + default: + assert(false); + } + boundInfo->virtualRegisterRange.emplace(llvmIrBinaryOperator, + std::make_pair(min(resMin, resMax), max(resMin, resMax))); + } + else + { + assert(!valueRangeDebug && "failed to get range"); + } + } + else + { + flexprint(N->Fe, N->Fm, N->Fperr, "\tShr: Unexpected error. Might have an invalid operand.\n"); + assert(!valueRangeDebug && "failed to get range"); + } + } + break; + + /* + * Zero extend + * */ + case Instruction::LShr: + if (auto llvmIrBinaryOperator = dyn_cast(&llvmIrInstruction)) + { + Type * instType = llvmIrBinaryOperator->getType(); + uint bitWidth = 64; + if (instType->isIntegerTy()) + { + bitWidth = cast(instType)->getBitWidth(); + } + Value * leftOperand = llvmIrInstruction.getOperand(0); + Value * rightOperand = llvmIrInstruction.getOperand(1); + if ((isa(leftOperand) && isa(rightOperand))) + { + flexprint(N->Fe, N->Fm, N->Fperr, "\tShr: Expression normalization needed.\n"); + } + if (!isa(leftOperand) && !isa(rightOperand)) + { + double leftMin = 0.0; + double leftMax = 0.0; + /* + * e.g. x1 >> x2 + * range: [min(x1_min>>x2_min, x1_min>>x2_max, x1_max>>x2_min, x1_max>>x2_max), + * max(x1_min>>x2_min, x1_min>>x2_max, x1_max>>x2_min, x1_max>>x2_max)] + */ + auto vrRangeIt = boundInfo->virtualRegisterRange.find(leftOperand); + if (vrRangeIt != boundInfo->virtualRegisterRange.end()) + { + switch (bitWidth) + { + case 8: + leftMin = static_cast(static_cast(vrRangeIt->second.first)); + leftMax = static_cast(static_cast(vrRangeIt->second.second)); + break; + case 16: + leftMin = static_cast(static_cast(vrRangeIt->second.first)); + leftMax = static_cast(static_cast(vrRangeIt->second.second)); + break; + case 32: + leftMin = static_cast(static_cast(vrRangeIt->second.first)); + leftMax = static_cast(static_cast(vrRangeIt->second.second)); + break; + case 64: + leftMin = static_cast(static_cast(vrRangeIt->second.first)); + leftMax = static_cast(static_cast(vrRangeIt->second.second)); + break; + default: + assert(false); + } + } + else + { + assert(!valueRangeDebug && "failed to get range"); + break; + } + double lowerBound, upperBound; + vrRangeIt = boundInfo->virtualRegisterRange.find(rightOperand); + if (vrRangeIt != boundInfo->virtualRegisterRange.end()) + { + double rightMin = 0, rightMax = 0; + switch (bitWidth) + { + case 8: + rightMin = static_cast(vrRangeIt->second.first); + rightMax = static_cast(vrRangeIt->second.second); + break; + case 16: + rightMin = static_cast(vrRangeIt->second.first); + rightMax = static_cast(vrRangeIt->second.second); + break; + case 32: + rightMin = static_cast(vrRangeIt->second.first); + rightMax = static_cast(vrRangeIt->second.second); + break; + case 64: + rightMin = static_cast(vrRangeIt->second.first); + rightMax = static_cast(vrRangeIt->second.second); + break; + default: + assert(false); + } + lowerBound = min(min(min((uint64_t)leftMin >> (uint64_t)rightMin, + (uint64_t)leftMin >> (uint64_t)rightMax), + (uint64_t)leftMax >> (uint64_t)rightMin), + (uint64_t)leftMax >> (uint64_t)rightMax); + upperBound = max(max(max((uint64_t)leftMin >> (uint64_t)rightMin, + (uint64_t)leftMin >> (uint64_t)rightMax), + (int64_t)leftMax >> (uint64_t)rightMin), + (uint64_t)leftMax >> (uint64_t)rightMax); + } + else + { + assert(!valueRangeDebug && "failed to get range"); + break; + } + boundInfo->virtualRegisterRange.emplace(llvmIrBinaryOperator, std::make_pair(lowerBound, upperBound)); + } + else if (isa(leftOperand) && !isa(rightOperand)) + { + /* + * e.g. 2 >> x + * range: [min(2>>x2_min, 2>>x2_max), + * max(2>>x2_min, 2>>x2_max)] + */ + uint64_t constValue = 1.0; + if (ConstantFP * constFp = llvm::dyn_cast(leftOperand)) + { + constValue = static_cast((constFp->getValueAPF()).convertToDouble()); + } + else if (ConstantInt * constInt = llvm::dyn_cast(leftOperand)) + { + constValue = constInt->getZExtValue(); + } + auto vrRangeIt = boundInfo->virtualRegisterRange.find(rightOperand); + if (vrRangeIt != boundInfo->virtualRegisterRange.end()) + { + double lowerBound, upperBound; + switch (bitWidth) + { + case 8: + lowerBound = constValue >> (static_cast(vrRangeIt->second.first)); + upperBound = constValue >> (static_cast(vrRangeIt->second.second)); + break; + case 16: + lowerBound = constValue >> (static_cast(vrRangeIt->second.first)); + upperBound = constValue >> (static_cast(vrRangeIt->second.second)); + break; + case 32: + lowerBound = constValue >> (static_cast(vrRangeIt->second.first)); + upperBound = constValue >> (static_cast(vrRangeIt->second.second)); + break; + case 64: + lowerBound = constValue >> (static_cast(vrRangeIt->second.first)); + upperBound = constValue >> (static_cast(vrRangeIt->second.second)); + break; + default: + assert(false); + } boundInfo->virtualRegisterRange.emplace(llvmIrBinaryOperator, std::make_pair(lowerBound, upperBound)); } @@ -2097,9 +2448,30 @@ rangeAnalysis(State * N, const std::map> auto vrRangeIt = boundInfo->virtualRegisterRange.find(leftOperand); if (vrRangeIt != boundInfo->virtualRegisterRange.end()) { + double resMin = 0, resMax = 0; + switch (bitWidth) + { + case 8: + resMin = (static_cast(vrRangeIt->second.first)) >> constValue; + resMax = (static_cast(vrRangeIt->second.second)) >> constValue; + break; + case 16: + resMin = (static_cast(vrRangeIt->second.first)) >> constValue; + resMax = (static_cast(vrRangeIt->second.second)) >> constValue; + break; + case 32: + resMin = (static_cast(vrRangeIt->second.first)) >> constValue; + resMax = (static_cast(vrRangeIt->second.second)) >> constValue; + break; + case 64: + resMin = (static_cast(vrRangeIt->second.first)) >> constValue; + resMax = (static_cast(vrRangeIt->second.second)) >> constValue; + break; + default: + assert(false); + } boundInfo->virtualRegisterRange.emplace(llvmIrBinaryOperator, - std::make_pair((uint)vrRangeIt->second.first >> constValue, - (uint)vrRangeIt->second.second >> constValue)); + std::make_pair(min(resMin, resMax), max(resMin, resMax))); } else { @@ -2485,7 +2857,8 @@ rangeAnalysis(State * N, const std::map> if (uaIt != unionAddress.end()) { flexprint(N->Fe, N->Fm, N->Fpinfo, "\tStore Union: %f - %f\n", vrRangeIt->second.first, vrRangeIt->second.second); - boundInfo->virtualRegisterRange.emplace(uaIt->second, vrRangeIt->second); + if (nullptr != vrRangeIt->first) + boundInfo->virtualRegisterRange.emplace(uaIt->second, vrRangeIt->second); } } } @@ -2533,7 +2906,8 @@ rangeAnalysis(State * N, const std::map> * if it's a structure type, we use reinterpret_cast * todo: not very sure, need further check * */ - if (llvmIrBitCastInstruction->getSrcTy()->isStructTy()) + if (llvmIrBitCastInstruction->getSrcTy()->isStructTy() || + llvmIrBitCastInstruction->getSrcTy()->getPointerElementType()->isStructTy()) { switch (DestEleType->getTypeID()) { @@ -2552,6 +2926,10 @@ rangeAnalysis(State * N, const std::map> boundInfo->virtualRegisterRange.emplace(llvmIrBitCastInstruction, std::make_pair(lowRange, highRange)); break; case Type::IntegerTyID: + { + bool canGetRange = false; + float f_originLow = (float)originLow; + float f_originHigh = (float)originHigh; switch (DestEleType->getIntegerBitWidth()) { case 8: @@ -2563,21 +2941,27 @@ rangeAnalysis(State * N, const std::map> highRange = static_cast(*reinterpret_cast(&originHigh)); break; case 32: - lowRange = static_cast(*reinterpret_cast(&originLow)); - highRange = static_cast(*reinterpret_cast(&originHigh)); + lowRange = static_cast(*reinterpret_cast(&f_originLow)); + highRange = static_cast(*reinterpret_cast(&f_originHigh)); + canGetRange = true; break; case 64: - lowRange = static_cast(*reinterpret_cast(&originLow)); - highRange = static_cast(*reinterpret_cast(&originHigh)); + lowRange = static_cast(*reinterpret_cast(&originLow)); + highRange = static_cast(*reinterpret_cast(&originHigh)); + canGetRange = true; break; default: flexprint(N->Fe, N->Fm, N->Fpinfo, "\tBitCast: Type::SignedInteger, don't support such bit width yet."); } - flexprint(N->Fe, N->Fm, N->Fpinfo, "\tBitCast: Type::IntegerTyID, %f - %f to %f - %f\n", - vrRangeIt->second.first, vrRangeIt->second.second, lowRange, highRange); - boundInfo->virtualRegisterRange.emplace(llvmIrBitCastInstruction, std::make_pair(lowRange, highRange)); + if (canGetRange) + { + flexprint(N->Fe, N->Fm, N->Fpinfo, "\tBitCast: Type::IntegerTyID, %f - %f to %f - %f\n", + vrRangeIt->second.first, vrRangeIt->second.second, lowRange, highRange); + boundInfo->virtualRegisterRange.emplace(llvmIrBitCastInstruction, std::make_pair(lowRange, highRange)); + } break; + } case Type::StructTyID: flexprint(N->Fe, N->Fm, N->Fpinfo, "\tBitCast: Type::StructTyID, %f - %f to %f - %f\n", vrRangeIt->second.first, vrRangeIt->second.second, originLow, originHigh); @@ -2649,11 +3033,11 @@ rangeAnalysis(State * N, const std::map> auto vrRangeIt = boundInfo->virtualRegisterRange.find(it->second); if (vrRangeIt != boundInfo->virtualRegisterRange.end()) { - double originLow = vrRangeIt->second.first; - double originHigh = vrRangeIt->second.second; - uint64_t originLowWord = *reinterpret_cast(&originLow); - uint64_t originHighWord = *reinterpret_cast(&originHigh); - double lowRange, highRange; + double originLow = vrRangeIt->second.first; + double originHigh = vrRangeIt->second.second; + int64_t originLowWord = *reinterpret_cast(&originLow); + int64_t originHighWord = *reinterpret_cast(&originHigh); + double lowRange, highRange; flexprint(N->Fe, N->Fm, N->Fpinfo, "\tGetElementPtr: find the value holder."); auto valueHolderBitcast = dyn_cast(it->first); auto DestEleType = valueHolderBitcast->getDestTy()->getPointerElementType(); @@ -2701,12 +3085,12 @@ rangeAnalysis(State * N, const std::map> switch (resEleTy->getPrimitiveSizeInBits()) { case 32: - lowRange = static_cast(static_cast(originLowWord >> (32 * elementOffset))); - highRange = static_cast(static_cast(originHighWord >> (32 * elementOffset))); + lowRange = static_cast(static_cast(originLowWord >> (32 * elementOffset))); + highRange = static_cast(static_cast(originHighWord >> (32 * elementOffset))); break; case 64: - lowRange = static_cast(static_cast(originLowWord)); - highRange = static_cast(static_cast(originHighWord)); + lowRange = static_cast(static_cast(originLowWord)); + highRange = static_cast(static_cast(originHighWord)); break; default: flexprint(N->Fe, N->Fm, N->Fpinfo, "\tBitCast: Type::SignedInteger, don't support such bit width yet."); @@ -2737,8 +3121,8 @@ rangeAnalysis(State * N, const std::map> { auto resVec = getGEPArrayRange(N, llvmIrGetElePtrInstruction, boundInfo->virtualRegisterRange); - if (resVec.first) - boundInfo->virtualRegisterRange.emplace(llvmIrGetElePtrInstruction, resVec.second); + if (resVec.first) + boundInfo->virtualRegisterRange.emplace(llvmIrGetElePtrInstruction, resVec.second); } else if (llvmIrGetElePtrInstruction->getPointerOperandType() ->getPointerElementType() diff --git a/src/newton/newton-irPass-LLVMIR-rangeAnalysis.h b/src/newton/newton-irPass-LLVMIR-rangeAnalysis.h index e8631d06f..bfc6ad243 100644 --- a/src/newton/newton-irPass-LLVMIR-rangeAnalysis.h +++ b/src/newton/newton-irPass-LLVMIR-rangeAnalysis.h @@ -54,10 +54,12 @@ #include #include #include +#include #include #include "llvm/Analysis/MemorySSAUpdater.h" #include "llvm/Bitcode/BitcodeWriter.h" +#include "llvm/IR/Constant.h" #include "llvm/IR/DebugInfoMetadata.h" #include "llvm/IR/LegacyPassManager.h" #include "llvm/IR/Metadata.h" @@ -70,14 +72,14 @@ #include "llvm/Support/SourceMgr.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Support/Path.h" +#include "llvm/Transforms/IPO.h" #include "llvm/Transforms/Scalar.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" #include "llvm/Transforms/Utils/Cloning.h" #include "llvm/Transforms/Utils/FunctionComparator.h" #ifdef __cplusplus -extern "C" -{ +extern "C" { #endif /* __cplusplus */ #include "flextypes.h" @@ -106,13 +108,14 @@ extern "C" typedef struct BoundInfo { std::map> virtualRegisterRange; std::map calleeBound; - std::map callerMap; } BoundInfo; std::pair> -rangeAnalysis(State * N, const std::map> & typeRange, +rangeAnalysis(State * N, llvm::Function & llvmIrFunction, BoundInfo * boundInfo, + std::map & callerMap, + const std::map> & typeRange, const std::map>> & virtualRegisterVectorRange, - BoundInfo * boundInfo, llvm::Function & llvmIrFunction, bool overLoadFunc); + bool overLoadFunc); #ifdef __cplusplus } /* extern "C" */ diff --git a/src/newton/newton-irPass-LLVMIR-shrinkTypeByRange.cpp b/src/newton/newton-irPass-LLVMIR-shrinkTypeByRange.cpp index 96ce7a222..0b9d4f157 100644 --- a/src/newton/newton-irPass-LLVMIR-shrinkTypeByRange.cpp +++ b/src/newton/newton-irPass-LLVMIR-shrinkTypeByRange.cpp @@ -92,11 +92,13 @@ varType getFloatingTypeEnum(double min, double max) { varType finalType; - if ((std::abs(min) < FLT_MAX) && (std::abs(max) < FLT_MAX)) + if ((FLT_EPSILON < std::abs(min) && std::abs(min) < FLT_MAX) && + (FLT_EPSILON < std::abs(max) && std::abs(max) < FLT_MAX)) { finalType = FLOAT; } - else if ((std::abs(min) < DBL_MAX) && (std::abs(max) < DBL_MAX)) + else if ((DBL_EPSILON < std::abs(min) && std::abs(min) < DBL_MAX) && + (DBL_EPSILON < std::abs(max) && std::abs(max) < DBL_MAX)) { finalType = DOUBLE; } @@ -250,7 +252,7 @@ getTypeInfo(State * N, Value * inValue, case Type::FloatTyID: break; case Type::DoubleTyID: - typeInformation = getShrinkDoubleType(N, inValue, vrRangeIt->second); +// typeInformation = getShrinkDoubleType(N, inValue, vrRangeIt->second); break; default: break; @@ -925,6 +927,11 @@ matchDestType(State * N, Instruction * inInstruction, BasicBlock & llvmIrBasicBl typeInfo backType; backType.signFlag = isSignedValue(inInstruction); backType.valueType = inInstType; + if (isa(inInstruction)) + { + unsigned ptAddressSpace = srcType->getPointerAddressSpace(); + backType.valueType = backType.valueType->getPointerTo(ptAddressSpace); + } for (size_t id = 0; id < inInstruction->getNumOperands(); id++) { auto newTypeValue = rollbackType(N, inInstruction, id, llvmIrBasicBlock, typeChangedInst, backType); @@ -974,7 +981,13 @@ matchDestType(State * N, Instruction * inInstruction, BasicBlock & llvmIrBasicBl /* * roll back operands to typeInformation.valueType * */ - for (size_t id = 0; id < inInstruction->getNumOperands(); id++) + if (isa(inInstruction)) + { + unsigned ptAddressSpace = srcType->getPointerAddressSpace(); + typeInformation.valueType = typeInformation.valueType->getPointerTo(ptAddressSpace); + } + size_t roll_backed_op_num = isa(inInstruction) ? 1 : inInstruction->getNumOperands(); + for (size_t id = 0; id < roll_backed_op_num; id++) { typeInfo operandPrevTypeInfo{typeInformation.valueType, isSignedValue(inInstruction->getOperand(id))}; @@ -1496,6 +1509,10 @@ mergeCast(State * N, Function & llvmIrFunction, Instruction * llvmIrInstruction = &*itBB++; switch (llvmIrInstruction->getOpcode()) { + case Instruction::FPToUI: + case Instruction::FPToSI: + case Instruction::SIToFP: + case Instruction::UIToFP: case Instruction::ZExt: case Instruction::SExt: case Instruction::FPExt: @@ -1540,7 +1557,23 @@ mergeCast(State * N, Function & llvmIrFunction, * */ Value * castInst; auto valueType = llvmIrInstruction->getType(); - if (valueType->isIntegerTy()) + if ((valueType->isFloatTy() || valueType->isDoubleTy()) && + sourceOperand->getType()->isIntegerTy()) + { + // float fa = (float)ia; + bool isSigned = sourceInst->getOpcode() == Instruction::SIToFP; + castInst = isSigned ? Builder.CreateSIToFP(sourceOperand, valueType) + : Builder.CreateUIToFP(sourceOperand, valueType); + } + else if (valueType->isIntegerTy() && + (sourceOperand->getType()->isFloatTy() || sourceOperand->getType()->isDoubleTy())) + { + // int iq = (int)fq; + bool isSigned = sourceInst->getOpcode() == Instruction::FPToSI; + castInst = isSigned ? Builder.CreateFPToSI(sourceOperand, valueType) + : Builder.CreateFPToUI(sourceOperand, valueType); + } + else if (valueType->isIntegerTy()) { castInst = Builder.CreateIntCast(sourceOperand, valueType, llvmIrInstruction->getOpcode() == Instruction::SExt); @@ -1648,6 +1681,10 @@ countCastInst(State * N, Function & llvmIrFunction) { switch (llvmIrInstruction.getOpcode()) { + case Instruction::FPToUI: + case Instruction::FPToSI: + case Instruction::SIToFP: + case Instruction::UIToFP: case Instruction::ZExt: case Instruction::SExt: case Instruction::FPExt: @@ -1820,6 +1857,141 @@ getDependencyLink(State * N, Function & llvmIrFunction) return dependencyLink; } +/* + * There are three kinds of instructions in LLVM that are related with signed/unsigned + * 1. nsw/nuw with Add, Sub, Mul, Shl + * 2. UDiv/SDiv, URem/SRem, LShr/AShr + * 3. sgt/ugt, sge/uge, slt/ult, sle/ule in ICmp + * Note: Sign bit can only change from `signed` to `unsigned` in `type shrinkage`. + * Remember: We have matched the type of operands before this function. + * */ +void +upDateInstSignFlag(State * N, Function & llvmIrFunction, + std::map> & virtualRegisterRange, + std::map & typeChangedInst) { + for (BasicBlock & llvmIrBasicBlock : llvmIrFunction) { + for (BasicBlock::iterator itBB = llvmIrBasicBlock.begin(); itBB != llvmIrBasicBlock.end();) { + Instruction *llvmIrInstruction = &*itBB++; + switch (llvmIrInstruction->getOpcode()) { + case Instruction::Add: + case Instruction::Sub: + case Instruction::Mul: + case Instruction::Shl: + { + /* + * nsw/nuw + * Implement when meet + * */ + auto lhs = llvmIrInstruction->getOperand(0); + auto rhs = llvmIrInstruction->getOperand(1); + auto lhsIt = typeChangedInst.find(lhs); + auto rhsIt = typeChangedInst.find(rhs); + if ((lhsIt != typeChangedInst.end() || rhsIt != typeChangedInst.end())) { + if (lhsIt->second.signFlag || rhsIt->second.signFlag) { + if (llvmIrInstruction->hasNoUnsignedWrap()) { + /* + * change to `nsw` + * */ + } + } else { + if (llvmIrInstruction->hasNoSignedWrap()) { + /* + * change to `nuw` + * */ + } + } + } + flexprint(N->Fe, N->Fm, N->Fperr, + "\tupDateInstSignFlag with nsw/nuw: Not Implement!\n"); + break; + } + case Instruction::SDiv: + case Instruction::UDiv: + case Instruction::URem: + case Instruction::SRem: + case Instruction::LShr: + case Instruction::AShr: + { + /* + * Different inst for signed/unsigned. + * Should also care about + * 1. the extent. + * 2. one operand is signed, the other is unsigned. + * Check the LLVM Ref: https://llvm.org/docs/LangRef.html#llvm-language-reference-manual + * Implement when meet. + * */ + flexprint(N->Fe, N->Fm, N->Fperr, + "\tupDateInstSignFlag with diff inst: Not Implement!\n"); + break; + } + case Instruction::ICmp: + if (auto llvmIrICmpInstruction = dyn_cast(llvmIrInstruction)) + { + if (llvmIrICmpInstruction->isUnsigned()) { + break; + } + auto leftOperand = llvmIrICmpInstruction->getOperand(0); + auto rightOperand = llvmIrICmpInstruction->getOperand(1); + /* + * If either of the operand is constant, + * and the variable operand can only change from `signed` to `unsigned`, + * so we only care about when the variable operand is `unsigned`. + * Note: here's instruction is signed! + * if the constant operand is negative value, the `scf by range` should simplify it + * if the constant operand is positive value, we can use `unsigned` flag + * */ + if ((isa(leftOperand) && !isa(rightOperand))) + { + llvmIrICmpInstruction->swapOperands(); + leftOperand = llvmIrICmpInstruction->getOperand(0); + rightOperand = llvmIrICmpInstruction->getOperand(1); + } + if (!isa(leftOperand) && isa(rightOperand)) { + /* + * We only check the type has been stored in typeChangedInst, which means might be changed + * and only check if the variable is unsigned. + * */ + auto itTC = typeChangedInst.find(leftOperand); + if (itTC == typeChangedInst.end() || itTC->second.signFlag) { + break; + } + + ConstantInt * constInt = llvm::dyn_cast(rightOperand); + assert(nullptr != constInt && "ICmp: it's not a const int!!!!!!!!!!!\n"); + if (constInt->getSExtValue() < 0) { + break; + } + + auto originalPred = llvmIrICmpInstruction->getPredicate(); + llvmIrICmpInstruction->setPredicate(ICmpInst::getUnsignedPredicate(originalPred)); + } + /* + * If both of the operands are variable with different sign bit, + * we check the range of them (if we can), e.g. + * + * %c = icmp slt i16 %a, %b + * + * if the %a is unsigned, but the max range is less than 32767, we can ignore it. + * otherwise, it overflows, and we should extend the operands, like, + * + * %c = sext i16 %a to i32 + * %d = sext i16 %b to i32 + * %e = icmp slt i32 %c, %d + * %f = trunc i32 %c to i16 + * %g = trunc i32 %d to i16 + * + * Then we replace the `%f`, `%g` to `%a`, `%b`. + * And also replace the `%e` to the previous icmp result. + * */ + flexprint(N->Fe, N->Fm, N->Fperr, + "\tupDateInstSignFlag ICmp with both variable: Not Implement!\n"); + break; + } + } + } + } +} + void shrinkType(State * N, BoundInfo * boundInfo, Function & llvmIrFunction) { @@ -1827,19 +1999,10 @@ shrinkType(State * N, BoundInfo * boundInfo, Function & llvmIrFunction) * 1. construct instruction dependency link * 2. work with roll back strategies * */ - std::vector> prevDepLink = getDependencyLink(N, llvmIrFunction); - std::map typeChangedInst = shrinkInstType(N, boundInfo, llvmIrFunction); - mergeCast(N, llvmIrFunction, boundInfo->virtualRegisterRange, typeChangedInst); - std::vector> newDepLink = getDependencyLink(N, llvmIrFunction); - - for (auto & depLink : newDepLink) - { - if (rollBackStrategy(N, depLink)) - { - rollBackDependencyLink(N, depLink, boundInfo->virtualRegisterRange, typeChangedInst); - } - } + std::map typeChangedInst = shrinkInstType(N, boundInfo, llvmIrFunction); mergeCast(N, llvmIrFunction, boundInfo->virtualRegisterRange, typeChangedInst); + + upDateInstSignFlag(N, llvmIrFunction, boundInfo->virtualRegisterRange, typeChangedInst); +} } -} \ No newline at end of file diff --git a/src/newton/newton-irPass-LLVMIR-simplifyControlFlowByRange.cpp b/src/newton/newton-irPass-LLVMIR-simplifyControlFlowByRange.cpp index 9326bf53e..be58e7f25 100644 --- a/src/newton/newton-irPass-LLVMIR-simplifyControlFlowByRange.cpp +++ b/src/newton/newton-irPass-LLVMIR-simplifyControlFlowByRange.cpp @@ -49,101 +49,6 @@ enum CmpRes { Unsupported = 6, }; -CmpRes -compareFCmpConstWithVariableRange(FCmpInst * llvmIrFCmpInstruction, double variableLowerBound, double variableUpperBound, - double constValue) -{ - switch (llvmIrFCmpInstruction->getPredicate()) - { - case FCmpInst::FCMP_TRUE: - return CmpRes::AlwaysTrue; - case FCmpInst::FCMP_FALSE: - return CmpRes::AlwaysFalse; - /* - * Ordered means that neither operand is a QNAN while unordered means that either operand may be a QNAN. - * More details in https://llvm.org/docs/LangRef.html#fcmp-instruction - * */ - case FCmpInst::FCMP_OEQ: - case FCmpInst::FCMP_UEQ: - if ((variableLowerBound == variableUpperBound) && (variableUpperBound == constValue)) - { - return CmpRes::AlwaysTrue; - } - else - { - return CmpRes::AlwaysFalse; - } - case FCmpInst::FCMP_OGT: - case FCmpInst::FCMP_UGT: - if (variableLowerBound > constValue) - { - return CmpRes::AlwaysTrue; - } - else if (variableUpperBound <= constValue) - { - return CmpRes::AlwaysFalse; - } - else - { - return CmpRes::Depends; - } - case FCmpInst::FCMP_OGE: - case FCmpInst::FCMP_UGE: - if (variableLowerBound >= constValue) - { - return CmpRes::AlwaysTrue; - } - else if (variableUpperBound < constValue) - { - return CmpRes::AlwaysFalse; - } - else - { - return CmpRes::Depends; - } - case FCmpInst::FCMP_OLT: - case FCmpInst::FCMP_ULT: - if (variableUpperBound < constValue) - { - return CmpRes::AlwaysTrue; - } - else if (variableLowerBound >= constValue) - { - return CmpRes::AlwaysFalse; - } - else - { - return CmpRes::Depends; - } - case FCmpInst::FCMP_OLE: - case FCmpInst::FCMP_ULE: - if (variableUpperBound <= constValue) - { - return CmpRes::AlwaysTrue; - } - else if (variableLowerBound > constValue) - { - return CmpRes::AlwaysFalse; - } - else - { - return CmpRes::Depends; - } - case FCmpInst::FCMP_ONE: - case FCmpInst::FCMP_UNE: - if ((variableLowerBound == variableUpperBound) && (variableUpperBound != constValue)) - { - return CmpRes::AlwaysTrue; - } - else - { - return CmpRes::AlwaysFalse; - } - default: - return CmpRes::Unsupported; - } -} - CmpRes compareFCmpWithVariableRange(FCmpInst * llvmIrFCmpInstruction, double leftVariableLowerBound, double leftVariableUpperBound, @@ -162,14 +67,37 @@ compareFCmpWithVariableRange(FCmpInst * llvmIrFCmpInstruction, double leftVariab case FCmpInst::FCMP_OEQ: case FCmpInst::FCMP_UEQ: if ((leftVariableLowerBound == rightVariableLowerBound) && - (leftVariableUpperBound == rightVariableUpperBound)) + (rightVariableLowerBound == leftVariableUpperBound) && + (leftVariableUpperBound == rightVariableUpperBound)) { return CmpRes::AlwaysTrue; } - else - { - return CmpRes::AlwaysFalse; - } + else if (leftVariableLowerBound > rightVariableUpperBound || + leftVariableUpperBound < rightVariableLowerBound) + { + return CmpRes::AlwaysFalse; + } + else + { + return CmpRes::Depends; + } + case FCmpInst::FCMP_ONE: + case FCmpInst::FCMP_UNE: + if ((leftVariableUpperBound < rightVariableLowerBound) || + (leftVariableLowerBound > rightVariableUpperBound)) + { + return CmpRes::AlwaysTrue; + } + else if ((leftVariableLowerBound == rightVariableLowerBound) && + (rightVariableLowerBound == leftVariableUpperBound) && + (leftVariableUpperBound == rightVariableUpperBound)) + { + return CmpRes::AlwaysFalse; + } + else + { + return CmpRes::Depends; + } case FCmpInst::FCMP_OGT: case FCmpInst::FCMP_UGT: if (leftVariableLowerBound > rightVariableUpperBound) @@ -226,106 +154,6 @@ compareFCmpWithVariableRange(FCmpInst * llvmIrFCmpInstruction, double leftVariab { return CmpRes::Depends; } - case FCmpInst::FCMP_ONE: - case FCmpInst::FCMP_UNE: - if ((leftVariableUpperBound < rightVariableLowerBound) || - (leftVariableLowerBound > rightVariableUpperBound)) - { - return CmpRes::AlwaysTrue; - } - else - { - return CmpRes::AlwaysFalse; - } - default: - return CmpRes::Unsupported; - } -} - -CmpRes -compareICmpConstWithVariableRange(ICmpInst * llvmIrICmpInstruction, double variableLowerBound, double variableUpperBound, - double constValue) -{ - switch (llvmIrICmpInstruction->getPredicate()) - { - /* - * Ordered means that neither operand is a QNAN while unordered means that either operand may be a QNAN. - * More details in https://llvm.org/docs/LangRef.html#icmp-instruction - * */ - case ICmpInst::ICMP_EQ: - if ((variableLowerBound == variableUpperBound) && (variableUpperBound == constValue)) - { - return CmpRes::AlwaysTrue; - } - else - { - return CmpRes::AlwaysFalse; - } - case ICmpInst::ICMP_NE: - if ((variableLowerBound == variableUpperBound) && (variableUpperBound != constValue)) - { - return CmpRes::AlwaysTrue; - } - else - { - return CmpRes::AlwaysFalse; - } - case ICmpInst::ICMP_UGT: - case ICmpInst::ICMP_SGT: - if (variableLowerBound > constValue) - { - return CmpRes::AlwaysTrue; - } - else if (variableUpperBound <= constValue) - { - return CmpRes::AlwaysFalse; - } - else - { - return CmpRes::Depends; - } - case ICmpInst::ICMP_UGE: - case ICmpInst::ICMP_SGE: - if (variableLowerBound >= constValue) - { - return CmpRes::AlwaysTrue; - } - else if (variableUpperBound < constValue) - { - return CmpRes::AlwaysFalse; - } - else - { - return CmpRes::Depends; - } - case ICmpInst::ICMP_ULT: - case ICmpInst::ICMP_SLT: - if (variableUpperBound < constValue) - { - return CmpRes::AlwaysTrue; - } - else if (variableLowerBound >= constValue) - { - return CmpRes::AlwaysFalse; - } - else - { - return CmpRes::Depends; - } - case ICmpInst::ICMP_ULE: - case ICmpInst::ICMP_SLE: - if (variableUpperBound <= constValue) - { - return CmpRes::AlwaysTrue; - } - else if (variableLowerBound > constValue) - { - return CmpRes::AlwaysFalse; - } - else - { - return CmpRes::Depends; - } default: return CmpRes::Unsupported; } @@ -338,29 +166,37 @@ compareICmpWithVariableRange(ICmpInst * llvmIrICmpInstruction, double leftVariab { switch (llvmIrICmpInstruction->getPredicate()) { - /* - * Ordered means that neither operand is a QNAN while unordered means that either operand may be a QNAN. - * More details in https://llvm.org/docs/LangRef.html#icmp-instruction - * */ case ICmpInst::ICMP_EQ: if ((leftVariableLowerBound == rightVariableLowerBound) && + (rightVariableLowerBound == leftVariableUpperBound) && (leftVariableUpperBound == rightVariableUpperBound)) { return CmpRes::AlwaysTrue; } - else + else if (leftVariableLowerBound > rightVariableUpperBound || + leftVariableUpperBound < rightVariableLowerBound) { return CmpRes::AlwaysFalse; } + else + { + return CmpRes::Depends; + } case ICmpInst::ICMP_NE: if (leftVariableUpperBound < rightVariableLowerBound || leftVariableLowerBound > rightVariableUpperBound) { return CmpRes::AlwaysTrue; } - else + else if ((leftVariableLowerBound == rightVariableLowerBound) && + (rightVariableLowerBound == leftVariableUpperBound) && + (leftVariableUpperBound == rightVariableUpperBound)) { return CmpRes::AlwaysFalse; } + else + { + return CmpRes::Depends; + } case ICmpInst::ICMP_UGT: case ICmpInst::ICMP_SGT: if (leftVariableLowerBound > rightVariableUpperBound) @@ -465,8 +301,9 @@ simplifyControlFlow(State * N, BoundInfo * boundInfo, Function & llvmIrFunction) auto rightOperand = llvmIrICmpInstruction->getOperand(1); if ((isa(leftOperand) && !isa(rightOperand))) { - std::swap(leftOperand, rightOperand); - flexprint(N->Fe, N->Fm, N->Fperr, "\tICmp: swap left and right, need to change the type of prediction\n"); + llvmIrICmpInstruction->swapOperands(); + leftOperand = llvmIrICmpInstruction->getOperand(0); + rightOperand = llvmIrICmpInstruction->getOperand(1); } else if (isa(leftOperand) && isa(rightOperand)) { @@ -521,7 +358,11 @@ simplifyControlFlow(State * N, BoundInfo * boundInfo, Function & llvmIrFunction) double constValue = 0.0; if (ConstantInt * constInt = llvm::dyn_cast(rightOperand)) { - constValue = constInt->getSExtValue(); + if (llvmIrICmpInstruction->isSigned()) { + constValue = constInt->getSExtValue(); + } else { + constValue = constInt->getZExtValue(); + } } else { @@ -537,10 +378,10 @@ simplifyControlFlow(State * N, BoundInfo * boundInfo, Function & llvmIrFunction) flexprint(N->Fe, N->Fm, N->Fpinfo, "\tICmp: varibale's lower bound: %f, upper bound: %f\n", vrRangeIt->second.first, vrRangeIt->second.second); - CmpRes compareResult = compareICmpConstWithVariableRange(llvmIrICmpInstruction, + CmpRes compareResult = compareICmpWithVariableRange(llvmIrICmpInstruction, vrRangeIt->second.first, vrRangeIt->second.second, - constValue); + constValue, constValue); flexprint(N->Fe, N->Fm, N->Fpinfo, "\tICmp: the comparison result is %d\n", compareResult); /* @@ -581,7 +422,7 @@ simplifyControlFlow(State * N, BoundInfo * boundInfo, Function & llvmIrFunction) auto rightOperand = llvmIrFCmpInstruction->getOperand(1); if ((isa(leftOperand) && !isa(rightOperand))) { - std::swap(leftOperand, rightOperand); + llvmIrFCmpInstruction->swapOperands(); flexprint(N->Fe, N->Fm, N->Fperr, "\tFCmp: swap left and right, need to change the type of prediction\n"); } else if (isa(leftOperand) && isa(rightOperand)) @@ -656,10 +497,10 @@ simplifyControlFlow(State * N, BoundInfo * boundInfo, Function & llvmIrFunction) flexprint(N->Fe, N->Fm, N->Fpinfo, "\tFCmp: varibale's lower bound: %f, upper bound: %f\n", vrRangeIt->second.first, vrRangeIt->second.second); - CmpRes compareResult = compareFCmpConstWithVariableRange(llvmIrFCmpInstruction, + CmpRes compareResult = compareFCmpWithVariableRange(llvmIrFCmpInstruction, vrRangeIt->second.first, vrRangeIt->second.second, - constValue); + constValue, constValue); flexprint(N->Fe, N->Fm, N->Fpinfo, "\tFCmp: the comparison result is %d\n", compareResult); /*