Test source: git
Source: <stdin>
-- 1. ModuleToFunctionPassAdaptor
-- 1. PassManager<Function> : Skipping NOP
-- 2. InstSimplifyPass
----------------------------------------
define ptr @test() {
#0:
%base = inttoptr i16 65535 to ptr
%gep = gep ptr %base, 1 x i8 1
ret ptr %gep
}
Transformation seems to be correct! (syntactically equal)
-- 3. InstSimplifyPass
----------------------------------------
define ptr @test() {
#0:
%base = inttoptr i16 65535 to ptr
%gep = gep ptr %base, 1 x i8 1
ret ptr %gep
}
=>
define ptr @test() {
#0:
%__constexpr_0 = inttoptr i16 65280 to ptr
ret ptr %__constexpr_0
}
Transformation doesn't verify! (unsound)
ERROR: Value mismatch
Example:
Source:
ptr %base = phy-ptr(addr=65535) / Address=#xffff
ptr %gep = 0x0
SOURCE MEMORY STATE
===================
NON-LOCAL BLOCKS:
Block 0 > size: 0 align: 1 alloc type: 0 alive: false address: 0
Block 1 > size: 0 align: 1 alloc type: 0 alive: true address: 32769
Target:
ptr %__constexpr_0 = phy-ptr(addr=65280) / Address=#xff00
Source value: 0x0
Target value: phy-ptr(addr=65280) / Address=#xff00
Pass: InstSimplifyPass
Command line: '/home/nlopes/llvm/build/bin/opt' '-load=/home/nlopes/alive2/build/tv/tv.so' '-load-pass-plugin=/home/nlopes/alive2/build/tv/tv.so' '-tv-exit-on-error' '-S' '-passes=instsimplify' '-tv-smt-to=20000' '-tv-report-dir=/home/nlopes/alive2/build/logs' '-tv-smt-stats'
Wrote bitcode to: "/home/nlopes/alive2/build/logs/in_5n3bTnqI_tBMv.bc"
------------------- SMT STATS -------------------
Num queries: 5
Num invalid: 0
Num skips: 0
Num trivial: 9 (64.3%)
Num timeout: 0 (0.0%)
Num errors: 0 (0.0%)
Num SAT: 5 (100.0%)
Num UNSAT: 0 (0.0%)
Alive2: Transform doesn't verify; aborting!
/home/nlopes/alive2/build/opt-alive.sh -S -passes=instsimplify < /bitbucket/nlopes/llvm/llvm/test/Transforms/InstSimplify/ConstProp/inttoptr-gep-index-width.ll | /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/InstSimplify/ConstProp/inttoptr-gep-index-width.ll # RUN: at line 2 + /home/nlopes/alive2/build/opt-alive.sh -S -passes=instsimplify + /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/InstSimplify/ConstProp/inttoptr-gep-index-width.ll FileCheck error: '<stdin>' is empty. FileCheck command line: /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/InstSimplify/ConstProp/inttoptr-gep-index-width.ll