mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-26 05:25:47 +00:00
fix rdar://9297011 - udiv by power of two causing fast-isel rejects
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129693 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -990,6 +990,10 @@ unsigned FastISel::FastEmit_ri_(MVT VT, unsigned Opcode,
|
||||
if (Opcode == ISD::MUL && isPowerOf2_64(Imm)) {
|
||||
Opcode = ISD::SHL;
|
||||
Imm = Log2_64(Imm);
|
||||
} else if (Opcode == ISD::UDIV && isPowerOf2_64(Imm)) {
|
||||
// div x, 8 -> srl x, 3
|
||||
Opcode = ISD::SRL;
|
||||
Imm = Log2_64(Imm);
|
||||
}
|
||||
|
||||
// Horrible hack (to be removed), check to make sure shift amounts are
|
||||
|
Reference in New Issue
Block a user