[PATCH] D50116: [X86] FastISel fall back on !absolute_symbol GVs

Vlad Tsyrklevich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 1 10:45:09 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL338599: [X86] FastISel fall back on !absolute_symbol GVs (authored by vlad.tsyrklevich, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D50116?vs=158417&id=158573#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D50116

Files:
  llvm/trunk/lib/Target/X86/X86FastISel.cpp
  llvm/trunk/test/CodeGen/X86/absolute-bit-mask-fastisel.ll


Index: llvm/trunk/test/CodeGen/X86/absolute-bit-mask-fastisel.ll
===================================================================
--- llvm/trunk/test/CodeGen/X86/absolute-bit-mask-fastisel.ll
+++ llvm/trunk/test/CodeGen/X86/absolute-bit-mask-fastisel.ll
@@ -0,0 +1,28 @@
+; RUN: llc < %s | FileCheck %s
+; RUN: llc -relocation-model=pic < %s | FileCheck %s
+
+; Regression test for PR38200
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+ at bit_mask8 = external hidden global i8, !absolute_symbol !0
+
+declare void @f()
+
+define void @foo8(i8* %ptr) noinline optnone {
+  %load = load i8, i8* %ptr
+  ; CHECK: movl $bit_mask8, %ecx
+  %and = and i8 %load, ptrtoint (i8* @bit_mask8 to i8)
+  %icmp = icmp eq i8 %and, 0
+  br i1 %icmp, label %t, label %f
+
+t:
+  call void @f()
+  ret void
+
+f:
+  ret void
+}
+
+!0 = !{i64 0, i64 256}
Index: llvm/trunk/lib/Target/X86/X86FastISel.cpp
===================================================================
--- llvm/trunk/lib/Target/X86/X86FastISel.cpp
+++ llvm/trunk/lib/Target/X86/X86FastISel.cpp
@@ -738,6 +738,10 @@
     if (GV->isThreadLocal())
       return false;
 
+    // Can't handle !absolute_symbol references yet.
+    if (GV->isAbsoluteSymbolRef())
+      return false;
+
     // RIP-relative addresses can't have additional register operands, so if
     // we've already folded stuff into the addressing mode, just force the
     // global value into its own register, which we can use as the basereg.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50116.158573.patch
Type: text/x-patch
Size: 1528 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180801/009954e1/attachment.bin>


More information about the llvm-commits mailing list