Reapply [IRBuilder] Always respect inserter/folder
authorNikita Popov <nikita.ppv@gmail.com>
Tue, 18 Feb 2020 19:35:16 +0000 (20:35 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Wed, 19 Feb 2020 19:51:38 +0000 (20:51 +0100)
commitf6875c434ec20eb4f24495317592f64334347784
tree7657bdc5f6ae69b36c9d704400f642728906c1ca
parent0ba9ee9f0e55b1f9155a5bb5739550860fa5fec2
Reapply [IRBuilder] Always respect inserter/folder

Some IRBuilder methods that were originally defined on
IRBuilderBase do not respect custom IRBuilder inserters/folders,
because those were not accessible prior to D73835. Fix this by
making use of existing (and now accessible) IRBuilder methods,
which will handle inserters/folders correctly.

There are some changes in OpenMP and Instrumentation tests, where
bitcasts now get constant folded. I've also highlighted one
InstCombine test which now finishes in two rather than three
iterations, thanks to new instructions being inserted into the
worklist.

Differential Revision: https://reviews.llvm.org/D74787
clang/test/OpenMP/parallel_codegen.cpp
clang/test/OpenMP/target_firstprivate_codegen.cpp
llvm/lib/IR/IRBuilder.cpp
llvm/test/Instrumentation/MemorySanitizer/Mips/vararg-mips64.ll
llvm/test/Instrumentation/MemorySanitizer/Mips/vararg-mips64el.ll
llvm/test/Instrumentation/MemorySanitizer/PowerPC/vararg-ppc64.ll
llvm/test/Instrumentation/MemorySanitizer/PowerPC/vararg-ppc64le.ll
llvm/test/Instrumentation/MemorySanitizer/X86/vararg_call.ll
llvm/test/Instrumentation/MemorySanitizer/byval-alignment.ll
llvm/test/Instrumentation/MemorySanitizer/msan_basic.ll
llvm/test/Transforms/InstCombine/saturating-add-sub.ll