[PATCH] D46799: [x86][eflags] Fix PR37431 by teaching the EFLAGS copy lowering to specifically handle SETB_C* pseudo instructions.

Chandler Carruth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 15 02:12:14 PDT 2018


chandlerc added inline comments.


================
Comment at: llvm/lib/Target/X86/X86FlagsCopyLowering.cpp:854
+  // Adjust the condition to have the desired register width.
+  CondReg = AdjustReg(CondReg);
+
----------------
craig.topper wrote:
> Are you intending to change the map entry in CondRegs here?
Yikes. Good catch, fixed.

Amazingly, I don't think this could have broken anything, but just by chance. It happens that because this instruction is a def of EFLAGS as well, we never keep scanning past it, and so we never re-use the now busted cache entry.

Still, better to not modify the entry in CondRegs. I've also left a FIXME that I'll address in a follow-up to just use an API that doesn't require a local reference so that this bug can't be easily written.


Repository:
  rL LLVM

https://reviews.llvm.org/D46799





More information about the llvm-commits mailing list