diff options
author | Florian Hahn <flo@fhahn.com> | 2023-11-21 14:27:50 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-21 14:27:50 +0000 |
commit | 2d39cb49833abaf7a67110149a010940d7790d7e (patch) | |
tree | c92a18a43a2c13a0e5d18262751c3462fb60d7d8 /llvm/test/Analysis | |
parent | 42cd9aeec286a6928da59dce1134fdced0f0462a (diff) | |
download | llvm-2d39cb49833abaf7a67110149a010940d7790d7e.zip llvm-2d39cb49833abaf7a67110149a010940d7790d7e.tar.gz llvm-2d39cb49833abaf7a67110149a010940d7790d7e.tar.bz2 |
[BasicAA] Don't use MinAbsVarIndex = 1. (#72993)
The current code incorrectly assumed that the absolute variable index
needs to be at least 1, if the variable is != 0. This is incorrect, in
case multiplying with Scale wraps.
The code below already checks for wrapping properly, so just remove the
incorrect assignment.
Fixes https://github.com/llvm/llvm-project/issues/72831.
Diffstat (limited to 'llvm/test/Analysis')
-rw-r--r-- | llvm/test/Analysis/BasicAA/gep-modulo.ll | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/test/Analysis/BasicAA/gep-modulo.ll b/llvm/test/Analysis/BasicAA/gep-modulo.ll index a84e0fc..159aaf9 100644 --- a/llvm/test/Analysis/BasicAA/gep-modulo.ll +++ b/llvm/test/Analysis/BasicAA/gep-modulo.ll @@ -326,7 +326,7 @@ define i8 @mul_may_overflow_var_nonzero_minabsvarindex_one_index(ptr %arr, i8 %x ; CHECK-NEXT: PartialAlias (off 917): [2000 x i8]* %arr, i8* %gep.917 ; CHECK-NEXT: MayAlias: i8* %gep.917, i8* %gep.idx ; CHECK-NEXT: MustAlias: [2000 x i8]* %arr, i8* %gep.0 -; CHECK-NEXT: NoAlias: i8* %gep.0, i8* %gep.idx +; CHECK-NEXT: MayAlias: i8* %gep.0, i8* %gep.idx ; CHECK-NEXT: NoAlias: i8* %gep.0, i8* %gep.917 ; load [2000 x i8], ptr %arr @@ -362,10 +362,9 @@ define i8 @mul_nsw_var_nonzero_minabsvarindex_one_index(ptr %arr, i8 %x, i64 %v) ret i8 %l } -; FIXME: %gep and %p can alias. define i8 @test_pr72831_may_wrap(i64 %off) { ; CHECK-LABEL: Function: test_pr72831_may_wrap: 2 pointers, 0 call sites -; CHECK-NEXT: NoAlias: i8* %gep, i8* %p +; CHECK-NEXT: MayAlias: i8* %gep, i8* %p entry: %p = alloca [2 x i8], align 1 %ext = zext i1 false to i64 |