Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
What happens if the shift amount has more than one use?
llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp | ||
---|---|---|
2873 | Please use mvn to NOT a register. (This doesn't affect performance, but it's more readable.) |
Comment Actions
So, we emit the shift amount separately. Which isn't a big deal, I guess, but we should have a testcase. Something like:
define void @foo(i64* %valptr, i64* %shamtptr, i64 %shamt) { %val = load i64, i64* %valptr %negshamt = sub i64 64, %shamt %shifted = ashr i64 %val, %negshamt store i64 %shifted, i64* %valptr store i64 %negshamt, i64* %shamtptr ret void }
Comment Actions
So, we emit the shift amount separately.
So it looks like we should only do this when the shift amount has a single use? Can I leave that for a separate patch?
Comment Actions
LGTM. I'm fine putting the multi-use handling in a followup. (For that, I guess you might also want to consider the case where a shift amount is used by multiple shifts...)
Please use mvn to NOT a register. (This doesn't affect performance, but it's more readable.)