Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Time | Test | |
---|---|---|
1,230 ms | linux > libarcher.parallel::parallel-nosuppression.c |
Event Timeline
llvm/test/Transforms/InstCombine/select.ll | ||
---|---|---|
1145–1146 | Missing fold |
I guess the idea makes sense.
Not sure what the isUnordered() check is doing. And this needs to be address-space aware.
llvm/utils/compare-stats.py | ||
---|---|---|
3 | Did you mean to include this? |
Aha, finally we're getting somewhere!
Not sure what the isUnordered() check is doing.
This is the restriction on combineLoadToOperationType().
Can we do this unconditionally?
And this needs to be address-space aware.
combineLoadToNewType() already takes care of annotating the new load type with proper original address space, so we should be good.
llvm/utils/compare-stats.py | ||
---|---|---|
3 | Err, no |
I think we should not do this for atomic operations if the bitwidth is potentially different. That said, I don't see an immediate reason for the type to make an impact otherwise.
The bitwidth is not different, because we've just fixed bitwidth mismatch in the fold above.
Therefore i'll make this unconditional.
I don't like the direction of this patch because it will remove inttoptr instructions that were present in the original program. In the same way that optimizations shouldn't introduce inttoptr, they shouldn't fuse them with loads either.
If the original program had the inttoptr cast and you fold it with a load instruction, then you are asking the load to do the cast. This sort of type punning is not ok. I strongly disagree with Chandler that LLVM's memory is not typed. It needs to distinguish between integers and pointers, otherwise I don't know how to make LLVM correct without a significant perf penalty.
If LLVM's memory was untyped, we would have to assume that every pointer load could be doing an implicit inttoptr cast, which would havoc most optimizations. The fact that some optimizations, like sroa, assume that the memory is untyped and most of the others don't is a source of miscompilations.
Missing fold