[llvm] r343270 - [ScalarizeMaskedMemIntrin] Handle the case where the mask is an all zero vector.

Friedman, Eli via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 27 15:15:18 PDT 2018


Yes, that sounds like the right fix. No, I don't think there's any 
existing helper for that.

-Eli

On 9/27/2018 2:45 PM, Topper, Craig wrote:
> I'm not sure we can guarantee it won't be ConstantExpr. I'm also not sure an individual element can't be a ConstantExpr, but that issue existed in the original code. Should I just pre-check that it’s a vector ConstantInts before doing any IR emission. Is there any helper in Constant that already does that?
>
> -----Original Message-----
> From: Friedman, Eli [mailto:efriedma at codeaurora.org]
> Sent: Thursday, September 27, 2018 2:37 PM
> To: Topper, Craig <craig.topper at intel.com>; llvm-commits at lists.llvm.org
> Subject: Re: [llvm] r343270 - [ScalarizeMaskedMemIntrin] Handle the case where the mask is an all zero vector.
>
> On 9/27/2018 2:28 PM, Craig Topper via llvm-commits wrote:
>> Author: ctopper
>> Date: Thu Sep 27 14:28:46 2018
>> New Revision: 343270
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=343270&view=rev
>> Log:
>> [ScalarizeMaskedMemIntrin] Handle the case where the mask is an all zero vector.
>>
>> This shouldn't really happen in practice I hope, but we tried to handle other constant cases. We missed this one because we checked for ConstantVector without realizing that zero becomes ConstantAggregateZero instead.
>>
>> So instead just check for Constant and use getAggregateElement which will do the dirty work for us.
> getAggregateElement will fail (return null) on a ConstantExpr; is it
> possible to end up with one here?
>
> -Eli
>

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project



More information about the llvm-commits mailing list