[InstCombine] Fix or of commuted foldable predicates
authorNikita Popov <npopov@redhat.com>
Fri, 22 Apr 2022 10:31:26 +0000 (12:31 +0200)
committerNikita Popov <npopov@redhat.com>
Fri, 22 Apr 2022 10:31:26 +0000 (12:31 +0200)
commit3e1d2c352c1fb9fb7022344fb4e5639b4f5b1c45
tree9ea75900fe70196f8cf1d06e04d0a424edf94f93
parent2b252c159f535f6b91f4e3cf092919b206e4a526
[InstCombine] Fix or of commuted foldable predicates

1d90e530442477de247dcb613f5176fe7e9beded switch this code to store
the predicates and operands in variables, but retained a
swapOperands() call here. Thus the commuted cases were no longer
folded. Additionally, as the change was not reported, the next
InstCombine iteration would not pick it up either.
llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
llvm/test/Transforms/InstCombine/or.ll