StructurizeCFG: fix inverting conditions
authorMarek Olsak <marek.olsak@amd.com>
Tue, 15 May 2018 21:41:55 +0000 (21:41 +0000)
committerMarek Olsak <marek.olsak@amd.com>
Tue, 15 May 2018 21:41:55 +0000 (21:41 +0000)
commit3c5fd145c5f6fc2ee570e9c329700f8a9960eae0
tree3e561416617f0dcf327280d0436c6d55ee2f3600
parent091fed94ae701005ccfde290713c4908e25008d4
StructurizeCFG: fix inverting conditions

Author: Samuel Pitoiset

Without this patch, it appears to me that we are selecting
the wrong operand when inverting conditions. In the attached
test, it will select %tmp3 instead of %tmp4. To fix it, just
use 'A' as everywhere.

This fixes a regression introduced by
"[PatternMatch] define m_Not using m_Xor and cst_pred_ty"

https://reviews.llvm.org/D46351

llvm-svn: 332403
llvm/lib/Transforms/Scalar/StructurizeCFG.cpp
llvm/test/Transforms/StructurizeCFG/invert-condition.ll [new file with mode: 0644]