mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 04:02:41 +01:00
f6a86e448a
Kuniyuki Iwashima reported in [1] that llvm compiler may convert a loop exit condition with "i < bound" to "i != bound", where "i" is the loop index variable and "bound" is the upper bound. In case that "bound" is not a constant, verifier will always have "i != bound" true, which will cause verifier failure since to verifier this is an infinite loop. The fix is to avoid transforming "i < bound" to "i != bound". In llvm, the transformation is done by IndVarSimplify pass. The compiler checks loop condition cost (i = i + 1) and if the cost is lower, it may transform "i < bound" to "i != bound". This patch implemented getArithmeticInstrCost() in BPF TargetTransformInfo class to return a higher cost for such an operation, which will prevent the transformation for the test case added in this patch. [1] https://lore.kernel.org/netdev/1994df05-8f01-371f-3c3b-d33d7836878c@fb.com/ Differential Revision: https://reviews.llvm.org/D107483 (cherry picked from commit e52946b9ababcbf8e6f40b1b15900ae2e795a1c6) |
||
---|---|---|
.. | ||
BTF | ||
CORE | ||
32-bit-subreg-alu.ll | ||
32-bit-subreg-cond-select.ll | ||
32-bit-subreg-load-store.ll | ||
32-bit-subreg-peephole-phi-1.ll | ||
32-bit-subreg-peephole-phi-2.ll | ||
32-bit-subreg-peephole-phi-3.ll | ||
32-bit-subreg-peephole.ll | ||
32-bit-subreg-zext.ll | ||
adjust-opt-icmp1.ll | ||
adjust-opt-icmp2.ll | ||
adjust-opt-speculative1.ll | ||
adjust-opt-speculative2.ll | ||
alu8.ll | ||
atomics_2.ll | ||
atomics.ll | ||
basictest.ll | ||
byval.ll | ||
callx.ll | ||
cc_args_be.ll | ||
cc_args.ll | ||
cc_ret.ll | ||
cmp.ll | ||
dwarfdump.ll | ||
elf-symbol-information.ll | ||
ex1.ll | ||
fi_ri.ll | ||
i128.ll | ||
inline_asm.ll | ||
inlineasm-output-template.ll | ||
inlineasm-wreg.ll | ||
intrinsics.ll | ||
is_trunc_free.ll | ||
is_zext_free.ll | ||
lit.local.cfg | ||
load.ll | ||
loop-exit-cond.ll | ||
loops.ll | ||
many_args1.ll | ||
many_args2.ll | ||
mem_offset_be.ll | ||
mem_offset.ll | ||
memcpy-expand-in-order.ll | ||
objdump_atomics.ll | ||
objdump_cond_op_2.ll | ||
objdump_cond_op.ll | ||
objdump_dis_all.ll | ||
objdump_imm_hex.ll | ||
objdump_intrinsics.ll | ||
objdump_nop.ll | ||
objdump_static_var.ll | ||
objdump_trivial.ll | ||
objdump_two_funcs.ll | ||
optnone-1.ll | ||
optnone-2.ll | ||
reloc-2.ll | ||
reloc-3.ll | ||
reloc-btf-2.ll | ||
reloc-btf.ll | ||
reloc.ll | ||
remove_truncate_1.ll | ||
remove_truncate_2.ll | ||
remove_truncate_3.ll | ||
remove_truncate_4.ll | ||
remove_truncate_5.ll | ||
remove_truncate_6.ll | ||
remove_truncate_7.ll | ||
remove_truncate_8.ll | ||
rodata_1.ll | ||
rodata_2.ll | ||
rodata_3.ll | ||
rodata_4.ll | ||
rodata_5.ll | ||
rodata_6.ll | ||
rodata_7.ll | ||
sanity.ll | ||
sdiv_error.ll | ||
select_ri.ll | ||
selectiondag-bug.ll | ||
setcc.ll | ||
shifts.ll | ||
simplifycfg.ll | ||
sockex2.ll | ||
struct_ret1.ll | ||
struct_ret2.ll | ||
undef.ll | ||
vararg1.ll | ||
warn-call.ll | ||
warn-stack.ll | ||
xadd_legal.ll | ||
xadd.ll |