[PATCH] D40789: [GlobalISel] Disable GISel for big endian

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 4 08:17:20 PST 2017


aemerson created this revision.
Herald added subscribers: kristof.beyls, javed.absar.

This is due to PR26161 needing to be resolved before we can fix big endian bugs like PR35359. The work to split aggregates into smaller LLTs instead of using one large scalar will take some time, so in the mean time we'll fall back to SDAG.

Some ARM BE tests xfailed for now as a result.


Repository:
  rL LLVM

https://reviews.llvm.org/D40789

Files:
  lib/CodeGen/GlobalISel/IRTranslator.cpp
  test/CodeGen/ARM/GlobalISel/arm-irtranslator.ll
  test/CodeGen/ARM/GlobalISel/arm-param-lowering.ll


Index: test/CodeGen/ARM/GlobalISel/arm-param-lowering.ll
===================================================================
--- test/CodeGen/ARM/GlobalISel/arm-param-lowering.ll
+++ test/CodeGen/ARM/GlobalISel/arm-param-lowering.ll
@@ -1,5 +1,6 @@
 ; RUN: llc -mtriple arm-unknown -mattr=+vfp2,+v4t -global-isel -stop-after=irtranslator -verify-machineinstrs %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=LITTLE
-; RUN: llc -mtriple armeb-unknown -mattr=+vfp2,+v4t -global-isel -stop-after=irtranslator -verify-machineinstrs %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=BIG
+; RUN: llc -mtriple armeb-unknown -mattr=+vfp2,+v4t -global-isel -global-isel-abort=0 -stop-after=irtranslator -verify-machineinstrs %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=BIG
+; XFAIL: armeb
 
 declare arm_aapcscc i32* @simple_reg_params_target(i32, i32*)
 
Index: test/CodeGen/ARM/GlobalISel/arm-irtranslator.ll
===================================================================
--- test/CodeGen/ARM/GlobalISel/arm-irtranslator.ll
+++ test/CodeGen/ARM/GlobalISel/arm-irtranslator.ll
@@ -1,5 +1,6 @@
 ; RUN: llc -mtriple arm-unknown -mattr=+vfp2,+v4t -global-isel -stop-after=irtranslator -verify-machineinstrs %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=LITTLE
-; RUN: llc -mtriple armeb-unknown -mattr=+vfp2,+v4t -global-isel -stop-after=irtranslator -verify-machineinstrs %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=BIG
+; RUN: llc -mtriple armeb-unknown -mattr=+vfp2,+v4t -global-isel -global-isel-abort=0 -stop-after=irtranslator -verify-machineinstrs %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=BIG
+; XFAIL: armeb
 
 define void @test_void_return() {
 ; CHECK-LABEL: name: test_void_return
Index: lib/CodeGen/GlobalISel/IRTranslator.cpp
===================================================================
--- lib/CodeGen/GlobalISel/IRTranslator.cpp
+++ lib/CodeGen/GlobalISel/IRTranslator.cpp
@@ -1253,6 +1253,15 @@
 
   assert(PendingPHIs.empty() && "stale PHIs");
 
+  if (!DL->isLittleEndian()) {
+    // Currently we don't properly handle big endian code.
+    OptimizationRemarkMissed R("gisel-irtranslator", "GISelFailure",
+                               MF->getFunction()->getSubprogram(),
+                               &MF->getFunction()->getEntryBlock());
+    R << "unable to translate in big endian mode";
+    reportTranslationError(*MF, *TPC, *ORE, R);
+  }
+
   // Release the per-function state when we return, whether we succeeded or not.
   auto FinalizeOnReturn = make_scope_exit([this]() { finalizeFunction(); });
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40789.125348.patch
Type: text/x-patch
Size: 2603 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171204/fb834606/attachment-0001.bin>


More information about the llvm-commits mailing list