[MergeICmps] Don't merge icmps derived from pointers with addressspaces
authorValentin Churavy <v.churavy@gmail.com>
Fri, 27 Aug 2021 15:20:14 +0000 (17:20 +0200)
committerValentin Churavy <v.churavy@gmail.com>
Fri, 27 Aug 2021 20:15:02 +0000 (22:15 +0200)
commit4cacb5cad052b14d37703157f3b7ffc6a6610acc
tree939212e60544d0904a9cc1568864a3d06ee50d8c
parent1b05245119ddb7279a2ae55319b2ae82aac306db
[MergeICmps] Don't merge icmps derived from pointers with addressspaces

IIUC we can't emit `memcmp` between pointers in addressspaces,
doing so will trigger an assertion since the signature of the memcmp
will not match it's arguments (https://bugs.llvm.org/show_bug.cgi?id=48661).

This PR disables the attempt to merge icmps,
when the pointer is in an addressspace.

Reviewed By: #julialang, vtjnash

Differential Revision: https://reviews.llvm.org/D94813
llvm/lib/Transforms/Scalar/MergeICmps.cpp
llvm/test/Transforms/MergeICmps/X86/addressspaces.ll [new file with mode: 0644]