[PATCH] D103347: Mask was modified to work properly even if the pointer size is bigger than 64bits.

Hyeongyu Kim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 28 17:07:13 PDT 2021


hyeongyukim created this revision.
Herald added a subscriber: hiraditya.
hyeongyukim requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D103347

Files:
  llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp


Index: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
===================================================================
--- llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
+++ llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
@@ -279,8 +279,7 @@
       Idx = Builder.CreateTrunc(Idx, IntPtrTy);
 
     unsigned ElementSize =
-    DL.getTypeAllocSize(Init->getType()->getArrayElementType());
-
+        DL.getTypeAllocSize(Init->getType()->getArrayElementType());
 
     // If inbounds keyword is not present, Idx * ElementSize can overflow.
     // Let's assume that ElementSize is 2 and the wanted value is at offset 0.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103347.348600.patch
Type: text/x-patch
Size: 646 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210529/d77e00e7/attachment.bin>


More information about the llvm-commits mailing list