-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cherry-pick improvements for AVR codegen #149
Cherry-pick improvements for AVR codegen #149
Commits on Jul 23, 2023
-
[AVR] Fix incorrect decoding of conditional branch instructions
This patch fixes the inaccurate decoding of the offset operand of the conditional branch instructions. Reviewed By: aykevl Differential Revision: https://reviews.llvm.org/D140816
Configuration menu - View commit details
-
Copy full SHA for 3c4f514 - Browse repository at this point
Copy the full SHA 3c4f514View commit details -
[AVR][NFC] Remove redundant target feature PROGMEM
The functionality of FeaturePROGMEM is all equivalant to FeatureLPM. Reviewed By: Chenbing.Zheng, aykevl Differential Revision: https://reviews.llvm.org/D141242
Configuration menu - View commit details
-
Copy full SHA for 6d0184a - Browse repository at this point
Copy the full SHA 6d0184aView commit details -
[AVR][NFC] Refactor 'AVRAsmPrinter::PrintAsmOperand'
Reviewed By: Chenbing.Zheng, aykevl Differential Revision: https://reviews.llvm.org/D142170
Configuration menu - View commit details
-
Copy full SHA for 83205f5 - Browse repository at this point
Copy the full SHA 83205f5View commit details -
[AVR] Optimize 16-bit comparison with a constant
Fixes llvm#30923 Reviewed By: jacquesguan, aykevl Differential Revision: https://reviews.llvm.org/D142281
Configuration menu - View commit details
-
Copy full SHA for e8a78a6 - Browse repository at this point
Copy the full SHA e8a78a6View commit details -
[AVR] Fix inaccurate offsets in PC relative branch instructions
In avr-gcc, the destination of "rjmp label + offset" is address 'label + offset', while destination of "rjmp . + offset" is 'address_of_rjmp + offset + 2'. Clang is in accordance with avr-gcc for "rjmp label + offset", but emits incorrect destination of "rjmp . + offset" to 'address_of_rjmp + offset', in which the expected offset 2 is missing. This patch fixes the above issue. Fixes llvm#60019 Reviewed By: jacquesguan, aykevl Differential Revision: https://reviews.llvm.org/D143901
Configuration menu - View commit details
-
Copy full SHA for 2f4a9d7 - Browse repository at this point
Copy the full SHA 2f4a9d7View commit details -
[AVR][MC] Add ELF flag 'EF_AVR_LINKRELAX_PREPARED' to OBJ files
This is in accordance with avr-gcc, even '-mno-relax' is specified to avr-gcc, this flag will also be added to the output relocatables. With this flag set, the GNU ld will perform long call -> short call optimization for AVR, otherwise not. Fixes llvm#54508 Reviewed By: MaskRay, jacquesguan, aykevl Differential Revision: https://reviews.llvm.org/D144617
Configuration menu - View commit details
-
Copy full SHA for 4d1912b - Browse repository at this point
Copy the full SHA 4d1912bView commit details -
[AVR] Fix incorrect flags of livein registers when spilling them
In AVRFrameLowering::spillCalleeSavedRegisters(), when a 16-bit livein register is spilled, two PUSH instructions are generated for the higher and lower 8-bit registers. But these two 8-bit registers are marked as killed in the two PUSH instructions, so any future use of them will cause a crash. This patch fixes the above issue by adding the two sub 8-bit registers to the livein list. Fixes llvm#56423 Reviewed By: jacquesguan Differential Revision: https://reviews.llvm.org/D144720
Configuration menu - View commit details
-
Copy full SHA for 8dc25fa - Browse repository at this point
Copy the full SHA 8dc25faView commit details -
[AVR] Fix incorrect expansion of the pseudo 'ELPMBRdZ' instruction
The 'ELPM' instruction has three forms: -------------------------- | form | feature | | ----------- | -------- | | ELPM | hasELPM | | ELPM Rd, Z | hasELPMX | | ELPM Rd, Z+ | hasELPMX | -------------------------- The second form is always used in the expansion of the pseudo instruction 'ELPMBRdZ'. But for devices without ELPMX but only with ELPM, only the first form can be emitted. Reviewed By: jacquesguan Differential Revision: https://reviews.llvm.org/D141221
Configuration menu - View commit details
-
Copy full SHA for 0b320f8 - Browse repository at this point
Copy the full SHA 0b320f8View commit details -
[AVR] Do not emit 'LPM Rd, Z' on devices without FeatureLPMX
The 'LPM' instruction has three forms: ------------------------ | form | feature | | ---------- | --------| | LPM | hasLPM | | LPM Rd, Z | hasLPMX | | LPM Rd, Z+ | hasLPMX | ------------------------ The second form is always selected in ISelDAGToDAG, even on devices without FeatureLPMX. This patch emits "LPM + MOV" on devices with only FeatureLPM. Reviewed By: jacquesguan Differential Revision: https://reviews.llvm.org/D141246
Configuration menu - View commit details
-
Copy full SHA for 6582eff - Browse repository at this point
Copy the full SHA 6582effView commit details -
[AVR] Fix incorrect expansion of pseudo instructions LPMWRdZ/ELPMWRdZ
The 'ELPM' instruction has three forms: -------------------------- | form | feature | | ----------- | -------- | | ELPM | hasELPM | | ELPM Rd, Z | hasELPMX | | ELPM Rd, Z+ | hasELPMX | -------------------------- The second form is always used in the expansion of pseudo instructions LPMWRdZ/ELPMWRdZ. But for devices without ELPMX and with only ELPM, only the first form can be used. Reviewed By: aykevl, Miss_Grape Differential Revision: https://reviews.llvm.org/D141264
Configuration menu - View commit details
-
Copy full SHA for 722c7b6 - Browse repository at this point
Copy the full SHA 722c7b6View commit details -
[AVR] Reject invalid LDD instruction with explicit error
We should reject "ldd Rn, X" with explicit error message rather than "llvm_unreachable" in llvm's release build. Fixes llvm#62012 Reviewed By: Miss_Grape Differential Revision: https://reviews.llvm.org/D147877
Configuration menu - View commit details
-
Copy full SHA for d103fcc - Browse repository at this point
Copy the full SHA d103fccView commit details -
Configuration menu - View commit details
-
Copy full SHA for ccd3588 - Browse repository at this point
Copy the full SHA ccd3588View commit details -
[AVR] Disable post increment load from program memory space
We temporarily only allow post increment load/store from/to data memory, and disable post increment load from program space. Updates llvm#59914 Reviewed By: mzh Differential Revision: https://reviews.llvm.org/D147761
Configuration menu - View commit details
-
Copy full SHA for 614a431 - Browse repository at this point
Copy the full SHA 614a431View commit details -
[AVR] Fix an issue of writing 16-bit ports
For 16-bit ports, the normal devices reqiure writing high byte first and then low byte. But the XMEGA devices require the reverse order. Fixes llvm#58395 Reviewed By: aykevl, jacquesguan Differential Revision: https://reviews.llvm.org/D141752
Configuration menu - View commit details
-
Copy full SHA for c5cadd1 - Browse repository at this point
Copy the full SHA c5cadd1View commit details -
[AVR] Fix incorrect operands of pseudo instruction 'ROLBRd'
Fixes llvm#63098 Reviewed by: benshi001 Differential Revision: https://reviews.llvm.org/D152063
Configuration menu - View commit details
-
Copy full SHA for 1c5fb0c - Browse repository at this point
Copy the full SHA 1c5fb0cView commit details -
[AVR][NFC][test] Suppement a test of the pseudo instruction RORBRd
Reviewed By: aykevl, Patryk27 Differential Revision: https://reviews.llvm.org/D152087
Configuration menu - View commit details
-
Copy full SHA for eeb4a65 - Browse repository at this point
Copy the full SHA eeb4a65View commit details -
[AVR][NFC][test] Supplement more tests of 8-bit rotation
Reviewed By: Patryk27, jacquesguan Differential Revision: https://reviews.llvm.org/D152129
Configuration menu - View commit details
-
Copy full SHA for b0ad3bc - Browse repository at this point
Copy the full SHA b0ad3bcView commit details -
[AVR][NFC] Improve CodeGen tests
Reviewed By: Patryk27 Differential Revision: https://reviews.llvm.org/D152605
Configuration menu - View commit details
-
Copy full SHA for 4f9f7c0 - Browse repository at this point
Copy the full SHA 4f9f7c0View commit details -
[AVR] Enable sub register liveness
Reviewed By: Patryk27 Differential Revision: https://reviews.llvm.org/D152606
Configuration menu - View commit details
-
Copy full SHA for 2f895d5 - Browse repository at this point
Copy the full SHA 2f895d5View commit details -
[AVR] Fix incorrect expansion of pseudo instruction ROLBRd
Since ROLBRd needs an implicit R1 (on AVR) or an implicit R17 (on AVRTiny), we split ROLBRd to ROLBRdR1 (on AVR) and ROLBRdR17 (on AVRTiny). Reviewed By: aykevl, Patryk27 Differential Revision: https://reviews.llvm.org/D152248
Configuration menu - View commit details
-
Copy full SHA for b9b277b - Browse repository at this point
Copy the full SHA b9b277bView commit details -
[AVR] Optimize 8-bit rotation when rotation bits >= 4
Fixes llvm#63100 Reviewed By: aykevl, Patryk27, jacquesguan Differential Revision: https://reviews.llvm.org/D152130
Configuration menu - View commit details
-
Copy full SHA for 1201a28 - Browse repository at this point
Copy the full SHA 1201a28View commit details -
[AVR] Optimize 8-bit rotation when rotation bits == 3
Fixes llvm#63100 Reviewed By: aykevl Differential Revision: https://reviews.llvm.org/D152365
Configuration menu - View commit details
-
Copy full SHA for 894df9d - Browse repository at this point
Copy the full SHA 894df9dView commit details -
[AVR] Expand shifts of all types except int8 and int16
Currently our AVRShiftExpand pass expands only 32-bit shifts, with the assumption that other kinds of shifts (e.g. 64-bit ones) are automatically reduced to 8-bit ones by LLVM during ISel. However this is not always true and causes problems in the rust-lang runtime. This commit changes the logic a bit, so that instead of expanding only 32-bit shifts, we expand shifts of all types except 8-bit and 16-bit. This is not the most optimal solution, because 64-bit shifts can be expanded to 32-bit shifts which has been deeply optimized. I've checked the generated code using rustc + simavr, and all shifts seem to behave correctly. Spotted in the wild in rustc: rust-lang/compiler-builtins#523 rust-lang/rust#112140 Reviewed By: benshi001 Differential Revision: https://reviews.llvm.org/D154785
Configuration menu - View commit details
-
Copy full SHA for 8b9c317 - Browse repository at this point
Copy the full SHA 8b9c317View commit details