[llvm] r255703 - Fix "Not having LAHF/SAHF" assert.

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 15 15:21:47 PST 2015


Author: hans
Date: Tue Dec 15 17:21:46 2015
New Revision: 255703

URL: http://llvm.org/viewvc/llvm-project?rev=255703&view=rev
Log:
Fix "Not having LAHF/SAHF" assert.

It wants to assert that the subtarget is 64-bit, not the register.

Modified:
    llvm/trunk/lib/Target/X86/X86InstrInfo.cpp

Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=255703&r1=255702&r2=255703&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Tue Dec 15 17:21:46 2015
@@ -4417,7 +4417,8 @@ void X86InstrInfo::copyPhysReg(MachineBa
     int AX = is64 ? X86::RAX : X86::EAX;
 
     if (!Subtarget.hasLAHFSAHF()) {
-      assert(is64 && "Not having LAHF/SAHF only happens on 64-bit.");
+      assert(Subtarget.is64Bit() &&
+             "Not having LAHF/SAHF only happens on 64-bit.");
       // Moving EFLAGS to / from another register requires a push and a pop.
       // Notice that we have to adjust the stack if we don't want to clobber the
       // first frame index. See X86FrameLowering.cpp - clobbersTheStack.




More information about the llvm-commits mailing list