[PATCH] D85184: [Attributor][WIP] Deduce noundef attribute
Shinji Okumura via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 4 01:44:15 PDT 2020
okura added inline comments.
================
Comment at: llvm/lib/Transforms/IPO/AttributorAttributes.cpp:7178
+ case Instruction::SRem:
+ return true;
+ }
----------------
aqjune wrote:
> A value that is used as a divisor of div/rem can still have undef bits.
> ```
> a = undef | 1 ; a is not noundef because it has undef bits
> x = udiv 100, a ; this is not UB
> ```
> Can we use `isGuaranteedNotToBeUndefOrPoison` instead?
I was confusing the undef and poison value. Thanks for your example.
I will rewrite this part using `isGuaranteedNotToBeUndefOrPoison`.
I didn't know such a helpful function, thank you very much.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D85184/new/
https://reviews.llvm.org/D85184
More information about the llvm-commits
mailing list