>>> +  // fold (or x, undef) -> -1
>>> +  if (N1.getOpcode() == ISD::UNDEF)
>>> +    return DAG.getConstant(-1, VT);
>>
>> Is this the right way to get an all-bits-one value?
>
> I guess DAG.getConstant(~0ULL, VT) is the way its written  
> elsewhere. And I
> have to fix it for vectors. I'll work on it.

Either way works.  "-1" is a signed integer that sign extends to  
uint64_t.  ~0ULL is more explicit though.

> Looking at it a little more, I think the instcombine folds are  
> actually
> wrong here. For example, it does X + undef -> undef, but that's  
> wrong if
> X is a NaN.

Ah, good point.

-Chris
_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to