[all-commits] [llvm/llvm-project] 4532a5: Infer alignment of unmarked loads in IR/bitcode pa...

Eli Friedman via All-commits all-commits at lists.llvm.org
Thu May 14 13:04:22 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 4532a50899b1748a64320abce7a69ac10b801a34
      https://github.com/llvm/llvm-project/commit/4532a50899b1748a64320abce7a69ac10b801a34
  Author: Eli Friedman <efriedma at quicinc.com>
  Date:   2020-05-14 (Thu, 14 May 2020)

  Changed paths:
    M llvm/include/llvm/AsmParser/Parser.h
    M llvm/include/llvm/Bitcode/BitcodeReader.h
    M llvm/include/llvm/CodeGen/MIRParser/MIRParser.h
    M llvm/include/llvm/IRReader/IRReader.h
    M llvm/lib/AsmParser/LLParser.cpp
    M llvm/lib/AsmParser/LLParser.h
    M llvm/lib/AsmParser/Parser.cpp
    M llvm/lib/Bitcode/Reader/BitcodeReader.cpp
    M llvm/lib/CodeGen/MIRParser/MIRParser.cpp
    M llvm/lib/IRReader/IRReader.cpp
    M llvm/test/Analysis/BasicAA/featuretest.ll
    M llvm/test/Analysis/MemoryDependenceAnalysis/InvariantLoad.ll
    M llvm/test/Analysis/MemorySSA/invariant-groups.ll
    M llvm/test/Analysis/MustExecute/loop-header.ll
    M llvm/test/Analysis/ScalarEvolution/no-wrap-add-exprs.ll
    M llvm/test/Analysis/TypeBasedAliasAnalysis/sink.ll
    M llvm/test/Analysis/ValueTracking/deref-bitcast-of-gep.ll
    M llvm/test/Bitcode/memInstructions.3.2.ll
    M llvm/test/CodeGen/AArch64/falkor-hwpf.ll
    M llvm/test/CodeGen/AMDGPU/invalid-alloca.ll
    M llvm/test/CodeGen/ARM/ParallelDSP/squaring.ll
    M llvm/test/CodeGen/AVR/call.ll
    M llvm/test/CodeGen/AVR/icall-func-pointer-correct-addr-space.ll
    M llvm/test/CodeGen/AVR/rust-avr-bug-37.ll
    M llvm/test/CodeGen/AVR/rust-avr-bug-95.ll
    M llvm/test/Feature/md_on_instruction.ll
    M llvm/test/LTO/X86/strip-debug-info.ll
    M llvm/test/Transforms/Attributor/ArgumentPromotion/control-flow.ll
    M llvm/test/Transforms/CodeGenPrepare/X86/invariant.group.ll
    M llvm/test/Transforms/CorrelatedValuePropagation/non-null.ll
    M llvm/test/Transforms/CorrelatedValuePropagation/phi-common-val.ll
    M llvm/test/Transforms/CorrelatedValuePropagation/range.ll
    M llvm/test/Transforms/DCE/basic-preservation.ll
    M llvm/test/Transforms/DeadStoreElimination/MSSA/multiblock-simple.ll
    M llvm/test/Transforms/DeadStoreElimination/MSSA/simple-preservation.ll
    M llvm/test/Transforms/DeadStoreElimination/MSSA/simple.ll
    M llvm/test/Transforms/DeadStoreElimination/simple.ll
    M llvm/test/Transforms/EarlyCSE/guards.ll
    M llvm/test/Transforms/EarlyCSE/invariant-loads.ll
    M llvm/test/Transforms/EarlyCSE/invariant.start.ll
    M llvm/test/Transforms/GVN/PRE/invariant-load.ll
    M llvm/test/Transforms/GVN/PRE/load-metadata.ll
    M llvm/test/Transforms/GVN/PRE/phi-translate.ll
    M llvm/test/Transforms/GVN/PRE/volatile.ll
    M llvm/test/Transforms/GVN/invariant.group.ll
    M llvm/test/Transforms/GVN/noalias.ll
    M llvm/test/Transforms/GVN/range.ll
    M llvm/test/Transforms/IRCE/pre_post_loops.ll
    M llvm/test/Transforms/IRCE/range_intersect_miscompile.ll
    M llvm/test/Transforms/IRCE/ranges_of_different_types.ll
    M llvm/test/Transforms/IRCE/unsigned_comparisons_ugt.ll
    M llvm/test/Transforms/IRCE/unsigned_comparisons_ult.ll
    M llvm/test/Transforms/InterleavedAccess/ARM/interleaved-accesses.ll
    M llvm/test/Transforms/JumpThreading/combine-metadata.ll
    M llvm/test/Transforms/JumpThreading/thread-loads.ll
    M llvm/test/Transforms/LICM/guards.ll
    M llvm/test/Transforms/LICM/hoist-deref-load.ll
    M llvm/test/Transforms/LoopIdiom/X86/unordered-atomic-memcpy.ll
    M llvm/test/Transforms/LoopUnroll/unroll-header-exiting-with-phis.ll
    M llvm/test/Transforms/LoopVectorize/float-minmax-instruction-flag.ll
    M llvm/test/Transforms/LoopVectorize/multiple-strides-vectorization.ll
    M llvm/test/Transforms/MemCpyOpt/load-store-to-memcpy.ll
    M llvm/test/Transforms/MergeFunc/ranges-multiple.ll
    M llvm/test/Transforms/MergeFunc/ranges.ll
    M llvm/test/Transforms/NewGVN/metadata-nonnull.ll
    M llvm/test/Transforms/NewGVN/noalias.ll
    M llvm/test/Transforms/NewGVN/pr33204.ll
    M llvm/test/Transforms/NewGVN/pr33367.ll
    M llvm/test/Transforms/NewGVN/range.ll
    M llvm/test/Transforms/Reassociate/keep-debug-loc.ll
    M llvm/test/Transforms/RewriteStatepointsForGC/deref-pointers.ll
    M llvm/test/Transforms/SCCP/conditions-ranges.ll
    M llvm/test/Transforms/SLPVectorizer/X86/schedule_budget.ll
    M llvm/test/Transforms/SROA/basictest.ll
    M llvm/test/Transforms/SeparateConstOffsetFromGEP/test-add-sub-separation.ll
    M llvm/test/Transforms/SimplifyCFG/hoist-with-range.ll
    M llvm/test/Transforms/Util/assume-builder.ll
    A llvm/test/Verifier/unsized-types-alloca.ll
    A llvm/test/Verifier/unsized-types-load.ll
    A llvm/test/Verifier/unsized-types-store.ll
    R llvm/test/Verifier/unsized-types.ll
    M llvm/tools/llc/llc.cpp
    M llvm/tools/llvm-as/llvm-as.cpp
    M llvm/tools/opt/opt.cpp
    M mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp
    M polly/test/ForwardOpTree/forward_hoisted.ll
    M polly/test/ForwardOpTree/forward_into_region_redundant_use.ll
    M polly/test/ForwardOpTree/forward_load.ll
    M polly/test/ForwardOpTree/forward_load_differentarray.ll
    M polly/test/ForwardOpTree/forward_load_double_write.ll
    M polly/test/ForwardOpTree/forward_load_fromloop.ll
    M polly/test/ForwardOpTree/forward_load_indirect.ll
    M polly/test/ForwardOpTree/forward_load_memset_before.ll
    M polly/test/ForwardOpTree/forward_load_tripleuse.ll
    M polly/test/ForwardOpTree/forward_load_unrelatedunusual.ll
    M polly/test/ForwardOpTree/forward_phi_load.ll
    M polly/test/ScopInfo/granularity_scalar-indep.ll
    M polly/test/ScopInfo/granularity_scalar-indep_epilogue.ll
    M polly/test/ScopInfo/granularity_scalar-indep_epilogue_last.ll
    M polly/test/ScopInfo/granularity_scalar-indep_noepilogue.ll
    M polly/test/ScopInfo/granularity_scalar-indep_ordered-2.ll
    M polly/test/ScopInfo/granularity_scalar-indep_ordered.ll

  Log Message:
  -----------
  Infer alignment of unmarked loads in IR/bitcode parsing.

For IR generated by a compiler, this is really simple: you just take the
datalayout from the beginning of the file, and apply it to all the IR
later in the file. For optimization testcases that don't care about the
datalayout, this is also really simple: we just use the default
datalayout.

The complexity here comes from the fact that some LLVM tools allow
overriding the datalayout: some tools have an explicit flag for this,
some tools will infer a datalayout based on the code generation target.
Supporting this properly required plumbing through a bunch of new
machinery: we want to allow overriding the datalayout after the
datalayout is parsed from the file, but before we use any information
from it. Therefore, IR/bitcode parsing now has a callback to allow tools
to compute the datalayout at the appropriate time.

Not sure if I covered all the LLVM tools that want to use the callback.
(clang? lli? Misc IR manipulation tools like llvm-link?). But this is at
least enough for all the LLVM regression tests, and IR without a
datalayout is not something frontends should generate.

This change had some sort of weird effects for certain CodeGen
regression tests: if the datalayout is overridden with a datalayout with
a different program or stack address space, we now parse IR based on the
overridden datalayout, instead of the one written in the file (or the
default one, if none is specified). This broke a few AVR tests, and one
AMDGPU test.

Outside the CodeGen tests I mentioned, the test changes are all just
fixing CHECK lines and moving around datalayout lines in weird places.

Differential Revision: https://reviews.llvm.org/D78403




More information about the All-commits mailing list