X86: Do not optimize branches with undef eflags inputs
authorMatthias Braun <matze@braunis.de>
Mon, 22 Oct 2018 22:52:23 +0000 (22:52 +0000)
committerMatthias Braun <matze@braunis.de>
Mon, 22 Oct 2018 22:52:23 +0000 (22:52 +0000)
commita0beeffeed3d24cf65ec165141926f7715380eb2
tree1e3ed39a0ac18d14c15cbef9e3a18b877f03a57d
parent767625400d2dafce663dfad420d4ad8d03426584
X86: Do not optimize branches with undef eflags inputs

analyzeBranch()/insertBranch() etc. do not properly deal with an undef
flag on the eflags input and used to produce invalid MIR.  I don't see
this ever affecting real world inputs (I don't think it is possible to
produce undef flags with llvm IR), so I simply changed the code to bail
out in this case.

rdar://42122367

llvm-svn: 344970
llvm/lib/Target/X86/X86InstrInfo.cpp
llvm/test/CodeGen/X86/undef-eflags.mir [new file with mode: 0644]