Extend for unsigned integer according the comment of D129191.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Transforms/Utils/SimplifyIndVar.cpp | ||
---|---|---|
697 | For fptoui, shouldn't we also check that it's non-negative? Wouldn't your current code optimize an IV that does -100 to 100 for example? |
llvm/lib/Transforms/Utils/SimplifyIndVar.cpp | ||
---|---|---|
697 | thanks @nikic very much, and I verified that the gcc also transform with negative value, see detail in https://godbolt.org/z/1hxebdYfr |
LGTM
The next step here could be to also support uitofp.
llvm/lib/Transforms/Utils/SimplifyIndVar.cpp | ||
---|---|---|
697 | Ah yes, it is fine because FPToUI with negative value results in poison anyway. It would probably still be valuable to add a test with negative IV. |
llvm/lib/Transforms/Utils/SimplifyIndVar.cpp | ||
---|---|---|
697 |
| |
697 | Done, thanks. |
For fptoui, shouldn't we also check that it's non-negative? Wouldn't your current code optimize an IV that does -100 to 100 for example?