[IR] andIRFlags and copyIRFlags needs to handle GEP
authorDavid Majnemer <david.majnemer@gmail.com>
Fri, 15 Jul 2016 05:02:31 +0000 (05:02 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Fri, 15 Jul 2016 05:02:31 +0000 (05:02 +0000)
commit92f84ccf0f43ca52f924f933410b6f984d913fc4
tree2ad7df7a8e6f733ac998ff00601ea787d2efafad
parent3d9b26b4ada8b87bfc7b4adcebd01a515f85d123
[IR] andIRFlags and copyIRFlags needs to handle GEP

We didn't consider the inbounds flag on GEPs leading to downstream users
introducing UB.

This fixes PR28562.

llvm-svn: 275532
llvm/lib/IR/Instruction.cpp
llvm/test/Transforms/GVN/pr28562.ll [new file with mode: 0644]