From 822602a75e29dc945f098f27128171ed13df9d62 Mon Sep 17 00:00:00 2001 From: Andrei Elovikov Date: Tue, 24 Apr 2018 09:24:29 +0000 Subject: [PATCH] [CodeGen] Do not allow opt-bisect-limit to skip ScalarizeMaskedMemIntrin. Summary: 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. Reviewers: andrew.w.kaylor, craig.topper Reviewed By: andrew.w.kaylor Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D45947 llvm-svn: 330700 --- llvm/lib/CodeGen/ScalarizeMaskedMemIntrin.cpp | 3 --- llvm/test/CodeGen/X86/replace_unsupported_masked_mem_intrin.ll | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/llvm/lib/CodeGen/ScalarizeMaskedMemIntrin.cpp b/llvm/lib/CodeGen/ScalarizeMaskedMemIntrin.cpp index cef413f..9387722 100644 --- a/llvm/lib/CodeGen/ScalarizeMaskedMemIntrin.cpp +++ b/llvm/lib/CodeGen/ScalarizeMaskedMemIntrin.cpp @@ -586,9 +586,6 @@ static void scalarizeMaskedScatter(CallInst *CI) { } bool ScalarizeMaskedMemIntrin::runOnFunction(Function &F) { - if (skipFunction(F)) - return false; - bool EverMadeChange = false; TTI = &getAnalysis().getTTI(F); diff --git a/llvm/test/CodeGen/X86/replace_unsupported_masked_mem_intrin.ll b/llvm/test/CodeGen/X86/replace_unsupported_masked_mem_intrin.ll index 9a5da332..dc7a7c7 100644 --- a/llvm/test/CodeGen/X86/replace_unsupported_masked_mem_intrin.ll +++ b/llvm/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" -- 2.7.4