On Jun 29, 2007, at 1:10 AM, Duncan Sands wrote:
> Hi,
>
> It seems like folding undef/X to undef isn't safe either though,
>
> here is my understanding of how to fold undef. I hope it clarifies
> this confusing area. Of course, I could be confused myself but I
> hope not :)
>
> (1) When is
On Jul 3, 2007, at 2:13 PM, Dan Gohman wrote:
>>> We overload ISD::FADD and quite a lot of others. Why not
>>> ISD::ConstantFP too?
>>
>> Fair enough, after pondering on it, I agree with you. The proposed
>> semantics are that a ConstantFP (and also a normal Constant?) produce
>> the splatted im
>> We overload ISD::FADD and quite a lot of others. Why not
>> ISD::ConstantFP too?
>
> Fair enough, after pondering on it, I agree with you. The proposed
> semantics are that a ConstantFP (and also a normal Constant?) produce
> the splatted immediate value?
Constant sounds good too. And U
On Jun 29, 2007, at 12:38 PM, Dan Gohman wrote:
>>> Just as there isn't a special ADD node kind for vectors -- just
>>> an ADD
>>> kind with nodes that can have a vector ValueType, ConstantFP can
>>> also
>>> be "vectorized". A ConstantFP with a vector ValueType is a vector
>>> constant,
>>>
>> Just as there isn't a special ADD node kind for vectors -- just an ADD
>> kind with nodes that can have a vector ValueType, ConstantFP can also
>> be "vectorized". A ConstantFP with a vector ValueType is a vector
>> constant,
>> equivalent to what is currently represented as a splat BUILD_VECT
> Duncan pointed out that I confused myself. If something is undef, we
> can choose to pick any specific value for the undef to pick the
> cancellation.
Thanks Chris and Duncan for explaining this. I'll submit a fix for the
DAGCombiner changes accordingly.
Dan
--
Dan Gohman, Cray Inc.
On Jun 27, 2007, at 1:50 PM, Dan Gohman wrote:
I think that undef udiv intmax -> 0, no? If not, plz update
instcombine as well.
>>>
>>> intmax udiv intmax -> 1.
>>> It seems like folding undef/X to undef isn't safe either though,
>>> with
>>> the way it sounds like undef is intended
On Jun 28, 2007, at 3:09 AM, Duncan Sands wrote:
> Hi,
>
>>> It seems like folding undef/X to undef isn't safe either though,
>>> with
>>> the way it sounds like undef is intended to work. This code:
>>>
>>> %x = udiv i32 undef, %intmax
>>> %y = udiv i32 %x, 2
>>>
>>> will always set %y to
>>> I think that undef udiv intmax -> 0, no? If not, plz update
>>> instcombine as well.
>>
>> intmax udiv intmax -> 1.
>>
>> It seems like folding undef/X to undef isn't safe either though, with
>> the way it sounds like undef is intended to work. This code:
>>
>> %x = udiv i32 undef, %intmax
>
>> I think that undef udiv intmax -> 0, no? If not, plz update
>> instcombine as well.
>
> intmax udiv intmax -> 1.
>
> It seems like folding undef/X to undef isn't safe either though, with
> the way it sounds like undef is intended to work. This code:
>
> %x = udiv i32 undef, %intmax
> %y = u
On Jun 27, 2007, at 7:59 AM, Dan Gohman wrote:
>>> Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
>>> diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.409 llvm/
>>> lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.410
>>> --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.409Fri J
+
+ // If either operand is undef, the result is undef
+ if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF)
+return DAG.getNode(ISD::UNDEF, VT);
+
return SDOperand();
}
>>>
>>> This is not safe for sdiv/udiv. Safe xforms are:
>>>
>>>/
>> Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
>> diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.409 llvm/
>> lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.410
>> --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.409 Fri Jun 22
>> 09:59:07 2007
>> +++ llvm/lib/CodeGen/Se
> --- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.500 Fri Jun 22
> 09:59:07 2007
> +++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Mon Jun 25
> 11:23:39 2007
> @@ -173,15 +173,13 @@
> + /// ScalarizeVectorOp - Given an operand of vector type, convert
> it into the
> + /// eq
> Thanks for all the review comments! I've addressed a few comments
> below; I'll get to the others soon.
Thanks! I also filed pr1529, which is the only failure that showed
on the ppc nightly tester.
>>> @@ -1162,6 +1179,11 @@
>>> SDOperand Op = BuildSDIV(N);
>>> if (Op.Val) return O
Hi Chris,
Thanks for all the review comments! I've addressed a few comments
below; I'll get to the others soon.
>> @@ -1162,6 +1179,11 @@
>> SDOperand Op = BuildSDIV(N);
>> if (Op.Val) return Op;
>>}
>> +
>> + // If either operand is undef, the result is undef
>> + if (N0.getOpcod
Another great change.
> @@ -856,6 +844,10 @@
>ConstantSDNode *N0C = dyn_cast(N0);
>ConstantSDNode *N1C = dyn_cast(N1);
>MVT::ValueType VT = N0.getValueType();
> +
> + // fold vector ops
> + SDOperand FoldedVOp = SimplifyVBinOp(N);
> + if (FoldedVOp.Val) return FoldedVOp;
I'm co
On Jun 22, 2007, at 7:59 AM, Dan Gohman wrote:
> Move ComputeMaskedBits, MaskedValueIsZero, and ComputeNumSignBits from
> TargetLowering to SelectionDAG so that they have more convenient
> access to the current DAG, in preparation for the ValueType routines
> being changed from standalone functio
> Fix an infinite recursion in GetNegatedExpression.
Doh, thanks a lot Lauro!
-Chris
>
>
> ---
> Diffs of the changes: (+1 -1)
>
> DAGCombiner.cpp |2 +-
> 1 files changed, 1 insertion(+), 1 deletion(-)
>
>
> Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
> diff -u llvm/lib/CodeGen/S
> Forgot about chain result; also UNDEF cannot have multiple values.
Nice! Thanks Evan,
-Chris
> ---
> Diffs of the changes: (+12 -12)
>
> DAGCombiner.cpp | 24
> 1 files changed, 12 insertions(+), 12 deletions(-)
>
>
> Index: llvm/lib/CodeGen/SelectionDAG/DAGCombine
Doh. Brain cramp.
Evan
On Apr 30, 2007, at 9:39 PM, Chris Lattner wrote:
>> +bool HasUses = false;
>> +SmallVector VTs;
>> +for (unsigned i = 0, e = N->getNumValues(); i != e; ++i) {
>> + if (!N->hasNUsesOfValue(0, i)) {
>> +HasUses = true;
>> +break;
>> + }
> +bool HasUses = false;
> +SmallVector VTs;
> +for (unsigned i = 0, e = N->getNumValues(); i != e; ++i) {
> + if (!N->hasNUsesOfValue(0, i)) {
> +HasUses = true;
> +break;
> + }
> + VTs.push_back(N->getValueType(i));
> +}
> +if (!HasUses) {
> +
22 matches
Mail list logo