Fernando Magno Quintao Pereira via llvm-dev
2019-May-27 14:05 UTC
[llvm-dev] GCC Value Range Analysis framework
Hi, that's very interesting: doing the range analysis backwardly, they get some information about variables that are not directly related by statements, like in the example Andrew gave: a_2 = b_1 - 20 if (a_2 < 40) { // we can learn information not only about a_2, but also about b_1 } We have a traditional implementation of range analysis in LLVM. The code is available here (https://homepages.dcc.ufmg.br/~fernando/classes/dcc888/assignment/src/RangeAnalysis_LLVM_38.zip) for LLVM 3.8, and here (https://homepages.dcc.ufmg.br/~fernando/classes/dcc888/assignment/src/RangeAnalysis_LLVM_80.zip) for LLVM 8.0. We have described it in this paper: Raphael Ernani Rodrigues, Victor Hugo Sperle Campos, Fernando Magno Quintão Pereira: A fast and low-overhead technique to secure programs against integer overflows. CGO 2013: 33:1-33:11 I use this implementation of range analysis as a project assignment in a course on Static Program Analysis (https://homepages.dcc.ufmg.br/~fernando/classes/dcc888/assignment/). I believe the implementation is pretty mature. The range analysis works on a slightly different program representation, in which variables are renamed after conditionals. Regards, Fernando> Date: Sat, 25 May 2019 15:30:44 -0700 > From: Chris Lattner via llvm-dev <llvm-dev at lists.llvm.org> > To: llvm-dev at lists.llvm.org > Cc: amacleod at redhat.com > Subject: [llvm-dev] GCC Value Range Analysis framework > Message-ID: <1968F7EB-1E58-496E-AC8A-D02E5A373A4A at nondot.org> > Content-Type: text/plain; charset="utf-8" > > Andrew MacLeod has several great posts on the GCC mailing list that describes his new ‘ranger’ framework. I haven’t dug in deeply, but it looks like a very nicely considered approach, and solves several issues in the corresponding LLVM infra. > > It has been years since I’ve thought about this area - I’d be curious to know if anyone else has thought about this lately, and what you think: > > On-Demand range technology [1/5] - Executive Summary <https://gcc.gnu.org/ml/gcc/2019-05/msg00193.html> > On-Demand range technology [2/5] - Major Components : How it works <https://gcc.gnu.org/ml/gcc/2019-05/msg00194.html> > On-Demand range technology [3/5] - The Prototype <https://gcc.gnu.org/ml/gcc/2019-05/msg00195.html> > On-Demand range technology [4/5] - Performance results <https://gcc.gnu.org/ml/gcc/2019-05/msg00196.html> > On-Demand range technology [5/5] - Looking to the future. <https://gcc.gnu.org/ml/gcc/2019-05/msg00197.html> > > -Chris