[InstCombine] Do not introduce bitcasts for swifterror arguments.
authorFlorian Hahn <flo@fhahn.com>
Wed, 28 Oct 2020 21:49:33 +0000 (21:49 +0000)
committerFlorian Hahn <flo@fhahn.com>
Wed, 28 Oct 2020 21:52:12 +0000 (21:52 +0000)
commit53f4c4b2cc51f4848dfc610a3a858ef821e39ae5
tree66c60aa24238cdc5482b1bc54759e54fb963735b
parent50ee22d791864fb3243e4a022fd6e78d38102a64
[InstCombine] Do not introduce bitcasts for swifterror arguments.

The following constraints hold for swifterror values:

    A swifterror value (either the parameter or the alloca) can only
    be loaded and stored from, or used as a swifterror argument.

This patch updates instcombine to not try to convert a bitcast of a
function into a bitcast of a swifterror argument.

Reviewed By: rjmccall

Differential Revision: https://reviews.llvm.org/D90258
llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
llvm/test/Transforms/InstCombine/swifterror-argument-bitcast-fold.ll [new file with mode: 0644]