Patch adds one new GICombinerRule for G_FABS. The combine rule folds G_FABS(G_FABS(X)) to G_FABS(X). Patch additionally adds new combiner tests for the AArch64 target to test this new combiner rule.
Details
Details
Diff Detail
Diff Detail
Event Timeline
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp | ||
---|---|---|
2028–2031 | replaceRegWith? |
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp | ||
---|---|---|
1826 | Maybe simpler? return mi_match(MI.getOperand(1).getReg(), MRI, m_GFabs(m_reg(Src))); |
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp | ||
---|---|---|
1826 | oh wait no that won't work, that'll give the source of the other G_FABS nevermind |
Comment Actions
LGTM. Maybe should factor this into a combine_idempotent that checks the inner opcode matches for other operations later
Comment Actions
Thanks for the review. Still don't have commit access, will need someone to commit on my behalf. Thanks in advance!
Maybe simpler?