<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 21, 2016 at 3:26 PM, Eduard Burtescu via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">eddyb added inline comments.<br>
<span class=""><br>
================<br>
Comment at: lib/CodeGen/AtomicExpandPass.cpp:271<br>
@@ -270,4 +270,3 @@<br>
   Value *Addr = LI->getPointerOperand();<br>
-  Type *Ty = cast<PointerType>(Addr->getType())->getElementType();<br>
-  Constant *DummyVal = Constant::getNullValue(Ty);<br>
+  Constant *DummyVal = Constant::getNullValue(LI->getType());<br>
<br>
----------------<br>
</span><span class="">dblaikie wrote:<br>
> I must be missing something as this doesn't look quite right - why was the original code treating the load as though it were a load of a pointer? (load's IR type should be a value type, not a pointer type - unless it is loading a pointer (ie: load could be passed a pointer to a pointer)) & why is the new code doing something different?<br>
</span>`getNullValue`, confusingly enough, isn't about `nullptr` but `zeroinitializer`.<br>
And I didn't change the semantics, I just replaced `LI->getPointerOperand()->getPointerElementType()` with `LI->getType()`.<br></blockquote><div><br></div><div>Right - I see I think I misread it, not seeing the difference between "Addr" in the original formulation, and "LI" in the new formulation - I thought those were the same "getType" calls, and they aren't. Thanks for explaining.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class=""><br>
================<br>
Comment at: lib/Transforms/Vectorize/BBVectorize.cpp:2317<br>
@@ -2316,3 @@<br>
-<br>
-    Type *ArgTypeI = IPtr->getType()->getPointerElementType();<br>
-    Type *ArgTypeJ = JPtr->getType()->getPointerElementType();<br>
----------------<br>
</span><span class="">dblaikie wrote:<br>
> Same here, I take it? Or was this the part where it was necessary for getPairPtrInfo to produce these two values - and since you were producing them here you might as well use them in the other call site?<br>
</span>Correct - otherwise I would've ended up with unused variables and duplicated work.<br>
<span class=""><br>
================<br>
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:1991<br>
@@ -1990,3 +1990,3 @@<br>
   // Make sure that the pointer does not point to structs.<br>
-  if (Ptr->getType()->getPointerElementType()->isAggregateType())<br>
+  if (DataType && DataType->isAggregateType())<br>
     return 0;<br>
----------------<br>
</span><span class="">dblaikie wrote:<br>
> Do we need to support a null type parameter here?<br>
</span>This might be an artifact of rebasing, i.e. it was needed but now it's not.<br>
I'll try testing without the `nullptr` default and this check.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<a href="http://reviews.llvm.org/D16417" rel="noreferrer" target="_blank">http://reviews.llvm.org/D16417</a><br>
<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br></div></div>