google / souper

A superoptimizer for LLVM IR

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

alive2 backend needs to understand dataflow facts

regehr opened this issue · comments

this is for @manasij7479. alive2 cannot double check this result because it has not been taught to understand demanded bits. all dataflow facts supported by Souper are trivial to encode.

regehr@home:~/tmp$ cat foo.opt 
%0:i64 = var
%1:i64 = and 255:i64, %0
infer %1 (demandedBits=0000000000000000000000000000000000000000000000000000000011111111)
regehr@home:~/tmp$ ~/souper-regehr/build/souper-check -infer-rhs foo.opt 
Dataflow Pruned 0/0
There are 2 Guesses
; RHS inferred successfully
result %0
regehr@home:~/tmp$ ~/souper-regehr/build/souper-check -infer-rhs foo.opt -souper-double-check
ERROR: Value mismatch

Example:
i64 %var_0 = #x0000000000000100 (256)

Source:
i64 %103 = #x0000000000000000 (0)
i64 %ifpc = #x0000000000000000 (0)

Target:
i64 %ifpc = #x0000000000000100 (256)
Source value: #x0000000000000000 (0)
Target value: #x0000000000000100 (256)

Transformation proved wrong by alive.
%0:i64 = var ; 0
%1:i64 = and 255:i64, %0
infer %1
result %0
Dataflow Pruned 0/0
There are 2 Guesses
; Failed to infer RHS
regehr@home:~/tmp$ 

Mostly fixed.
Single remaining failing example: Dataflow/demanded-bits8.opt
Seems like this test case uses three different dataflow facts!