Fix "Not having LAHF/SAHF" assert.
authorHans Wennborg <hans@hanshq.net>
Tue, 15 Dec 2015 23:21:46 +0000 (23:21 +0000)
committerHans Wennborg <hans@hanshq.net>
Tue, 15 Dec 2015 23:21:46 +0000 (23:21 +0000)
It wants to assert that the subtarget is 64-bit, not the register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255703 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86InstrInfo.cpp

index 7f0766df26f79c22c28d4b5d10178c950ecbcecd..e028683c63b6ddce66cd47cd876b8124ccddeaf7 100644 (file)
@@ -4417,7 +4417,8 @@ void X86InstrInfo::copyPhysReg(MachineBasicBlock &MBB,
     int AX = is64 ? X86::RAX : X86::EAX;
 
     if (!Subtarget.hasLAHFSAHF()) {
     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.
       // 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.