Test source: git
Source: <stdin> -- 1. ModuleToFunctionPassAdaptor -- 1. PassManager<Function> : Skipping NOP -- 2. SeparateConstOffsetFromGEPPass ---------------------------------------- define i64 @test1(ptr %array, i64 %i, i64 %j) { entry: %add = add nsw i64 %i, 5 %gep = gep inbounds ptr %array, 8 x i64 %add store i64 %j, ptr %gep, align 8 %add2 = add nsw i64 %i, 6 %gep2 = gep inbounds ptr %array, 8 x i64 %add2 store i64 %j, ptr %gep2, align 8 %add3 = add nsw i64 %i, 35 %gep3 = gep inbounds ptr %array, 8 x i64 %add3 store i64 %add, ptr %gep3, align 8 ret i64 undef } Transformation seems to be correct! (syntactically equal) -- 3. SeparateConstOffsetFromGEPPass ---------------------------------------- define i64 @test1(ptr %array, i64 %i, i64 %j) { entry: %add = add nsw i64 %i, 5 %gep = gep inbounds ptr %array, 8 x i64 %add store i64 %j, ptr %gep, align 8 %add2 = add nsw i64 %i, 6 %gep2 = gep inbounds ptr %array, 8 x i64 %add2 store i64 %j, ptr %gep2, align 8 %add3 = add nsw i64 %i, 35 %gep3 = gep inbounds ptr %array, 8 x i64 %add3 store i64 %add, ptr %gep3, align 8 ret i64 undef } => define i64 @test1(ptr %array, i64 %i, i64 %j) { entry: %add = add nsw i64 %i, 5 %#0 = gep ptr %array, 8 x i64 %i %gep4 = gep inbounds ptr %#0, 1 x i64 40 store i64 %j, ptr %gep4, align 8 %#1 = gep ptr %array, 8 x i64 %i %gep26 = gep inbounds ptr %#1, 1 x i64 48 store i64 %j, ptr %gep26, align 8 %#2 = gep ptr %array, 8 x i64 %i %gep38 = gep inbounds ptr %#2, 1 x i64 280 store i64 %add, ptr %gep38, align 8 ret i64 undef } Transformation doesn't verify! (not unsound) ERROR: Timeout -- 4. EarlyCSEPass ---------------------------------------- define i64 @test1(ptr %array, i64 %i, i64 %j) { entry: %add = add nsw i64 %i, 5 %#0 = gep ptr %array, 8 x i64 %i %gep4 = gep inbounds ptr %#0, 1 x i64 40 store i64 %j, ptr %gep4, align 8 %#1 = gep ptr %array, 8 x i64 %i %gep26 = gep inbounds ptr %#1, 1 x i64 48 store i64 %j, ptr %gep26, align 8 %#2 = gep ptr %array, 8 x i64 %i %gep38 = gep inbounds ptr %#2, 1 x i64 280 store i64 %add, ptr %gep38, align 8 ret i64 undef } Transformation seems to be correct! (syntactically equal) -- 5. EarlyCSEPass ---------------------------------------- define i64 @test1(ptr %array, i64 %i, i64 %j) { entry: %add = add nsw i64 %i, 5 %#0 = gep ptr %array, 8 x i64 %i %gep4 = gep inbounds ptr %#0, 1 x i64 40 store i64 %j, ptr %gep4, align 8 %#1 = gep ptr %array, 8 x i64 %i %gep26 = gep inbounds ptr %#1, 1 x i64 48 store i64 %j, ptr %gep26, align 8 %#2 = gep ptr %array, 8 x i64 %i %gep38 = gep inbounds ptr %#2, 1 x i64 280 store i64 %add, ptr %gep38, align 8 ret i64 undef } => define i64 @test1(ptr %array, i64 %i, i64 %j) { entry: %add = add nsw i64 %i, 5 %#0 = gep ptr %array, 8 x i64 %i %gep4 = gep inbounds ptr %#0, 1 x i64 40 store i64 %j, ptr %gep4, align 8 %gep26 = gep inbounds ptr %#0, 1 x i64 48 store i64 %j, ptr %gep26, align 8 %gep38 = gep inbounds ptr %#0, 1 x i64 280 store i64 %add, ptr %gep38, align 8 ret i64 undef } Transformation seems to be correct! -- 6. PassManager<Function> : Skipping NOP -- 7. PassManager<Function> : Skipping NOP -- 8. SeparateConstOffsetFromGEPPass ---------------------------------------- define i32 @test2(ptr %array, i32 %i, i32 %j) { entry: %add = add nsw i32 %i, 5 %sext = sext i32 %add to i64 %gep = gep inbounds ptr %array, 4 x i64 %sext store i32 %j, ptr %gep, align 4 %add3 = add nsw i32 %i, 6 %sext4 = sext i32 %add3 to i64 %gep5 = gep inbounds ptr %array, 4 x i64 %sext4 store i32 %j, ptr %gep5, align 4 %add6 = add nsw i32 %i, 35 %sext7 = sext i32 %add6 to i64 %gep8 = gep inbounds ptr %array, 4 x i64 %sext7 store i32 %add, ptr %gep8, align 4 ret i32 undef } Transformation seems to be correct! (syntactically equal) -- 9. SeparateConstOffsetFromGEPPass ---------------------------------------- define i32 @test2(ptr %array, i32 %i, i32 %j) { entry: %add = add nsw i32 %i, 5 %sext = sext i32 %add to i64 %gep = gep inbounds ptr %array, 4 x i64 %sext store i32 %j, ptr %gep, align 4 %add3 = add nsw i32 %i, 6 %sext4 = sext i32 %add3 to i64 %gep5 = gep inbounds ptr %array, 4 x i64 %sext4 store i32 %j, ptr %gep5, align 4 %add6 = add nsw i32 %i, 35 %sext7 = sext i32 %add6 to i64 %gep8 = gep inbounds ptr %array, 4 x i64 %sext7 store i32 %add, ptr %gep8, align 4 ret i32 undef } => define i32 @test2(ptr %array, i32 %i, i32 %j) { entry: %add = add nsw i32 %i, 5 %#0 = sext i32 %i to i64 %#1 = gep ptr %array, 4 x i64 %#0 %gep2 = gep inbounds ptr %#1, 1 x i64 20 store i32 %j, ptr %gep2, align 4 %#2 = sext i32 %i to i64 %#3 = gep ptr %array, 4 x i64 %#2 %gep54 = gep inbounds ptr %#3, 1 x i64 24 store i32 %j, ptr %gep54, align 4 %#4 = sext i32 %i to i64 %#5 = gep ptr %array, 4 x i64 %#4 %gep86 = gep inbounds ptr %#5, 1 x i64 140 store i32 %add, ptr %gep86, align 4 ret i32 undef } Transformation doesn't verify! (unsound) ERROR: Source is more defined than target Example: ptr %array = pointer(non-local, block_id=1, offset=0) i32 %i = #xfffffffc (4294967292, -4) i32 %j = poison Source: i32 %add = #x00000001 (1) i64 %sext = #x0000000000000001 (1) ptr %gep = pointer(non-local, block_id=1, offset=4) i32 %add3 = #x00000002 (2) i64 %sext4 = #x0000000000000002 (2) ptr %gep5 = pointer(non-local, block_id=1, offset=8) i32 %add6 = #x0000001f (31) i64 %sext7 = #x000000000000001f (31) ptr %gep8 = pointer(non-local, block_id=1, offset=124) SOURCE MEMORY STATE =================== NON-LOCAL BLOCKS: Block 0 > size: 0 align: 4 alloc type: 0 alive: false address: 0 Block 1 > size: 128 align: 1 alloc type: 0 alive: true address: 8 Target: i32 %add = #x00000001 (1) i64 %#0 = #xfffffffffffffffc (18446744073709551612, -4) ptr %#1 = pointer(non-local, block_id=1, offset=-16) ptr %gep2 = poison void = UB triggered! Pass: SeparateConstOffsetFromGEPPass 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' '-mtriple=riscv64-unknown-elf' '-passes=separate-const-offset-from-gep,early-cse' '-S' '-tv-smt-to=20000' '-tv-report-dir=/home/nlopes/alive2/build/logs' '-tv-smt-stats' Wrote bitcode to: "/home/nlopes/alive2/build/logs/in_msBK9gD4_w2mi.bc" ------------------- SMT STATS ------------------- Num queries: 35 Num invalid: 0 Num skips: 0 Num trivial: 16 (31.4%) Num timeout: 4 (11.4%) Num errors: 0 (0.0%) Num SAT: 20 (57.1%) Num UNSAT: 11 (31.4%) Alive2: Transform doesn't verify; aborting!
RUN: at line 2: /home/nlopes/alive2/build/opt-alive.sh < /bitbucket/nlopes/llvm/llvm/test/Transforms/SeparateConstOffsetFromGEP/RISCV/split-gep.ll -mtriple=riscv64-unknown-elf -passes='separate-const-offset-from-gep,early-cse' -S | /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/SeparateConstOffsetFromGEP/RISCV/split-gep.ll + /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/SeparateConstOffsetFromGEP/RISCV/split-gep.ll + /home/nlopes/alive2/build/opt-alive.sh -mtriple=riscv64-unknown-elf -passes=separate-const-offset-from-gep,early-cse -S FileCheck error: '<stdin>' is empty. FileCheck command line: /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/SeparateConstOffsetFromGEP/RISCV/split-gep.ll