[llvm] e2fe26e - [NFC][InstSimplify] Use more intuitive variable names.

Jun Ma via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 28 22:56:02 PDT 2021


Author: Jun Ma
Date: 2021-07-29T13:55:47+08:00
New Revision: e2fe26e77b02633207bdd36a14e2dcf210cc2fe7

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

LOG: [NFC][InstSimplify] Use more intuitive variable names.

Added: 
    

Modified: 
    llvm/lib/Analysis/InstructionSimplify.cpp
    llvm/test/Transforms/InstSimplify/fold-vscale.ll

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp
index 44237178dc709..dc2f1c29b9a43 100644
--- a/llvm/lib/Analysis/InstructionSimplify.cpp
+++ b/llvm/lib/Analysis/InstructionSimplify.cpp
@@ -5784,12 +5784,10 @@ static Value *simplifyIntrinsic(CallBase *Call, const SimplifyQuery &Q) {
       auto Attr = Call->getFunction()->getFnAttribute(Attribute::VScaleRange);
       if (!Attr.isValid())
         return nullptr;
-      unsigned MinScalarVectorSize, MaxScalarVectorSize;
-      std::tie(MinScalarVectorSize, MaxScalarVectorSize) =
-          Attr.getVScaleRangeArgs();
-      if (MinScalarVectorSize == MaxScalarVectorSize &&
-          MaxScalarVectorSize != 0)
-        return ConstantInt::get(F->getReturnType(), MinScalarVectorSize);
+      unsigned VScaleMin, VScaleMax;
+      std::tie(VScaleMin, VScaleMax) = Attr.getVScaleRangeArgs();
+      if (VScaleMin == VScaleMax && VScaleMax != 0)
+        return ConstantInt::get(F->getReturnType(), VScaleMin);
       return nullptr;
     }
     default:

diff  --git a/llvm/test/Transforms/InstSimplify/fold-vscale.ll b/llvm/test/Transforms/InstSimplify/fold-vscale.ll
index b5f1f77942fd7..f9643691e04c9 100644
--- a/llvm/test/Transforms/InstSimplify/fold-vscale.ll
+++ b/llvm/test/Transforms/InstSimplify/fold-vscale.ll
@@ -1,24 +1,24 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
 ; RUN: opt < %s -instsimplify -S | FileCheck %s
 
-define i64 @vscale_i64() #1 {
-; CHECK-LABEL: @vscale_i64(
+define i64 @vscale_i64_range_1_1() #1 {
+; CHECK-LABEL: @vscale_i64_range_1_1(
 ; CHECK-NEXT:    ret i64 1
 ;
   %out = call i64 @llvm.vscale.i64()
   ret i64 %out
 }
 
-define i32 @vscale_i32() #2 {
-; CHECK-LABEL: @vscale_i32(
+define i32 @vscale_i32_range_2_2() #2 {
+; CHECK-LABEL: @vscale_i32_range_2_2(
 ; CHECK-NEXT:    ret i32 2
 ;
   %out = call i32 @llvm.vscale.i32()
   ret i32 %out
 }
 
-define i64 @vscale_i64_
diff () #3 {
-; CHECK-LABEL: @vscale_i64_
diff (
+define i64 @vscale_i64_range_2_4() #3 {
+; CHECK-LABEL: @vscale_i64_range_2_4(
 ; CHECK-NEXT:    [[OUT:%.*]] = call i64 @llvm.vscale.i64()
 ; CHECK-NEXT:    ret i64 [[OUT]]
 ;


        


More information about the llvm-commits mailing list