From dc24455c39c517e8498298a9aca2e6fd21d6ed87 Mon Sep 17 00:00:00 2001 From: Pei Mu Date: Fri, 10 Mar 2023 16:22:09 +0000 Subject: [PATCH] it can be bool type Addresses #647. --- ...83499252bf6ae9918b05319c0c7e5268821a1f.txt | 46 +++++++++++++++++++ .../newton-irPass-LLVMIR-rangeAnalysis.cpp | 36 +++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 analysis/statistics/f883499252bf6ae9918b05319c0c7e5268821a1f.txt diff --git a/analysis/statistics/f883499252bf6ae9918b05319c0c7e5268821a1f.txt b/analysis/statistics/f883499252bf6ae9918b05319c0c7e5268821a1f.txt new file mode 100644 index 000000000..d1d038794 --- /dev/null +++ b/analysis/statistics/f883499252bf6ae9918b05319c0c7e5268821a1f.txt @@ -0,0 +1,46 @@ + +changeset: 1448:f883499252bf6ae9918b05319c0c7e5268821a1f +char kNewtonVersion[] = "0.3-alpha-1448 (f883499252bf6ae9918b05319c0c7e5268821a1f) (build 03-10-2023-13:10-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/src/newton/newton-irPass-LLVMIR-rangeAnalysis.cpp b/src/newton/newton-irPass-LLVMIR-rangeAnalysis.cpp index fc3bc3fda..e8b31d0eb 100644 --- a/src/newton/newton-irPass-LLVMIR-rangeAnalysis.cpp +++ b/src/newton/newton-irPass-LLVMIR-rangeAnalysis.cpp @@ -1978,6 +1978,10 @@ rangeAnalysis(State * N, llvm::Function & llvmIrFunction, BoundInfo * boundInfo, { switch (bitWidth) { + case 1: + lowerBound = static_cast(static_cast(vrRangeIt->second.first)); + upperBound = static_cast(static_cast(vrRangeIt->second.second)); + break; case 8: lowerBound = static_cast(static_cast(vrRangeIt->second.first)); upperBound = static_cast(static_cast(vrRangeIt->second.second)); @@ -2048,6 +2052,10 @@ rangeAnalysis(State * N, llvm::Function & llvmIrFunction, BoundInfo * boundInfo, double lowerBound, upperBound; switch (bitWidth) { + case 1: + lowerBound = constValue << (static_cast(vrRangeIt->second.first)); + upperBound = constValue << (static_cast(vrRangeIt->second.second)); + break; case 8: lowerBound = constValue << (static_cast(vrRangeIt->second.first)); upperBound = constValue << (static_cast(vrRangeIt->second.second)); @@ -2092,6 +2100,10 @@ rangeAnalysis(State * N, llvm::Function & llvmIrFunction, BoundInfo * boundInfo, double resMin = 0, resMax = 0; switch (bitWidth) { + case 1: + resMin = static_cast(vrRangeIt->second.first) << constValue; + resMax = static_cast(vrRangeIt->second.second) << constValue; + break; case 8: resMin = static_cast(vrRangeIt->second.first) << constValue; resMax = static_cast(vrRangeIt->second.second) << constValue; @@ -2210,6 +2222,10 @@ rangeAnalysis(State * N, llvm::Function & llvmIrFunction, BoundInfo * boundInfo, double lowerBound, upperBound; switch (bitWidth) { + case 1: + lowerBound = constValue >> (static_cast(vrRangeIt->second.first)); + upperBound = constValue >> (static_cast(vrRangeIt->second.second)); + break; case 8: lowerBound = constValue >> (static_cast(vrRangeIt->second.first)); upperBound = constValue >> (static_cast(vrRangeIt->second.second)); @@ -2254,6 +2270,10 @@ rangeAnalysis(State * N, llvm::Function & llvmIrFunction, BoundInfo * boundInfo, double resMin = 0, resMax = 0; switch (bitWidth) { + case 1: + resMin = static_cast(vrRangeIt->second.first) >> constValue; + resMax = static_cast(vrRangeIt->second.second) >> constValue; + break; case 8: resMin = static_cast(vrRangeIt->second.first) >> constValue; resMax = static_cast(vrRangeIt->second.second) >> constValue; @@ -2321,6 +2341,10 @@ rangeAnalysis(State * N, llvm::Function & llvmIrFunction, BoundInfo * boundInfo, { switch (bitWidth) { + case 1: + leftMin = static_cast(static_cast(vrRangeIt->second.first)); + leftMax = static_cast(static_cast(vrRangeIt->second.second)); + break; case 8: leftMin = static_cast(static_cast(vrRangeIt->second.first)); leftMax = static_cast(static_cast(vrRangeIt->second.second)); @@ -2353,6 +2377,10 @@ rangeAnalysis(State * N, llvm::Function & llvmIrFunction, BoundInfo * boundInfo, double rightMin = 0, rightMax = 0; switch (bitWidth) { + case 1: + rightMin = static_cast(vrRangeIt->second.first); + rightMax = static_cast(vrRangeIt->second.second); + break; case 8: rightMin = static_cast(vrRangeIt->second.first); rightMax = static_cast(vrRangeIt->second.second); @@ -2410,6 +2438,10 @@ rangeAnalysis(State * N, llvm::Function & llvmIrFunction, BoundInfo * boundInfo, double lowerBound, upperBound; switch (bitWidth) { + case 1: + lowerBound = constValue >> (static_cast(vrRangeIt->second.first)); + upperBound = constValue >> (static_cast(vrRangeIt->second.second)); + break; case 8: lowerBound = constValue >> (static_cast(vrRangeIt->second.first)); upperBound = constValue >> (static_cast(vrRangeIt->second.second)); @@ -2454,6 +2486,10 @@ rangeAnalysis(State * N, llvm::Function & llvmIrFunction, BoundInfo * boundInfo, double resMin = 0, resMax = 0; switch (bitWidth) { + case 1: + resMin = (static_cast(vrRangeIt->second.first)) >> constValue; + resMax = (static_cast(vrRangeIt->second.second)) >> constValue; + break; case 8: resMin = (static_cast(vrRangeIt->second.first)) >> constValue; resMax = (static_cast(vrRangeIt->second.second)) >> constValue;