Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Tests missing
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp | ||
---|---|---|
2173–2174 | This is only better if this is fed by a compare you can invert. This should probably not do this if it finds some other i1 def. We also should probably check if the inverted condcode is legal, but I guess we're missing cond code legality infrastructure (and none of the targets with gisel now don't need it) | |
2176–2177 | This is illegal, you can just assume these are registers |
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp | ||
---|---|---|
2173–2174 |
We process the whole expression tree and return false if we find anything that is not an AND or OR or a comparison. |
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp | ||
---|---|---|
2154 | A MIR-esque example would be handy here, just to make it explicit what's being matched. | |
2155 | I don't think here's any reason to talk about an index I here; from the looks of it, the below loop can be a range-based for? | |
2162 | Usually people assert that the result of MRI.getVRegDef(...) isn't null. I'm not sure if that's actually necessary in this case though; I *think* that it can only be null when you have a physreg, but I'm not entirely sure. | |
2193 | A MIR-esque example would be useful here too? |
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp | ||
---|---|---|
2162 | getVRegDef should never fail for gMIR. |
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp | ||
---|---|---|
2155 | No, it's slightly tricky. It can't be a range-based for because we push more stuff into RegsToNegate inside the loop. It's a worklist algorithm, but without using a separate worklist vector. |
llvm/test/CodeGen/AArch64/GlobalISel/prelegalizercombiner-invert-cmp.mir | ||
---|---|---|
224 ↗ | (On Diff #288356) | Should have some cases where the conditions are a G_TRUNC or some other not-compare source |
Right, the xor is introduced by IRTranslator::emitSwitchCase. Perhaps it could be optimized at that point, instead of later in a combiner pass, but I'm not sure how feasible that is. I guess at that point you can't do accurate hasOneNonDBGUse checks?
SmallVectorImpl?