際際滷

際際滷Share a Scribd company logo
LLVM Overview
Constantin Lungu, 2014
Agenda
 What is LLVM
 Why is it good
 How does it work
 IR, SSA, Phi nodes, data alignment
What is LLVM?
What is LLVM?
 A set of reusable libraries for implementing compilers
 Started in 2000
 Written in C++, 811k SLOC
 As of today, works with C, C++, ObjC, Ada, D, Fortran
 Not an acronym, LLVM scope is not limited to creation of VM
 LLVM = umbrella project + IR + debugger + C++ standard library
Why is it good?
Why is it good?
 Supports lot of instruction sets: ARM, Hexagon, MIPS, NVPTX,
R600, SPARC, x86/x86-64, even PowerPC!
 It's a layer between top level code and the executable
 It makes the front end and the back end decoupled
 Supports runtime compilation (JIT)
 Has lots of optimizers
How does it work?
How does it work?
In a nutshell:
 Generate LLVM IR from your compiler
 Run optimizers
 Create object 鍖les, assembly, or machine code in memory
How does it work?
 Tokenise the source code
 Parse the token stream
 Build the AST
 Optimize IR
 Assemble
LLVM IR
 Unlimited SSA Register machine instruction set
 Representations:
 Human-readable LLVM assembly (.ll)
 Dense 'bitcode' binaries (.bc)
 C++ classes
Static Single Assignment
Let's consider the following code:
int main(int argc, const char* argv[])
{
int i = 1;
i = i * 2;
return 0;
}
Which yields us...
Static Single Assignment
Note: LLVM registers are indexed. So %1 is the 鍖rst allocated
register, %2 is the second, etc.
define i32 @main(i32 %argc, i8** %argv) #0 {
%1 = alloca i32, align 4
%2 = alloca i32, align 4
%3 = alloca i8**, align 8
%i = alloca i32, align 4 ; declare i
store i32 0, i32* %1
store i32 %argc, i32* %2, align 4
store i8** %argv, i8*** %3, align 8 ; startup till here
store i32 1, i32* %i, align 4 ; store 1 in i
%4 = load i32* %i, align 4 ; store i in %4
%5 = mul nsw i32 %4, 2 ; multiply %4 by 2 and store in %5
store i32 %5, i32* %i, align 4 ; store %5 in i
ret i32 0
}
But wait...
d0: y := 1
d1: y := 2
d2: x := y
d0 is redundant, right? It has no effect on the 鍖nal value of x. But we
know it because we are smart. Compilers aren't that smart, so they
have to do Reaching De鍖nition analysis to determine that. Let's
convert it to SSA form?
d0: y1 := 1
d1: y2 := 2
d2: x1 := y2
Mmm... much better.
Bene鍖ts of SSA
 Get rid of use-de鍖ne chains with reaching de鍖nition
 If a variable has N uses and M de鍖nitions, it takes space and time
proportional to N揃M to represent use-def chains, while size of the
SSA form is linear in the size of the original pattern
 Simpli鍖es other algorithms related to optimization & data
structures or even gets rid of them
And what about those  nodes?
Well, these ones are necessary when a variable can be assigned a
different value based on the control 鍖ow. Sample code on the left,
usage of Phi nodes on the right.
y = 1 y1 = 1
if (condition) if (condition)
y = 2 y2 = 2
x = y x1 = 陸(y1, y2)
The Phi node selects y1 or y2, depending where the control 鍖ow
reached the Phi node. The argument y1 is associated with the block
de鍖ning y1. Same thing goes with y2.
A better example of  nodes
void func(bool first, bool second) {
bool third = first || second;
}
Which yields us...
define void @func(i1 zeroext %first, i1 zeroext %second) #0 {
%1 = alloca i8, align 1
%2 = alloca i8, align 1
%third = alloca i8, align 1
%3 = zext i1 %first to i8
store i8 %3, i8* %1, align 1
%4 = zext i1 %second to i8
store i8 %4, i8* %2, align 1
%5 = load i8* %1, align 1 ; Decide what's first || second
%6 = trunc i8 %5 to i1 ; and store it in %6
br i1 %6, label %10, label %7 ; The actually interesting part, labeled %0
; <label>:7
%8 = load i8* %2, align 1
%9 = trunc i8 %8 to i1
br label %10 ; labeled %7
; <label>:10 ; preds = %7, %0
%11 = phi i1 [ true, %0 ], [ %9, %7 ] ; ... yield true if came from %0, otherwise yield %9
%12 = zext i1 %11 to i8
store i8 %12, i8* %third, align 1
ret void
}
And what's about those align keywords?
 The CPU accesses memory by a single word at a time
 If it happens so that the highest and lowest bits are not within the
same memory word being accessed, the CPU will have to split the
read in two reads! :(
 Not very good when you are optimizing machine code
 Solution - pad those values, so that you will always read the data in
as few cycles as possible
 ARM, for instance, does not support unaligned memory access
LLVM Overview
Thanks!
Ad

Recommended

04a intro while
04a intro while
hasfaa1017
Evaluation of postfix expression
Evaluation of postfix expression
Akhil Ahuja
Project on digital vlsi design
Project on digital vlsi design
DINESH DEVIREDDY
Infix to postfix
Infix to postfix
Saeed Farooqi
Tcs nqt 2019 p 1
Tcs nqt 2019 p 1
Phaneendra Bolla
Tcs nqt 2019 p 2
Tcs nqt 2019 p 2
Phaneendra Bolla
Recursion
Recursion
Nikxjon
computer notes - Evaluating postfix expressions
computer notes - Evaluating postfix expressions
ecomputernotes
20BCE1734.pdf
20BCE1734.pdf
Mridul Jadon
Mycasestudy
Mycasestudy
Emmanuel college
Chap 3 c++
Chap 3 c++
Widad Jamaluddin
Infix-Postfix expression conversion
Infix-Postfix expression conversion
Rashmiranja625
Infix to Postfix Conversion Using Stack
Infix to Postfix Conversion Using Stack
Soumen Santra
Looping in c language
Looping in c language
Infinity Tech Solutions
Conversion of Infix To Postfix Expressions
Conversion of Infix To Postfix Expressions
Kulachi Hansraj Model School Ashok Vihar
Booth algorithm
Booth algorithm
Saif Al-Kalbani
Assignment8
Assignment8
Sunita Milind Dol
Arrays c4 c5
Arrays c4 c5
Omar Al-Sabek
Technical questions
Technical questions
Kirthan S Holla
Programming in Arduino (Part 2)
Programming in Arduino (Part 2)
Niket Chandrawanshi
Programming in Arduino (Part 1)
Programming in Arduino (Part 1)
Niket Chandrawanshi
Infix postfixcoversion
Infix postfixcoversion
Pdr Patnaik
Control Statements, Array, Pointer, Structures
Control Statements, Array, Pointer, Structures
indra Kishor
Prefix, Infix and Post-fix Notations
Prefix, Infix and Post-fix Notations
Afaq Mansoor Khan
LAS16-501: Introduction to LLVM - Projects, Components, Integration, Internals
LAS16-501: Introduction to LLVM - Projects, Components, Integration, Internals
Linaro
07 140430-ipp-languages used in llvm during compilation
07 140430-ipp-languages used in llvm during compilation
Adam Hus叩r
Part II: LLVM Intermediate Representation
Part II: LLVM Intermediate Representation
Wei-Ren Chen
COMPILER_DESIGN_CLASS 2.ppt
COMPILER_DESIGN_CLASS 2.ppt
ssuserebb9821
COMPILER_DESIGN_CLASS 1.pptx
COMPILER_DESIGN_CLASS 1.pptx
ssuserebb9821
05 instruction set design and architecture
05 instruction set design and architecture
Waqar Jamil

More Related Content

What's hot (16)

20BCE1734.pdf
20BCE1734.pdf
Mridul Jadon
Mycasestudy
Mycasestudy
Emmanuel college
Chap 3 c++
Chap 3 c++
Widad Jamaluddin
Infix-Postfix expression conversion
Infix-Postfix expression conversion
Rashmiranja625
Infix to Postfix Conversion Using Stack
Infix to Postfix Conversion Using Stack
Soumen Santra
Looping in c language
Looping in c language
Infinity Tech Solutions
Conversion of Infix To Postfix Expressions
Conversion of Infix To Postfix Expressions
Kulachi Hansraj Model School Ashok Vihar
Booth algorithm
Booth algorithm
Saif Al-Kalbani
Assignment8
Assignment8
Sunita Milind Dol
Arrays c4 c5
Arrays c4 c5
Omar Al-Sabek
Technical questions
Technical questions
Kirthan S Holla
Programming in Arduino (Part 2)
Programming in Arduino (Part 2)
Niket Chandrawanshi
Programming in Arduino (Part 1)
Programming in Arduino (Part 1)
Niket Chandrawanshi
Infix postfixcoversion
Infix postfixcoversion
Pdr Patnaik
Control Statements, Array, Pointer, Structures
Control Statements, Array, Pointer, Structures
indra Kishor
Prefix, Infix and Post-fix Notations
Prefix, Infix and Post-fix Notations
Afaq Mansoor Khan

Similar to LLVM Overview (20)

LAS16-501: Introduction to LLVM - Projects, Components, Integration, Internals
LAS16-501: Introduction to LLVM - Projects, Components, Integration, Internals
Linaro
07 140430-ipp-languages used in llvm during compilation
07 140430-ipp-languages used in llvm during compilation
Adam Hus叩r
Part II: LLVM Intermediate Representation
Part II: LLVM Intermediate Representation
Wei-Ren Chen
COMPILER_DESIGN_CLASS 2.ppt
COMPILER_DESIGN_CLASS 2.ppt
ssuserebb9821
COMPILER_DESIGN_CLASS 1.pptx
COMPILER_DESIGN_CLASS 1.pptx
ssuserebb9821
05 instruction set design and architecture
05 instruction set design and architecture
Waqar Jamil
LLVM
LLVM
guest3e5046
Introduction to Compiler Development
Introduction to Compiler Development
Logan Chien
MCES 21CS43 Module 3 microcontroller notes
MCES 21CS43 Module 3 microcontroller notes
vinodthrupthi
舒从 舒弍仂舒亠 LLVM 弍从亠仆亟 于 C#. 亞仂 仂亞舒仂于 CoreHard Autumn 2019
舒从 舒弍仂舒亠 LLVM 弍从亠仆亟 于 C#. 亞仂 仂亞舒仂于 CoreHard Autumn 2019
corehard_by
Lecture Presentation 9.pdf fpga soc using c
Lecture Presentation 9.pdf fpga soc using c
minamelad457
TMPA-2017: Vellvm - Verifying the LLVM
TMPA-2017: Vellvm - Verifying the LLVM
Iosif Itkin
Chapter_04_ARM_Assembly.pptx ARM ASSEMBLY CODE
Chapter_04_ARM_Assembly.pptx ARM ASSEMBLY CODE
NagarathnaRajur2
Creating a Fibonacci Generator in Assembly - by Willem van Ketwich
Creating a Fibonacci Generator in Assembly - by Willem van Ketwich
Willem van Ketwich
iii-ii cd nCompiler design UNIT-V-1.pptx
iii-ii cd nCompiler design UNIT-V-1.pptx
nandan543979
5 - Advanced SVE.pdf
5 - Advanced SVE.pdf
JunZhao68
UNIT IV Compiler.pptx RUNTIMEENVIRONMENT
UNIT IV Compiler.pptx RUNTIMEENVIRONMENT
KavithaNagendran1
Pragmatic Optimization in Modern Programming - Demystifying the Compiler
Pragmatic Optimization in Modern Programming - Demystifying the Compiler
Marina Kolpakova
Smalltalk JIT Compilation: LLVM Experimentation
Smalltalk JIT Compilation: LLVM Experimentation
ESUG
microprocessors and ARM Assembly Language
microprocessors and ARM Assembly Language
JoelAttati
LAS16-501: Introduction to LLVM - Projects, Components, Integration, Internals
LAS16-501: Introduction to LLVM - Projects, Components, Integration, Internals
Linaro
07 140430-ipp-languages used in llvm during compilation
07 140430-ipp-languages used in llvm during compilation
Adam Hus叩r
Part II: LLVM Intermediate Representation
Part II: LLVM Intermediate Representation
Wei-Ren Chen
COMPILER_DESIGN_CLASS 2.ppt
COMPILER_DESIGN_CLASS 2.ppt
ssuserebb9821
COMPILER_DESIGN_CLASS 1.pptx
COMPILER_DESIGN_CLASS 1.pptx
ssuserebb9821
05 instruction set design and architecture
05 instruction set design and architecture
Waqar Jamil
Introduction to Compiler Development
Introduction to Compiler Development
Logan Chien
MCES 21CS43 Module 3 microcontroller notes
MCES 21CS43 Module 3 microcontroller notes
vinodthrupthi
舒从 舒弍仂舒亠 LLVM 弍从亠仆亟 于 C#. 亞仂 仂亞舒仂于 CoreHard Autumn 2019
舒从 舒弍仂舒亠 LLVM 弍从亠仆亟 于 C#. 亞仂 仂亞舒仂于 CoreHard Autumn 2019
corehard_by
Lecture Presentation 9.pdf fpga soc using c
Lecture Presentation 9.pdf fpga soc using c
minamelad457
TMPA-2017: Vellvm - Verifying the LLVM
TMPA-2017: Vellvm - Verifying the LLVM
Iosif Itkin
Chapter_04_ARM_Assembly.pptx ARM ASSEMBLY CODE
Chapter_04_ARM_Assembly.pptx ARM ASSEMBLY CODE
NagarathnaRajur2
Creating a Fibonacci Generator in Assembly - by Willem van Ketwich
Creating a Fibonacci Generator in Assembly - by Willem van Ketwich
Willem van Ketwich
iii-ii cd nCompiler design UNIT-V-1.pptx
iii-ii cd nCompiler design UNIT-V-1.pptx
nandan543979
5 - Advanced SVE.pdf
5 - Advanced SVE.pdf
JunZhao68
UNIT IV Compiler.pptx RUNTIMEENVIRONMENT
UNIT IV Compiler.pptx RUNTIMEENVIRONMENT
KavithaNagendran1
Pragmatic Optimization in Modern Programming - Demystifying the Compiler
Pragmatic Optimization in Modern Programming - Demystifying the Compiler
Marina Kolpakova
Smalltalk JIT Compilation: LLVM Experimentation
Smalltalk JIT Compilation: LLVM Experimentation
ESUG
microprocessors and ARM Assembly Language
microprocessors and ARM Assembly Language
JoelAttati
Ad

Recently uploaded (20)

Heat Treatment Process Automation in India
Heat Treatment Process Automation in India
Reckers Mechatronics
Shell Skill Tree - LabEx Certification (LabEx)
Shell Skill Tree - LabEx Certification (LabEx)
VICTOR MAESTRE RAMIREZ
Streamlining CI/CD with FME Flow: A Practical Guide
Streamlining CI/CD with FME Flow: A Practical Guide
Safe Software
Modern Platform Engineering with Choreo - The AI-Native Internal Developer Pl...
Modern Platform Engineering with Choreo - The AI-Native Internal Developer Pl...
WSO2
Women in Tech: Marketo Engage User Group - June 2025 - AJO with AWS
Women in Tech: Marketo Engage User Group - June 2025 - AJO with AWS
BradBedford3
NVIDIA GPU Technologies for AI and High-Performance Computing
NVIDIA GPU Technologies for AI and High-Performance Computing
SandeepKS52
Foundations of Marketo Engage - Programs, Campaigns & Beyond - June 2025
Foundations of Marketo Engage - Programs, Campaigns & Beyond - June 2025
BradBedford3
HYBRIDIZATION OF ALKANES AND ALKENES ...
HYBRIDIZATION OF ALKANES AND ALKENES ...
karishmaduhijod1
Advance Doctor Appointment Booking App With Online Payment
Advance Doctor Appointment Booking App With Online Payment
AxisTechnolabs
IObit Driver Booster Pro 12 Crack Latest Version Download
IObit Driver Booster Pro 12 Crack Latest Version Download
pcprocore
MOVIE RECOMMENDATION SYSTEM, UDUMULA GOPI REDDY, Y24MC13085.pptx
MOVIE RECOMMENDATION SYSTEM, UDUMULA GOPI REDDY, Y24MC13085.pptx
Maharshi Mallela
Who will create the languages of the future?
Who will create the languages of the future?
Jordi Cabot
Milwaukee Marketo User Group June 2025 - Optimize and Enhance Efficiency - Sm...
Milwaukee Marketo User Group June 2025 - Optimize and Enhance Efficiency - Sm...
BradBedford3
Artificial Intelligence Workloads and Data Center Management
Artificial Intelligence Workloads and Data Center Management
SandeepKS52
Making significant Software Architecture decisions
Making significant Software Architecture decisions
Bert Jan Schrijver
arctitecture application system design os dsa
arctitecture application system design os dsa
za241967
Smadav Pro 2025 Rev 15.4 Crack Full Version With Registration Key
Smadav Pro 2025 Rev 15.4 Crack Full Version With Registration Key
joybepari360
Best MLM Compensation Plans for Network Marketing Success in 2025
Best MLM Compensation Plans for Network Marketing Success in 2025
LETSCMS Pvt. Ltd.
Introduction to Agile Frameworks for Product Managers.pdf
Introduction to Agile Frameworks for Product Managers.pdf
Ali Vahed
Sysinfo OST to PST Converter Infographic
Sysinfo OST to PST Converter Infographic
SysInfo Tools
Heat Treatment Process Automation in India
Heat Treatment Process Automation in India
Reckers Mechatronics
Shell Skill Tree - LabEx Certification (LabEx)
Shell Skill Tree - LabEx Certification (LabEx)
VICTOR MAESTRE RAMIREZ
Streamlining CI/CD with FME Flow: A Practical Guide
Streamlining CI/CD with FME Flow: A Practical Guide
Safe Software
Modern Platform Engineering with Choreo - The AI-Native Internal Developer Pl...
Modern Platform Engineering with Choreo - The AI-Native Internal Developer Pl...
WSO2
Women in Tech: Marketo Engage User Group - June 2025 - AJO with AWS
Women in Tech: Marketo Engage User Group - June 2025 - AJO with AWS
BradBedford3
NVIDIA GPU Technologies for AI and High-Performance Computing
NVIDIA GPU Technologies for AI and High-Performance Computing
SandeepKS52
Foundations of Marketo Engage - Programs, Campaigns & Beyond - June 2025
Foundations of Marketo Engage - Programs, Campaigns & Beyond - June 2025
BradBedford3
HYBRIDIZATION OF ALKANES AND ALKENES ...
HYBRIDIZATION OF ALKANES AND ALKENES ...
karishmaduhijod1
Advance Doctor Appointment Booking App With Online Payment
Advance Doctor Appointment Booking App With Online Payment
AxisTechnolabs
IObit Driver Booster Pro 12 Crack Latest Version Download
IObit Driver Booster Pro 12 Crack Latest Version Download
pcprocore
MOVIE RECOMMENDATION SYSTEM, UDUMULA GOPI REDDY, Y24MC13085.pptx
MOVIE RECOMMENDATION SYSTEM, UDUMULA GOPI REDDY, Y24MC13085.pptx
Maharshi Mallela
Who will create the languages of the future?
Who will create the languages of the future?
Jordi Cabot
Milwaukee Marketo User Group June 2025 - Optimize and Enhance Efficiency - Sm...
Milwaukee Marketo User Group June 2025 - Optimize and Enhance Efficiency - Sm...
BradBedford3
Artificial Intelligence Workloads and Data Center Management
Artificial Intelligence Workloads and Data Center Management
SandeepKS52
Making significant Software Architecture decisions
Making significant Software Architecture decisions
Bert Jan Schrijver
arctitecture application system design os dsa
arctitecture application system design os dsa
za241967
Smadav Pro 2025 Rev 15.4 Crack Full Version With Registration Key
Smadav Pro 2025 Rev 15.4 Crack Full Version With Registration Key
joybepari360
Best MLM Compensation Plans for Network Marketing Success in 2025
Best MLM Compensation Plans for Network Marketing Success in 2025
LETSCMS Pvt. Ltd.
Introduction to Agile Frameworks for Product Managers.pdf
Introduction to Agile Frameworks for Product Managers.pdf
Ali Vahed
Sysinfo OST to PST Converter Infographic
Sysinfo OST to PST Converter Infographic
SysInfo Tools
Ad

LLVM Overview

  • 2. Agenda What is LLVM Why is it good How does it work IR, SSA, Phi nodes, data alignment
  • 4. What is LLVM? A set of reusable libraries for implementing compilers Started in 2000 Written in C++, 811k SLOC As of today, works with C, C++, ObjC, Ada, D, Fortran Not an acronym, LLVM scope is not limited to creation of VM LLVM = umbrella project + IR + debugger + C++ standard library
  • 5. Why is it good?
  • 6. Why is it good? Supports lot of instruction sets: ARM, Hexagon, MIPS, NVPTX, R600, SPARC, x86/x86-64, even PowerPC! It's a layer between top level code and the executable It makes the front end and the back end decoupled Supports runtime compilation (JIT) Has lots of optimizers
  • 7. How does it work?
  • 8. How does it work? In a nutshell: Generate LLVM IR from your compiler Run optimizers Create object 鍖les, assembly, or machine code in memory
  • 9. How does it work? Tokenise the source code Parse the token stream Build the AST Optimize IR Assemble
  • 10. LLVM IR Unlimited SSA Register machine instruction set Representations: Human-readable LLVM assembly (.ll) Dense 'bitcode' binaries (.bc) C++ classes
  • 11. Static Single Assignment Let's consider the following code: int main(int argc, const char* argv[]) { int i = 1; i = i * 2; return 0; } Which yields us...
  • 12. Static Single Assignment Note: LLVM registers are indexed. So %1 is the 鍖rst allocated register, %2 is the second, etc. define i32 @main(i32 %argc, i8** %argv) #0 { %1 = alloca i32, align 4 %2 = alloca i32, align 4 %3 = alloca i8**, align 8 %i = alloca i32, align 4 ; declare i store i32 0, i32* %1 store i32 %argc, i32* %2, align 4 store i8** %argv, i8*** %3, align 8 ; startup till here store i32 1, i32* %i, align 4 ; store 1 in i %4 = load i32* %i, align 4 ; store i in %4 %5 = mul nsw i32 %4, 2 ; multiply %4 by 2 and store in %5 store i32 %5, i32* %i, align 4 ; store %5 in i ret i32 0 }
  • 13. But wait... d0: y := 1 d1: y := 2 d2: x := y d0 is redundant, right? It has no effect on the 鍖nal value of x. But we know it because we are smart. Compilers aren't that smart, so they have to do Reaching De鍖nition analysis to determine that. Let's convert it to SSA form? d0: y1 := 1 d1: y2 := 2 d2: x1 := y2 Mmm... much better.
  • 14. Bene鍖ts of SSA Get rid of use-de鍖ne chains with reaching de鍖nition If a variable has N uses and M de鍖nitions, it takes space and time proportional to N揃M to represent use-def chains, while size of the SSA form is linear in the size of the original pattern Simpli鍖es other algorithms related to optimization & data structures or even gets rid of them
  • 15. And what about those nodes? Well, these ones are necessary when a variable can be assigned a different value based on the control 鍖ow. Sample code on the left, usage of Phi nodes on the right. y = 1 y1 = 1 if (condition) if (condition) y = 2 y2 = 2 x = y x1 = 陸(y1, y2) The Phi node selects y1 or y2, depending where the control 鍖ow reached the Phi node. The argument y1 is associated with the block de鍖ning y1. Same thing goes with y2.
  • 16. A better example of nodes void func(bool first, bool second) { bool third = first || second; } Which yields us...
  • 17. define void @func(i1 zeroext %first, i1 zeroext %second) #0 { %1 = alloca i8, align 1 %2 = alloca i8, align 1 %third = alloca i8, align 1 %3 = zext i1 %first to i8 store i8 %3, i8* %1, align 1 %4 = zext i1 %second to i8 store i8 %4, i8* %2, align 1 %5 = load i8* %1, align 1 ; Decide what's first || second %6 = trunc i8 %5 to i1 ; and store it in %6 br i1 %6, label %10, label %7 ; The actually interesting part, labeled %0 ; <label>:7 %8 = load i8* %2, align 1 %9 = trunc i8 %8 to i1 br label %10 ; labeled %7 ; <label>:10 ; preds = %7, %0 %11 = phi i1 [ true, %0 ], [ %9, %7 ] ; ... yield true if came from %0, otherwise yield %9 %12 = zext i1 %11 to i8 store i8 %12, i8* %third, align 1 ret void }
  • 18. And what's about those align keywords? The CPU accesses memory by a single word at a time If it happens so that the highest and lowest bits are not within the same memory word being accessed, the CPU will have to split the read in two reads! :( Not very good when you are optimizing machine code Solution - pad those values, so that you will always read the data in as few cycles as possible ARM, for instance, does not support unaligned memory access