[SimpleLoopUnswitch] Perform poison query before transform
authorNikita Popov <npopov@redhat.com>
Mon, 2 Jan 2023 11:19:39 +0000 (12:19 +0100)
committerNikita Popov <npopov@redhat.com>
Mon, 2 Jan 2023 11:25:55 +0000 (12:25 +0100)
commit09778940d1aea0cd3ff99df47cd2dc2fe5b09bb9
tree2721696f8d47c24ef3b270fa3501978c72868633
parentf325b5b8cb1d6c16dd04c88380caea7b0a7750eb
[SimpleLoopUnswitch] Perform poison query before transform

I think this doesn't make any difference right now, but once
we take into account that branch on undef is UB in
programUndefinedIfUndefOrPoison() the new position of the branch
would imply that the condition can't be poison, which would
defeat the purpose of the freeze insertion here. We need to
perform the check before the branch is moved.
llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp