[all-commits] [llvm/llvm-project] 59eae9: [ValueTracking] Don't use CondContext in dataflow ...
Yingwei Zheng via All-commits
all-commits at lists.llvm.org
Wed Jul 24 05:06:58 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 59eae919c938f890e9b9b4be8a3fa3cb1b11ed89
https://github.com/llvm/llvm-project/commit/59eae919c938f890e9b9b4be8a3fa3cb1b11ed89
Author: Yingwei Zheng <dtcxzyw2333 at gmail.com>
Date: 2024-07-24 (Wed, 24 Jul 2024)
Changed paths:
M llvm/include/llvm/Analysis/SimplifyQuery.h
M llvm/lib/Analysis/ValueTracking.cpp
A llvm/test/Transforms/InstCombine/pr100298.ll
Log Message:
-----------
[ValueTracking] Don't use CondContext in dataflow analysis of phi nodes (#100316)
See the following case:
```
define i16 @pr100298() {
entry:
br label %for.inc
for.inc:
%indvar = phi i32 [ -15, %entry ], [ %mask, %for.inc ]
%add = add nsw i32 %indvar, 9
%mask = and i32 %add, 65535
%cmp1 = icmp ugt i32 %mask, 5
br i1 %cmp1, label %for.inc, label %for.end
for.end:
%conv = trunc i32 %add to i16
%cmp2 = icmp ugt i32 %mask, 3
%shl = shl nuw i16 %conv, 14
%res = select i1 %cmp2, i16 %conv, i16 %shl
ret i16 %res
}
```
When computing knownbits of `%shl` with `%cmp2=false`, we cannot use
this condition in the analysis of `%mask (%for.inc -> %for.inc)`.
Fixes https://github.com/llvm/llvm-project/issues/100298.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list