OSDN Git Service

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)
commitd8c89437902108b83006d92d5985fcfd2eb0deae
tree7271658783733631f683af6feda9ab8d651ebcc5
parent8f75264f16f6e02aa2d3462744d96199a8c581de
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344970 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86InstrInfo.cpp
test/CodeGen/X86/undef-eflags.mir [new file with mode: 0644]