[llvm-branch-commits] [llvm] ded5928 - [BasicAA] Remove unnecessary sextOrSelf (NFC)

Nikita Popov via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sat Nov 21 12:37:32 PST 2020


Author: Nikita Popov
Date: 2020-11-21T21:32:56+01:00
New Revision: ded5928866254ea08569aed946dd2a879464da48

URL: https://github.com/llvm/llvm-project/commit/ded5928866254ea08569aed946dd2a879464da48
DIFF: https://github.com/llvm/llvm-project/commit/ded5928866254ea08569aed946dd2a879464da48.diff

LOG: [BasicAA] Remove unnecessary sextOrSelf (NFC)

We are doing a sextOrTrunc directly afterwards, so this seems
useless. There is a multiplication in between, but truncating
before or after the multiplication should not make a difference.

Added: 
    

Modified: 
    llvm/lib/Analysis/BasicAliasAnalysis.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp
index 89e1ad25ecbd..cfc1c59c15d9 100644
--- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp
+++ b/llvm/lib/Analysis/BasicAliasAnalysis.cpp
@@ -515,9 +515,8 @@ BasicAAResult::DecomposeGEPExpression(const Value *V, const DataLayout &DL,
         if (CIdx->isZero())
           continue;
         Decomposed.Offset +=
-            (DL.getTypeAllocSize(GTI.getIndexedType()).getFixedSize() *
-             CIdx->getValue().sextOrSelf(MaxPointerSize))
-                .sextOrTrunc(MaxPointerSize);
+            DL.getTypeAllocSize(GTI.getIndexedType()).getFixedSize() *
+            CIdx->getValue().sextOrTrunc(MaxPointerSize);
         continue;
       }
 


        


More information about the llvm-branch-commits mailing list