[PATCH] D23984: [X86] Fix bug in masked compress

Michael Kuperstein via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 30 14:03:50 PDT 2016

mkuper added a comment.

I'll let Igor/Elena review the logic, just a couple of comments on style.

Comment at: lib/Target/X86/X86ISelLowering.cpp:18875
@@ -18874,1 +18874,3 @@
+    SDValue LoadAddress = DAG.getLoad(VT, SDLoc(Op), Chain, Addr,
+                         MemIntr->getPointerInfo(), MemIntr->getAlignment());
     SDValue Compressed =
The formatting here looks wrong.

Comment at: lib/Target/X86/X86ISelLowering.cpp:18879
@@ +18878,3 @@
+                           Mask, LoadAddress, Subtarget, DAG);
+    LoadSDNode* LoadInst = dyn_cast<LoadSDNode>(LoadAddress);
+    return DAG.getStore(LoadInst->getChain(), dl, Compressed, Addr,
Why is this a dyn_cast? if DAG.getLoad() is guaranteed to return a LoadSDNode (and I'd assume it is), you want a cast<>. If it's not, then you need to check the result of the dyn_cast.


More information about the llvm-commits mailing list