[IR] Change the default value of InstertElement to poison (1/4)
authorhyeongyu kim <gusrb406@snu.ac.kr>
Sun, 26 Sep 2021 16:07:49 +0000 (01:07 +0900)
committerhyeongyu kim <gusrb406@snu.ac.kr>
Tue, 28 Sep 2021 13:29:16 +0000 (22:29 +0900)
commit86bf234d0b7038479292a0d771dc05966140b908
tree34009a3b2d509f8a495ba12585bdeab9319604d3
parent8bacfb9bedf10a2e446db072be2c1cd2cd1d7aab
[IR] Change the default value of InstertElement to poison (1/4)

This patch is for fixing potential insertElement-related bugs like D93818.
```
V = UndefValue::get(VecTy);
for(...)
  V = Builder.CreateInsertElementy(V, Elt, Idx);
=>
V = PoisonValue::get(VecTy);
for(...)
  V = Builder.CreateInsertElementy(V, Elt, Idx);
```
Like above, this patch changes the placeholder V to poison.
The patch will be separated into several commits.

Reviewed By: aqjune

Differential Revision: https://reviews.llvm.org/D110311
llvm/include/llvm/IR/IRBuilder.h
llvm/lib/IR/AutoUpgrade.cpp
llvm/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp
llvm/unittests/IR/IRBuilderTest.cpp
llvm/unittests/IR/PatternMatch.cpp