[PATCH] D45947: [CodeGen] Do not allow opt-bisect-limit to skip ScalarizeMaskedMemIntrin.

Andrei Elovikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 23 06:13:04 PDT 2018


a.elovikov created this revision.
a.elovikov added reviewers: andrew.w.kaylor, craig.topper.

The pass is supposed to scalarize such intrinsics if the target does not support
them natively, so if the scalarization does not happen instruction selection
crashes due to inability to lower these intrinsics.


Repository:
  rL LLVM

https://reviews.llvm.org/D45947

Files:
  lib/CodeGen/ScalarizeMaskedMemIntrin.cpp
  test/CodeGen/X86/replace_unsupported_masked_mem_intrin.ll


Index: test/CodeGen/X86/replace_unsupported_masked_mem_intrin.ll
===================================================================
--- test/CodeGen/X86/replace_unsupported_masked_mem_intrin.ll
+++ test/CodeGen/X86/replace_unsupported_masked_mem_intrin.ll
@@ -1,6 +1,11 @@
 ; RUN: llc -O0 -mtriple=x86_64-unknown-linux-gnu -mattr=+sse,+sse2 < %s -o /dev/null
 ; pr33001 - Check that llc doesn't crash when running with O0 option.
 
+; RUN: llc -O2 -opt-bisect-limit=0 -mtriple=x86_64-unknown-linux-gnu -mattr=+sse,+sse2 < %s -o /dev/null
+; Check that llc doesn't crash due to ScalarizeMaskedMemIntring not being run
+; because of opt-bisect-limit that in turn causes crash in instruction selection
+; for unsupported gather/scatter.
+
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
Index: lib/CodeGen/ScalarizeMaskedMemIntrin.cpp
===================================================================
--- lib/CodeGen/ScalarizeMaskedMemIntrin.cpp
+++ lib/CodeGen/ScalarizeMaskedMemIntrin.cpp
@@ -586,9 +586,6 @@
 }
 
 bool ScalarizeMaskedMemIntrin::runOnFunction(Function &F) {
-  if (skipFunction(F))
-    return false;
-
   bool EverMadeChange = false;
 
   TTI = &getAnalysis<TargetTransformInfoWrapperPass>().getTTI(F);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45947.143534.patch
Type: text/x-patch
Size: 1282 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180423/ac82ea02/attachment.bin>


More information about the llvm-commits mailing list