[llvm] r223383 - [x86] Fix isOffsetSuitableForCodeModel kernel code model offset

Bruno Cardoso Lopes bruno.cardoso at gmail.com
Thu Dec 4 12:36:06 PST 2014


Author: bruno
Date: Thu Dec  4 14:36:06 2014
New Revision: 223383

URL: http://llvm.org/viewvc/llvm-project?rev=223383&view=rev
Log:
[x86] Fix isOffsetSuitableForCodeModel kernel code model offset

Offset == 0 is a valid offset for kernel code model according to the
x86_64 System V ABI. Found by inspection, no testcase.

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

Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=223383&r1=223382&r2=223383&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Thu Dec  4 14:36:06 2014
@@ -3673,7 +3673,7 @@ bool X86::isOffsetSuitableForCodeModel(i
   // For kernel code model we know that all object resist in the negative half
   // of 32bits address space. We may not accept negative offsets, since they may
   // be just off and we may accept pretty large positive ones.
-  if (M == CodeModel::Kernel && Offset > 0)
+  if (M == CodeModel::Kernel && Offset >= 0)
     return true;
 
   return false;





More information about the llvm-commits mailing list