Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp | ||
---|---|---|
3924 | I think one off MIRBuilders should never be used |
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp | ||
---|---|---|
3924 | What do you suggest here instead? |
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp | ||
---|---|---|
3924 | The combiner helper should have a universal builder |
llvm/test/CodeGen/AArch64/GlobalISel/postlegalizercombiner-rotate.mir | ||
---|---|---|
5 | Maybe a couple boundary tests would be nice here? G_CONSTANT == bit size, G_CONSTANT == bit size - 1? |
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp | ||
---|---|---|
3924 | The universal builder is a CSE one, and I need a constant folding one here. Maybe CSE should do it too? |
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp | ||
---|---|---|
3924 | I honestly don't see the point of having all of these MIRBuilder flavors. Why don't we have just one that does everything? |
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp | ||
---|---|---|
3924 | I thought the CSE builder did do constant folding. Also can't you just directly call the constant folding utility function? |
What's the point of this? Does it somehow end up generating better code?
If it is useful, you could also do the same for FSHL and FSHR.
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp | ||
---|---|---|
3924 | Yes the CSE builder does constant folding. I think ConstantFoldingMIRBuilder should be deleted. It's unused and I was told it was just an experiment. |
It allows us to select immediate forms of rotate instructions for AArch64.
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp | ||
---|---|---|
3924 | Thanks, I hadn't realized since we didn't enable CSEInfo for this combiner pass so it wasn't working. |
- Add more tests.
- Factor out the APInt checking part of the constant folder to be used as a query.
- Enable CSEInfo in the postlegalizer combiner so that we don't have to instantiate a constant-folding MIRBuilder.
What's the point of this? Does it somehow end up generating better code?
It allows us to select immediate forms of rotate instructions for AArch64.
I would expect most targets to handle that during instruction selection by ignoring the high bits of the rotate amount, but perhaps there's some reason why it's awkward to do that for AArch64. Would it make sense for your new combine to be completely AArch64-specific? Currently you have added it to all_combines so it will be run on other targets too.
llvm/include/llvm/Target/GlobalISel/Combine.td | ||
---|---|---|
622 | Seems a bit odd to include this in "funnel_shift_combines" since it doesn't actually touch funnel shifts. |
That's possible, but I assumed that generic code wanted this since this is already done in DAGCombine for rotates.
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp | ||
---|---|---|
3918–3919 | Why not just return true? Why would this ever fail? |
clang-tidy: warning: invalid case style for function 'ConstantFoldBinOp' [readability-identifier-naming]
not useful