[llvm] 6aeb2a2 - [InstCombine] Require LoopInfo in test (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 29 08:34:33 PDT 2022


Author: Nikita Popov
Date: 2022-04-29T17:34:19+02:00
New Revision: 6aeb2a215ee170a0abbc4a99f75065816fcff744

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

LOG: [InstCombine] Require LoopInfo in test (NFC)

This test case doesn't show what it was intended to without
require<loops>.

Added: 
    

Modified: 
    llvm/test/Transforms/InstCombine/constant-fold-gep.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/InstCombine/constant-fold-gep.ll b/llvm/test/Transforms/InstCombine/constant-fold-gep.ll
index 6bee7bb79446..928409a42f0c 100644
--- a/llvm/test/Transforms/InstCombine/constant-fold-gep.ll
+++ b/llvm/test/Transforms/InstCombine/constant-fold-gep.ll
@@ -1,5 +1,5 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt < %s -passes=instcombine -S | FileCheck %s
+; RUN: opt < %s -passes='require<loops>,instcombine' -S | FileCheck %s
 target datalayout = "E-p:64:64:64-p1:16:16:16-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
 
 ; Constant folding should fix notionally out-of-bounds indices
@@ -164,8 +164,7 @@ define i8* @gep_plus_addr_sub_self_in_loop() {
 ; CHECK-NEXT:    br label [[LOOP:%.*]]
 ; CHECK:       loop:
 ; CHECK-NEXT:    [[ADDR:%.*]] = call i64 @get.i64()
-; CHECK-NEXT:    [[P1:%.*]] = getelementptr i8, i8* @g, i64 [[ADDR]]
-; CHECK-NEXT:    [[P2:%.*]] = getelementptr i8, i8* [[P1]], i64 sub (i64 0, i64 ptrtoint (i8* @g to i64))
+; CHECK-NEXT:    [[P2:%.*]] = getelementptr i8, i8* null, i64 [[ADDR]]
 ; CHECK-NEXT:    call void @use.ptr(i8* [[P2]])
 ; CHECK-NEXT:    br label [[LOOP]]
 ;


        


More information about the llvm-commits mailing list