mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-28 19:31:58 +00:00
something wrong with this opt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44370 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9bdcb393ae
commit
19914ed97f
@ -1086,16 +1086,18 @@ def : Pat<(mul GPRC:$RA, immRemP2:$imm),
|
||||
(ADDQr (SLr GPRC:$RA, (nearP2X immRemP2:$imm)), (SLi GPRC:$RA, (nearP2RemX immRemP2:$imm)))>;
|
||||
|
||||
//n is below a power of 2
|
||||
def : Pat<(mul GPRC:$RA, immRem1n:$imm),
|
||||
(SUBQr (SLr GPRC:$RA, (nearP2X immRem1n:$imm)), GPRC:$RA)>;
|
||||
def : Pat<(mul GPRC:$RA, immRem2n:$imm),
|
||||
(SUBQr (SLr GPRC:$RA, (nearP2X immRem2n:$imm)), (ADDQr GPRC:$RA, GPRC:$RA))>;
|
||||
def : Pat<(mul GPRC:$RA, immRem3n:$imm),
|
||||
(SUBQr (SLr GPRC:$RA, (nearP2X immRem3n:$imm)), (S4SUBQr GPRC:$RA, GPRC:$RA))>;
|
||||
def : Pat<(mul GPRC:$RA, immRem4n:$imm),
|
||||
(SUBQr (SLr GPRC:$RA, (nearP2X immRem4n:$imm)), (SLi GPRC:$RA, 2))>;
|
||||
def : Pat<(mul GPRC:$RA, immRem5n:$imm),
|
||||
(SUBQr (SLr GPRC:$RA, (nearP2X immRem5n:$imm)), (S4ADDQr GPRC:$RA, GPRC:$RA))>;
|
||||
def : Pat<(mul GPRC:$RA, immRemP2n:$imm),
|
||||
(SUBQr (SLr GPRC:$RA, (nearP2X immRemP2n:$imm)), (SLi GPRC:$RA, (nearP2RemX immRemP2n:$imm)))>;
|
||||
//FIXME: figure out why something is truncating the imm to 32bits
|
||||
// this will fix 2007-11-27-mulneg3
|
||||
//def : Pat<(mul GPRC:$RA, immRem1n:$imm),
|
||||
// (SUBQr (SLr GPRC:$RA, (nearP2X immRem1n:$imm)), GPRC:$RA)>;
|
||||
//def : Pat<(mul GPRC:$RA, immRem2n:$imm),
|
||||
// (SUBQr (SLr GPRC:$RA, (nearP2X immRem2n:$imm)), (ADDQr GPRC:$RA, GPRC:$RA))>;
|
||||
//def : Pat<(mul GPRC:$RA, immRem3n:$imm),
|
||||
// (SUBQr (SLr GPRC:$RA, (nearP2X immRem3n:$imm)), (S4SUBQr GPRC:$RA, GPRC:$RA))>;
|
||||
//def : Pat<(mul GPRC:$RA, immRem4n:$imm),
|
||||
// (SUBQr (SLr GPRC:$RA, (nearP2X immRem4n:$imm)), (SLi GPRC:$RA, 2))>;
|
||||
//def : Pat<(mul GPRC:$RA, immRem5n:$imm),
|
||||
// (SUBQr (SLr GPRC:$RA, (nearP2X immRem5n:$imm)), (S4ADDQr GPRC:$RA, GPRC:$RA))>;
|
||||
//def : Pat<(mul GPRC:$RA, immRemP2n:$imm),
|
||||
// (SUBQr (SLr GPRC:$RA, (nearP2X immRemP2n:$imm)), (SLi GPRC:$RA, (nearP2RemX immRemP2n:$imm)))>;
|
||||
} //Added complexity
|
||||
|
13
test/CodeGen/Alpha/2007-11-27-mulneg3.ll
Normal file
13
test/CodeGen/Alpha/2007-11-27-mulneg3.ll
Normal file
@ -0,0 +1,13 @@
|
||||
; RUN: llvm-as < %s | llc -march=alpha
|
||||
|
||||
;FIXME: this should produce no mul inst. But not crashing will have to do for now
|
||||
|
||||
; ModuleID = 'Output/bugpoint-train/bugpoint-reduced-simplified.bc'
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-f128:128:128"
|
||||
target triple = "alphaev6-unknown-linux-gnu"
|
||||
|
||||
define fastcc i32 @getcount(i32 %s) {
|
||||
cond_next43: ; preds = %bb27
|
||||
%tmp431 = mul i32 %s, -3
|
||||
ret i32 %tmp431
|
||||
}
|
Loading…
Reference in New Issue
Block a user